Skip to content

Commit 474b9c7

Browse files
committed
y2038: sched: Change sched_rr_get_interval to use __kernel_timespec
This is a preparation patch for converting sys_sched_rr_get_interval to work with 64-bit time_t on 32-bit architectures. The 'interval' argument is changed to struct __kernel_timespec, which will be redefined using 64-bit time_t in the future. The compat version of the system call in turn is enabled for compilation with CONFIG_COMPAT_32BIT_TIME so the individual 32-bit architectures can share the handling of the traditional argument with 64-bit architectures providing it for their compat mode. Signed-off-by: Arnd Bergmann <[email protected]>
1 parent 4faea23 commit 474b9c7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/linux/syscalls.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ asmlinkage long sys_sched_yield(void);
614614
asmlinkage long sys_sched_get_priority_max(int policy);
615615
asmlinkage long sys_sched_get_priority_min(int policy);
616616
asmlinkage long sys_sched_rr_get_interval(pid_t pid,
617-
struct timespec __user *interval);
617+
struct __kernel_timespec __user *interval);
618618

619619
/* kernel/signal.c */
620620
asmlinkage long sys_restart_syscall(void);

kernel/sched/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5243,7 +5243,7 @@ static int sched_rr_get_interval(pid_t pid, struct timespec64 *t)
52435243
* an error code.
52445244
*/
52455245
SYSCALL_DEFINE2(sched_rr_get_interval, pid_t, pid,
5246-
struct timespec __user *, interval)
5246+
struct __kernel_timespec __user *, interval)
52475247
{
52485248
struct timespec64 t;
52495249
int retval = sched_rr_get_interval(pid, &t);
@@ -5254,7 +5254,7 @@ SYSCALL_DEFINE2(sched_rr_get_interval, pid_t, pid,
52545254
return retval;
52555255
}
52565256

5257-
#ifdef CONFIG_COMPAT
5257+
#ifdef CONFIG_COMPAT_32BIT_TIME
52585258
COMPAT_SYSCALL_DEFINE2(sched_rr_get_interval,
52595259
compat_pid_t, pid,
52605260
struct old_timespec32 __user *, interval)

0 commit comments

Comments
 (0)