* Only define loff_t for __USE_MISC (bug 14553)
@ 2018-02-01 20:36 Joseph Myers
2018-02-06 18:03 ` Ping " Joseph Myers
2018-02-06 18:38 ` Florian Weimer
0 siblings, 2 replies; 3+ messages in thread
From: Joseph Myers @ 2018-02-01 20:36 UTC (permalink / raw)
To: libc-alpha
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 <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.
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
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Ping Re: Only define loff_t for __USE_MISC (bug 14553)
2018-02-01 20:36 Only define loff_t for __USE_MISC (bug 14553) Joseph Myers
@ 2018-02-06 18:03 ` Joseph Myers
2018-02-06 18:38 ` Florian Weimer
1 sibling, 0 replies; 3+ messages in thread
From: Joseph Myers @ 2018-02-06 18:03 UTC (permalink / raw)
To: libc-alpha
Ping. This patch
<https://sourceware.org/ml/libc-alpha/2018-02/msg00034.html> is pending
review.
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Only define loff_t for __USE_MISC (bug 14553)
2018-02-01 20:36 Only define loff_t for __USE_MISC (bug 14553) Joseph Myers
2018-02-06 18:03 ` Ping " Joseph Myers
@ 2018-02-06 18:38 ` Florian Weimer
1 sibling, 0 replies; 3+ messages in thread
From: Florian Weimer @ 2018-02-06 18:38 UTC (permalink / raw)
To: Joseph Myers, libc-alpha
On 02/01/2018 09:36 PM, Joseph Myers wrote:
> [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.
Looks okay.
Thanks,
Florian
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-02-06 18:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-01 20:36 Only define loff_t for __USE_MISC (bug 14553) Joseph Myers
2018-02-06 18:03 ` Ping " Joseph Myers
2018-02-06 18:38 ` Florian Weimer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).