y2038: socket: Change recvmmsg to use __kernel_timespec
This converts the recvmmsg() system call in all its variations to use 'timespec64' internally for its timeout, and have a __kernel_timespec64 argument in the native entry point. This lets us change the type to use 64-bit time_t at a later point while using the 32-bit compat system call emulation for existing user space. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
@@ -815,18 +815,18 @@ static int __compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg,
|
||||
struct old_timespec32 __user *timeout)
|
||||
{
|
||||
int datagrams;
|
||||
struct timespec ktspec;
|
||||
struct timespec64 ktspec;
|
||||
|
||||
if (timeout == NULL)
|
||||
return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
|
||||
flags | MSG_CMSG_COMPAT, NULL);
|
||||
|
||||
if (compat_get_timespec(&ktspec, timeout))
|
||||
if (compat_get_timespec64(&ktspec, timeout))
|
||||
return -EFAULT;
|
||||
|
||||
datagrams = __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
|
||||
flags | MSG_CMSG_COMPAT, &ktspec);
|
||||
if (datagrams > 0 && compat_put_timespec(&ktspec, timeout))
|
||||
if (datagrams > 0 && compat_put_timespec64(&ktspec, timeout))
|
||||
datagrams = -EFAULT;
|
||||
|
||||
return datagrams;
|
||||
|
Reference in New Issue
Block a user