From patchwork Thu Feb 1 20:36:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 868420 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-89888-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="JA0VZ3Pt"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zXX3P0xJyz9sBZ for ; Fri, 2 Feb 2018 07:37:04 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=xKL5XKzWWpvQIlOc4ypQ1ucx0vT/+ cuPAW7VKvtiki+7uAFzSbSiZTssOpRW9+pnC1+iNLTXn9n5uQNUXopxjpA/CIGOW HS0DhLlRn5mIBh8rCHThGLo9tvQKUHGqjmE9aKvWV8kYwjeXlsYUyR0vlfI6CIC3 FVMhf9LhMbxc6Y= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=6vVx9m5hgOFe1rXUPfu/WyercrA=; b=JA0 VZ3PtNzmBW+49nedZonjgr7yXG+AiLEDWnQIclVmI7OAvBfFh8IvkdAPWLGm4Lpc HAm+Jn4g9LGoXhv9LsOki3/9ZISY4+DVy5+xoFvoS3gdPMXn2BbN175dBLdCvrz5 cCGKz7lLkvc4U9qj/Bk0ze1/frZ/Bw15NQNSIe6M= Received: (qmail 117622 invoked by alias); 1 Feb 2018 20:36:59 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 117613 invoked by uid 89); 1 Feb 2018 20:36:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Date: Thu, 1 Feb 2018 20:36:52 +0000 From: Joseph Myers To: Subject: Only define loff_t for __USE_MISC (bug 14553) Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) Bug 14553 reports that sys/types.h defines loff_t unconditionally, despite it not being part of any supported standard. This is permitted by the POSIX *_t reservation, but as a quality-of-implementation issue it's still best not to define it except for __USE_MISC. This patch conditions the definition accordingly, updating a macro in sysdeps/unix/sysv/linux/sys/quota.h to use __loff_t so it still works even if __USE_MISC is not defined. codesearch.debian.net suggests there are quite a lot of loff_t uses outside glibc, but it might well make sense to change all (few) uses of loff_t or __loff_t inside glibc to use off64_t or __off64_t instead, leaving only the definitions, treating this name as obsolescent. Tested for x86_64. 2018-02-01 Joseph Myers [BZ #14553] * posix/sys/types.h (loff_t): Only define for [__USE_MISC]. * sysdeps/unix/sysv/linux/sys/quota.h (dqoff): Use __loff_t instead of loff_t. diff --git a/posix/sys/types.h b/posix/sys/types.h index a9e0005..e8d51a1 100644 --- a/posix/sys/types.h +++ b/posix/sys/types.h @@ -39,9 +39,8 @@ typedef __u_quad_t u_quad_t; typedef __fsid_t fsid_t; # define __u_char_defined # endif -#endif - typedef __loff_t loff_t; +#endif #ifndef __ino_t_defined # ifndef __USE_FILE_OFFSET64 diff --git a/sysdeps/unix/sysv/linux/sys/quota.h b/sysdeps/unix/sysv/linux/sys/quota.h index c2a0aaa..23f569e 100644 --- a/sysdeps/unix/sysv/linux/sys/quota.h +++ b/sysdeps/unix/sysv/linux/sys/quota.h @@ -114,7 +114,7 @@ struct dqblk #define dq_btime dq_dqb.dqb_btime #define dq_itime dq_dqb.dqb_itime -#define dqoff(UID) ((loff_t)((UID) * sizeof (struct dqblk))) +#define dqoff(UID) ((__loff_t)((UID) * sizeof (struct dqblk))) /* Old name for struct if_dqinfo. */ struct dqinfo