Skip to content

Commit 6d5b841

Browse files
deepa-hubarndb
authored andcommitted
time: Change types to new y2038 safe __kernel_* types
Change over clock_settime, clock_gettime and clock_getres syscalls to use __kernel_timespec times. This will enable changing over of these syscalls to use new y2038 safe syscalls when the architectures define the CONFIG_64BIT_TIME. Cc: linux-api@vger.kernel.org Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent ea2ce8f commit 6d5b841

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

include/linux/syscalls.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -567,11 +567,11 @@ asmlinkage long sys_timer_settime(timer_t timer_id, int flags,
567567
struct itimerspec __user *old_setting);
568568
asmlinkage long sys_timer_delete(timer_t timer_id);
569569
asmlinkage long sys_clock_settime(clockid_t which_clock,
570-
const struct timespec __user *tp);
570+
const struct __kernel_timespec __user *tp);
571571
asmlinkage long sys_clock_gettime(clockid_t which_clock,
572-
struct timespec __user *tp);
572+
struct __kernel_timespec __user *tp);
573573
asmlinkage long sys_clock_getres(clockid_t which_clock,
574-
struct timespec __user *tp);
574+
struct __kernel_timespec __user *tp);
575575
asmlinkage long sys_clock_nanosleep(clockid_t which_clock, int flags,
576576
const struct timespec __user *rqtp,
577577
struct timespec __user *rmtp);

kernel/time/posix-stubs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ SYS_NI(alarm);
5959
*/
6060

6161
SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,
62-
const struct timespec __user *, tp)
62+
const struct __kernel_timespec __user *, tp)
6363
{
6464
struct timespec64 new_tp;
6565

@@ -92,7 +92,7 @@ int do_clock_gettime(clockid_t which_clock, struct timespec64 *tp)
9292
return 0;
9393
}
9494
SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock,
95-
struct timespec __user *, tp)
95+
struct __kernel_timespec __user *, tp)
9696
{
9797
int ret;
9898
struct timespec64 kernel_tp;
@@ -106,7 +106,7 @@ SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock,
106106
return 0;
107107
}
108108

109-
SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock, struct timespec __user *, tp)
109+
SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock, struct __kernel_timespec __user *, tp)
110110
{
111111
struct timespec64 rtn_tp = {
112112
.tv_sec = 0,

kernel/time/posix-timers.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ void exit_itimers(struct signal_struct *sig)
10411041
}
10421042

10431043
SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,
1044-
const struct timespec __user *, tp)
1044+
const struct __kernel_timespec __user *, tp)
10451045
{
10461046
const struct k_clock *kc = clockid_to_kclock(which_clock);
10471047
struct timespec64 new_tp;
@@ -1056,7 +1056,7 @@ SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,
10561056
}
10571057

10581058
SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock,
1059-
struct timespec __user *,tp)
1059+
struct __kernel_timespec __user *, tp)
10601060
{
10611061
const struct k_clock *kc = clockid_to_kclock(which_clock);
10621062
struct timespec64 kernel_tp;
@@ -1097,7 +1097,7 @@ SYSCALL_DEFINE2(clock_adjtime, const clockid_t, which_clock,
10971097
}
10981098

10991099
SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock,
1100-
struct timespec __user *, tp)
1100+
struct __kernel_timespec __user *, tp)
11011101
{
11021102
const struct k_clock *kc = clockid_to_kclock(which_clock);
11031103
struct timespec64 rtn_tp;

0 commit comments

Comments
 (0)