[RFC v2 1/2] sys/types.h: Define new type: snseconds_t

Rich Felker dalias@libc.org
Wed Dec 8 00:29:11 GMT 2021


On Tue, Dec 07, 2021 at 10:48:14PM +0100, Alejandro Colomar wrote:
> Based on the existing suseconds_t type.
> 
> The timespec(3) structure uses long for tv_nsec,
> except if __x86_64__ && __ILP32__,
> in which case it uses long long.
> Let's define a stable type that can be relied upon by users,
> for example for creating pointers.

This is a non-starter because the relevant standards already require
the tv_nsec member to have type long. x32 just needs to be fixed to
match the requirement. This is really easy to do; just change the
definition to have the appropriate padding. Don't make a huge mess for
the sake of a barely-used target that just had a messy but fixable
bug.

Rich


More information about the Libc-alpha mailing list