PATCH [3/n]: Add __snseconds_t and __SNSECONDS_T_TYPE

H.J. Lu hjl.tools@gmail.com
Thu Mar 15 20:26:00 GMT 2012


On Thu, Mar 15, 2012 at 12:50 PM, Roland McGrath <roland@hack.frob.com> wrote:
>> Linux/x32 uses long long for time_t. timespec has
>>
>> struct timespec
>>   {
>>     __time_t tv_sec;          /* Seconds.  */
>>     long int tv_nsec;         /* Nanoseconds.  */
>>   };
>>
>> Linux/x32 uses the same timespec as x86-64 inside kernel. That means
>> tv_nsec must also be 64bit for Linux/x32. However, we don't have
>> __snseconds_t.  This patch defines time_t to 64bit and adds __snseconds_t
>> similar to __suseconds_t.
>
> That's fine, but it's its own one change to start using that and
> a separate change to add sysdeps/unix/sysv/linux/x86_64/bits/typesizes.h
> afterwards.

Here is a patch just to add __snseconds_t.

>> This patch defines __SSYSCALL_LONG_TYPE and __USYSCALL_LONG_TYPE to
>
> That doesn't belong in the __snseconds_t patch.
>
>> struct ipc_perm
>>   {
>>     __key_t __key;                    /* Key.  */
>>     __uid_t uid;                      /* Owner's user ID.  */
>>     __gid_t gid;                      /* Owner's group ID.  */
>>     __uid_t cuid;                     /* Creator's user ID.  */
>>     __gid_t cgid;                     /* Creator's group ID.  */
>>     unsigned short int mode;          /* Read/write permission.  */
>>     unsigned short int __pad1;
>>     unsigned short int __seq;         /* Sequence number.  */
>>     unsigned short int __pad2;
>>     __USYSCALL_LONG_TYPE __unused1;
>>     __USYSCALL_LONG_TYPE __unused2;
>>   };
>
> Definitions like this shouldn't use __*_TYPE macros at all.
> They should use typedefs instead.
>

I will add __ssyscall_long_t and __usyscall_long_t in a separate
patch.

Thanks.


-- 
H.J.
----
2012-03-15  H.J. Lu  <hongjiu.lu@intel.com>

	* bits/types.h (__snseconds_t): New.
	* bits/typesizes.h (__SNSECONDS_T_TYPE): Likewise.
	* sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h (__SNSECONDS_T_TYPE):
	Likewise.
	* sysdeps/unix/sysv/linux/s390/bits/typesizes.h (__SNSECONDS_T_TYPE):
	Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/typesizes.h (__SNSECONDS_T_TYPE):
	Likewise.

	* time/time.h (timespec): Use __snseconds_t on tv_nsec.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-snseconds_t.patch
Type: text/x-patch
Size: 4235 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120315/5ca6f71c/attachment.bin>


More information about the Libc-alpha mailing list