From: Alejandro Colomar <alx.manpages@gmail.com>
To: libc-alpha@sourceware.org
Cc: "Alejandro Colomar" <alx.manpages@gmail.com>,
наб <nabijaczleweli@nabijaczleweli.xyz>,
"Jakub Wilk" <jwilk@jwilk.net>, "Zack Weinberg" <zackw@panix.com>,
"Stefan Puiu" <stefan.puiu@gmail.com>,
"Michael Kerrisk" <mtk.manpages@gmail.com>,
"H . J . Lu" <hjl.tools@gmail.com>,
"Joseph Myers" <joseph@codesourcery.com>,
"Rich Felker" <dalias@libc.org>,
"Andreas Schwab" <schwab@linux-m68k.org>,
"Paul Eggert" <eggert@cs.ucla.edu>
Subject: [RFC v3 2/3] sys/types.h: struct timespec: Use __snseconds_t for tv_nsec
Date: Wed, 8 Dec 2021 15:47:58 +0100 [thread overview]
Message-ID: <20211208144757.37641-2-alx.manpages@gmail.com> (raw)
In-Reply-To: <20211207111957.8087-1-alx.manpages@gmail.com>
The timespec(3) structure uses long for tv_nsec,
except if __x86_64__ && __ILP32__,
in which case it uses long long.
Use __snseconds_t to simplify the definition of struct timespec.
Link: linux-man <https://lore.kernel.org/linux-man/ec1dcc655184f6cdaae40ff8b7970b750434e4ef.1638123425.git.nabijaczleweli@nabijaczleweli.xyz/T/>
Link: glibc <https://sourceware.org/pipermail/libc-alpha/2021-December/133702.html>
Cc: наб <nabijaczleweli@nabijaczleweli.xyz>
Cc: Jakub Wilk <jwilk@jwilk.net>
Cc: Zack Weinberg <zackw@panix.com>
Cc: Stefan Puiu <stefan.puiu@gmail.com>
Cc: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
Cc: H.J. Lu <hjl.tools@gmail.com>
Cc: Joseph Myers <joseph@codesourcery.com>
Cc: Rich Felker <dalias@libc.org>
Cc: Andreas Schwab <schwab@linux-m68k.org>
Cc: Paul Eggert <eggert@cs.ucla.edu>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
time/bits/types/struct_timespec.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/time/bits/types/struct_timespec.h b/time/bits/types/struct_timespec.h
index 489e81136d..cc366590d9 100644
--- a/time/bits/types/struct_timespec.h
+++ b/time/bits/types/struct_timespec.h
@@ -18,14 +18,14 @@ struct timespec
#if __WORDSIZE == 64 \
|| (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \
|| (__TIMESIZE == 32 && !defined __USE_TIME_BITS64)
- __syscall_slong_t tv_nsec; /* Nanoseconds. */
+ __snseconds_t tv_nsec; /* Nanoseconds. */
#else
# if __BYTE_ORDER == __BIG_ENDIAN
- int: 32; /* Padding. */
- long int tv_nsec; /* Nanoseconds. */
+ int: 32; /* Padding. */
+ __snseconds_t tv_nsec; /* Nanoseconds. */
# else
- long int tv_nsec; /* Nanoseconds. */
- int: 32; /* Padding. */
+ __snseconds_t tv_nsec; /* Nanoseconds. */
+ int: 32; /* Padding. */
# endif
#endif
};
--
2.34.1
next prev parent reply other threads:[~2021-12-08 14:50 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-07 11:19 [PATCH] sys/types.h: Define new types: [s]nseconds_t Alejandro Colomar
2021-12-07 12:36 ` Andreas Schwab
2021-12-07 13:17 ` наб
2021-12-07 18:20 ` Alejandro Colomar (man-pages)
2021-12-07 21:48 ` наб
2021-12-07 19:10 ` Joseph Myers
2021-12-07 15:50 ` Zack Weinberg
2021-12-07 18:24 ` Alejandro Colomar (man-pages)
2021-12-07 21:48 ` [RFC v2 1/2] sys/types.h: Define new type: snseconds_t Alejandro Colomar
2021-12-07 23:56 ` Joseph Myers
2021-12-08 0:17 ` Paul Eggert
2021-12-08 0:29 ` Rich Felker
2021-12-08 2:26 ` Zack Weinberg
2021-12-08 3:05 ` Rich Felker
2021-12-08 14:34 ` Zack Weinberg
2021-12-08 17:38 ` Rich Felker
2021-12-08 19:52 ` Zack Weinberg
2021-12-08 18:15 ` Adhemerval Zanella
2021-12-08 21:41 ` Joseph Myers
2021-12-07 22:05 ` [RFC v2 2/2] sys/types.h: struct timespec: Use snseconds_t for tv_nsec Alejandro Colomar
2021-12-08 14:47 ` [RFC v3 1/3] bits/types[izes].h: Define new internal type: __snseconds_t Alejandro Colomar
2021-12-08 14:47 ` Alejandro Colomar [this message]
2021-12-08 14:53 ` [RFC v3 2/3] sys/types.h: struct timespec: Use __snseconds_t for tv_nsec Zack Weinberg
2021-12-08 15:17 ` Alejandro Colomar (man-pages)
2021-12-08 15:24 ` Joseph Myers
2021-12-08 15:47 ` Alejandro Colomar (man-pages)
2021-12-08 15:59 ` Zack Weinberg
2021-12-08 17:44 ` Rich Felker
2021-12-08 14:48 ` [RFC v3 3/3] sys/types.h: Make snseconds_t user visible Alejandro Colomar
2021-12-08 14:55 ` Zack Weinberg
2021-12-08 15:15 ` Alejandro Colomar (man-pages)
2021-12-08 18:12 ` Paul Eggert
2021-12-08 18:25 ` Rich Felker
2021-12-08 20:10 ` Zack Weinberg
2021-12-08 20:34 ` Rich Felker
2021-12-08 21:12 ` Adhemerval Zanella
2021-12-08 21:53 ` Alejandro Colomar (man-pages)
2021-12-09 19:20 ` Adhemerval Zanella
2021-12-09 19:42 ` Paul Eggert
2021-12-09 19:52 ` Adhemerval Zanella
2021-12-09 20:13 ` Joseph Myers
2021-12-09 20:17 ` Rich Felker
2021-12-09 20:23 ` Alejandro Colomar (man-pages)
2021-12-09 20:29 ` Joseph Myers
2021-12-09 20:34 ` Alejandro Colomar (man-pages)
2021-12-09 20:40 ` Joseph Myers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211208144757.37641-2-alx.manpages@gmail.com \
--to=alx.manpages@gmail.com \
--cc=dalias@libc.org \
--cc=eggert@cs.ucla.edu \
--cc=hjl.tools@gmail.com \
--cc=joseph@codesourcery.com \
--cc=jwilk@jwilk.net \
--cc=libc-alpha@sourceware.org \
--cc=mtk.manpages@gmail.com \
--cc=nabijaczleweli@nabijaczleweli.xyz \
--cc=schwab@linux-m68k.org \
--cc=stefan.puiu@gmail.com \
--cc=zackw@panix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).