Commit 4f9fbd89 authored by Arnd Bergmann's avatar Arnd Bergmann

y2038: rename itimerval to __kernel_old_itimerval

Take the renaming of timeval and timespec one level further,
also renaming itimerval to __kernel_old_itimerval, to avoid
namespace conflicts with the user-space structure that may
use 64-bit time_t members.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 751addac
...@@ -16,8 +16,7 @@ struct inode; ...@@ -16,8 +16,7 @@ struct inode;
struct iocb; struct iocb;
struct io_event; struct io_event;
struct iovec; struct iovec;
struct itimerspec; struct __kernel_old_itimerval;
struct itimerval;
struct kexec_segment; struct kexec_segment;
struct linux_dirent; struct linux_dirent;
struct linux_dirent64; struct linux_dirent64;
...@@ -591,10 +590,10 @@ asmlinkage long sys_nanosleep_time32(struct old_timespec32 __user *rqtp, ...@@ -591,10 +590,10 @@ asmlinkage long sys_nanosleep_time32(struct old_timespec32 __user *rqtp,
struct old_timespec32 __user *rmtp); struct old_timespec32 __user *rmtp);
/* kernel/itimer.c */ /* kernel/itimer.c */
asmlinkage long sys_getitimer(int which, struct itimerval __user *value); asmlinkage long sys_getitimer(int which, struct __kernel_old_itimerval __user *value);
asmlinkage long sys_setitimer(int which, asmlinkage long sys_setitimer(int which,
struct itimerval __user *value, struct __kernel_old_itimerval __user *value,
struct itimerval __user *ovalue); struct __kernel_old_itimerval __user *ovalue);
/* kernel/kexec.c */ /* kernel/kexec.c */
asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments, asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments,
......
...@@ -33,6 +33,11 @@ struct __kernel_old_timespec { ...@@ -33,6 +33,11 @@ struct __kernel_old_timespec {
long tv_nsec; /* nanoseconds */ long tv_nsec; /* nanoseconds */
}; };
struct __kernel_old_itimerval {
struct __kernel_old_timeval it_interval;/* timer interval */
struct __kernel_old_timeval it_value; /* current value */
};
struct __kernel_sock_timeval { struct __kernel_sock_timeval {
__s64 tv_sec; __s64 tv_sec;
__s64 tv_usec; __s64 tv_usec;
......
...@@ -97,20 +97,20 @@ static int do_getitimer(int which, struct itimerspec64 *value) ...@@ -97,20 +97,20 @@ static int do_getitimer(int which, struct itimerspec64 *value)
return 0; return 0;
} }
static int put_itimerval(struct itimerval __user *o, static int put_itimerval(struct __kernel_old_itimerval __user *o,
const struct itimerspec64 *i) const struct itimerspec64 *i)
{ {
struct itimerval v; struct __kernel_old_itimerval v;
v.it_interval.tv_sec = i->it_interval.tv_sec; v.it_interval.tv_sec = i->it_interval.tv_sec;
v.it_interval.tv_usec = i->it_interval.tv_nsec / NSEC_PER_USEC; v.it_interval.tv_usec = i->it_interval.tv_nsec / NSEC_PER_USEC;
v.it_value.tv_sec = i->it_value.tv_sec; v.it_value.tv_sec = i->it_value.tv_sec;
v.it_value.tv_usec = i->it_value.tv_nsec / NSEC_PER_USEC; v.it_value.tv_usec = i->it_value.tv_nsec / NSEC_PER_USEC;
return copy_to_user(o, &v, sizeof(struct itimerval)) ? -EFAULT : 0; return copy_to_user(o, &v, sizeof(struct __kernel_old_itimerval)) ? -EFAULT : 0;
} }
SYSCALL_DEFINE2(getitimer, int, which, struct itimerval __user *, value) SYSCALL_DEFINE2(getitimer, int, which, struct __kernel_old_itimerval __user *, value)
{ {
struct itimerspec64 get_buffer; struct itimerspec64 get_buffer;
int error = do_getitimer(which, &get_buffer); int error = do_getitimer(which, &get_buffer);
...@@ -314,11 +314,11 @@ SYSCALL_DEFINE1(alarm, unsigned int, seconds) ...@@ -314,11 +314,11 @@ SYSCALL_DEFINE1(alarm, unsigned int, seconds)
#endif #endif
static int get_itimerval(struct itimerspec64 *o, const struct itimerval __user *i) static int get_itimerval(struct itimerspec64 *o, const struct __kernel_old_itimerval __user *i)
{ {
struct itimerval v; struct __kernel_old_itimerval v;
if (copy_from_user(&v, i, sizeof(struct itimerval))) if (copy_from_user(&v, i, sizeof(struct __kernel_old_itimerval)))
return -EFAULT; return -EFAULT;
/* Validate the timevals in value. */ /* Validate the timevals in value. */
...@@ -333,8 +333,8 @@ static int get_itimerval(struct itimerspec64 *o, const struct itimerval __user * ...@@ -333,8 +333,8 @@ static int get_itimerval(struct itimerspec64 *o, const struct itimerval __user *
return 0; return 0;
} }
SYSCALL_DEFINE3(setitimer, int, which, struct itimerval __user *, value, SYSCALL_DEFINE3(setitimer, int, which, struct __kernel_old_itimerval __user *, value,
struct itimerval __user *, ovalue) struct __kernel_old_itimerval __user *, ovalue)
{ {
struct itimerspec64 set_buffer, get_buffer; struct itimerspec64 set_buffer, get_buffer;
int error; int error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment