@@ -127,6 +127,9 @@ SYSCALL_DEF(shmdt, ARG_PTR);
#if !defined(SYSCALL_TABLE) || defined(TARGET_NR_shmget)
SYSCALL_DEF(shmget, ARG_DEC, ARG_DEC, ARG_HEX);
#endif
+#ifdef TARGET_NR_time
+SYSCALL_DEF(time, ARG_PTR);
+#endif
#ifdef TARGET_NR_unlink
SYSCALL_DEF(unlink, ARG_STR);
#endif
new file mode 100644
@@ -0,0 +1,32 @@
+/*
+ * Linux time related syscalls
+ * Copyright (c) 2003 Fabrice Bellard
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifdef TARGET_NR_time
+SYSCALL_IMPL(time)
+{
+ time_t host_time;
+ abi_long ret = get_errno(time(&host_time));
+
+ if (!is_error(ret)
+ && arg1
+ && put_user_sal(host_time, arg1)) {
+ return -TARGET_EFAULT;
+ }
+ return ret;
+}
+#endif
@@ -5331,18 +5331,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
void *p;
switch(num) {
-#ifdef TARGET_NR_time
- case TARGET_NR_time:
- {
- time_t host_time;
- ret = get_errno(time(&host_time));
- if (!is_error(ret)
- && arg1
- && put_user_sal(host_time, arg1))
- return -TARGET_EFAULT;
- }
- return ret;
-#endif
#ifdef TARGET_NR_mknod
case TARGET_NR_mknod:
if (!(p = lock_user_string(arg1)))
@@ -9303,6 +9291,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
#include "syscall-ipc.inc.c"
#include "syscall-mem.inc.c"
#include "syscall-proc.inc.c"
+#include "syscall-time.inc.c"
#undef SYSCALL_IMPL
#undef SYSCALL_ARGS
@@ -1350,9 +1350,6 @@
#ifdef TARGET_NR_tgkill
{ TARGET_NR_tgkill, "tgkill" , NULL, print_tgkill, NULL },
#endif
-#ifdef TARGET_NR_time
-{ TARGET_NR_time, "time" , NULL, NULL, NULL },
-#endif
#ifdef TARGET_NR_timer_create
{ TARGET_NR_timer_create, "timer_create" , NULL, NULL, NULL },
#endif
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- linux-user/syscall-defs.h | 3 +++ linux-user/syscall-time.inc.c | 32 ++++++++++++++++++++++++++++++++ linux-user/syscall.c | 13 +------------ linux-user/strace.list | 3 --- 4 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 linux-user/syscall-time.inc.c -- 2.17.2