mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-27 18:55:08 +07:00
0768e17073
The 'timeval' and 'timespec' data structures used for socket timestamps are going to be redefined in user space based on 64-bit time_t in future versions of the C library to deal with the y2038 overflow problem, which breaks the ABI definition. Unlike many modern ioctl commands, SIOCGSTAMP and SIOCGSTAMPNS do not use the _IOR() macro to encode the size of the transferred data, so it remains ambiguous whether the application uses the old or new layout. The best workaround I could find is rather ugly: we redefine the command code based on the size of the respective data structure with a ternary operator. This lets it get evaluated as late as possible, hopefully after that structure is visible to the caller. We cannot use an #ifdef here, because inux/sockios.h might have been included before any libc header that could determine the size of time_t. The ioctl implementation now interprets the new command codes as always referring to the 64-bit structure on all architectures, while the old architecture specific command code still refers to the old architecture specific layout. The new command number is only used when they are actually different. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net> |
||
---|---|---|
.. | ||
auxvec.h | ||
byteorder.h | ||
ioctls.h | ||
ipcbuf.h | ||
Kbuild | ||
mman.h | ||
msgbuf.h | ||
param.h | ||
poll.h | ||
posix_types.h | ||
ptrace.h | ||
sembuf.h | ||
setup.h | ||
shmbuf.h | ||
sigcontext.h | ||
signal.h | ||
sockios.h | ||
stat.h | ||
swab.h | ||
termbits.h | ||
types.h | ||
unistd.h |