summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2020-04-02 16:39:43 +0000
committerDmitry V. Levin <ldv@altlinux.org>2020-04-02 16:39:43 +0000
commit40eb6d9303d77d02ec652bfbbe6e679248ce8fb1 (patch)
tree057b6d1f3bafe0030a437cfe843bb626b7bed193
parent9df24749fd44d935a594183825a36b2f3ca926e1 (diff)
downloadstrace-40eb6d9303d77d02ec652bfbbe6e679248ce8fb1.tar.gz
linux/32: move wait4 and [gs]ettimeofday from syscallent.h to syscallent-time32.h
According to Linux kernel include/uapi/asm-generic/unistd.h, starting with commit v5.1-rc1~160^2~1^2~3 __NR_wait4, __NR_gettimeofday, and __NR_settimeofday are placed under __ARCH_WANT_TIME32_SYSCALLS and therefore should belong to syscallent-time32.h along with other 32-bit time_t based syscalls. * linux/32/syscallent.h [169, 170, 260]: Move entries ... * linux/32/syscallent-time32.h: ... here. * time.c (SYS_FUNC(gettimeofday), SYS_FUNC(settimeofday)): Place under [HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS] guard. * wait.c (SYS_FUNC(wait4)): Likewise. Complements: v5.5-39-gcc7e89011 "linux/32: Split 32-bit time_t based syscalls into a separate header"
-rw-r--r--linux/32/syscallent-time32.h3
-rw-r--r--linux/32/syscallent.h6
-rw-r--r--time.c20
-rw-r--r--wait.c2
4 files changed, 19 insertions, 12 deletions
diff --git a/linux/32/syscallent-time32.h b/linux/32/syscallent-time32.h
index aa3844eb2..f8b757a06 100644
--- a/linux/32/syscallent-time32.h
+++ b/linux/32/syscallent-time32.h
@@ -21,10 +21,13 @@
[115] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" },
[127] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"},
[137] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" },
+[169] = { 2, 0, SEN(gettimeofday), "gettimeofday" },
+[170] = { 2, 0, SEN(settimeofday), "settimeofday" },
[171] = { 1, 0, SEN(adjtimex32), "adjtimex" },
[182] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" },
[183] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" },
[192] = { 4, TI, SEN(semtimedop_time32), "semtimedop" },
[243] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" },
+[260] = { 4, TP, SEN(wait4), "wait4" },
[266] = { 2, 0, SEN(clock_adjtime32), "clock_adjtime" },
[292] = { 6, 0, SEN(io_pgetevents_time32), "io_pgetevents" },
diff --git a/linux/32/syscallent.h b/linux/32/syscallent.h
index dbd999a07..2024d2d0c 100644
--- a/linux/32/syscallent.h
+++ b/linux/32/syscallent.h
@@ -181,8 +181,8 @@
[166] = { 1, NF, SEN(umask), "umask" },
[167] = { 5, TC, SEN(prctl), "prctl" },
[168] = { 3, 0, SEN(getcpu), "getcpu" },
-[169] = { 2, 0, SEN(gettimeofday), "gettimeofday" },
-[170] = { 2, 0, SEN(settimeofday), "settimeofday" },
+/* [169] gettimeofday */
+/* [170] settimeofday */
/* [171] adjtimex */
[172] = { 0, PU|NF, SEN(getpid), "getpid" },
[173] = { 0, PU|NF, SEN(getppid), "getppid" },
@@ -257,7 +257,7 @@
[242] = { 4, TN, SEN(accept4), "accept4" },
/* [243] recvmmsg */
/* [244 ... 259] are arch specific */
-[260] = { 4, TP, SEN(wait4), "wait4" },
+/* [260] wait4 */
[261] = { 4, 0, SEN(prlimit64), "prlimit64" },
[262] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
[263] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
diff --git a/time.c b/time.c
index 19b06c402..992af48db 100644
--- a/time.c
+++ b/time.c
@@ -25,6 +25,7 @@ print_timezone(struct tcb *const tcp, const kernel_ulong_t addr)
tz.tz_minuteswest, tz.tz_dsttime);
}
+#if HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS
SYS_FUNC(gettimeofday)
{
if (exiting(tcp)) {
@@ -35,6 +36,16 @@ SYS_FUNC(gettimeofday)
return 0;
}
+SYS_FUNC(settimeofday)
+{
+ print_timeval(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ print_timezone(tcp, tcp->u_arg[1]);
+
+ return RVAL_DECODED;
+}
+#endif
+
#ifdef ALPHA
SYS_FUNC(osf_gettimeofday)
{
@@ -47,15 +58,6 @@ SYS_FUNC(osf_gettimeofday)
}
#endif
-SYS_FUNC(settimeofday)
-{
- print_timeval(tcp, tcp->u_arg[0]);
- tprints(", ");
- print_timezone(tcp, tcp->u_arg[1]);
-
- return RVAL_DECODED;
-}
-
#ifdef ALPHA
SYS_FUNC(osf_settimeofday)
{
diff --git a/wait.c b/wait.c
index dbc917b1b..eb8bb7137 100644
--- a/wait.c
+++ b/wait.c
@@ -116,10 +116,12 @@ SYS_FUNC(waitpid)
return printwaitn(tcp, NULL);
}
+#if HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS
SYS_FUNC(wait4)
{
return printwaitn(tcp, printrusage);
}
+#endif
#ifdef ALPHA
SYS_FUNC(osf_wait4)