]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Only define loff_t for __USE_MISC (bug 14553).
authorJoseph Myers <joseph@codesourcery.com>
Tue, 6 Feb 2018 21:29:50 +0000 (21:29 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 6 Feb 2018 21:29:50 +0000 (21:29 +0000)
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.

[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.

ChangeLog
posix/sys/types.h
sysdeps/unix/sysv/linux/sys/quota.h

index a30eeead7e01f8afbbc26364798908642cd701b8..c9734c46b67502c5d0a829b4a7143d73db813c59 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-02-06  Joseph Myers  <joseph@codesourcery.com>
+
+       [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.
+
 2018-02-06  Florian Weimer <fweimer@redhat.com>
 
        [BZ #18023]
index a9e0005cabaac91f85066a9e3962e8408b3ec02a..e8d51a1342ac60b989d7bcf15db5d887b643a4b5 100644 (file)
@@ -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
index c2a0aaa88d9293edf5b02ba094566b8d35cd8fff..23f569ee9afeb4d31f969733407602676967fba5 100644 (file)
@@ -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