[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 26/74] linux-user: Split out time
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH v7 26/74] linux-user: Split out time |
Date: |
Sun, 19 May 2019 13:36:38 -0700 |
Signed-off-by: Richard Henderson <address@hidden>
---
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
diff --git a/linux-user/syscall-defs.h b/linux-user/syscall-defs.h
index 3fad9d51f0..9950b73e76 100644
--- a/linux-user/syscall-defs.h
+++ b/linux-user/syscall-defs.h
@@ -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
diff --git a/linux-user/syscall-time.inc.c b/linux-user/syscall-time.inc.c
new file mode 100644
index 0000000000..14fec88e47
--- /dev/null
+++ b/linux-user/syscall-time.inc.c
@@ -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
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 0bf5901014..ea89734706 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5384,18 +5384,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)))
@@ -9392,6 +9380,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
diff --git a/linux-user/strace.list b/linux-user/strace.list
index 3f79159b63..95706a696b 100644
--- a/linux-user/strace.list
+++ b/linux-user/strace.list
@@ -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
--
2.17.1
- [Qemu-devel] [PATCH v7 16/74] linux-user: Split out brk, (continued)
- [Qemu-devel] [PATCH v7 16/74] linux-user: Split out brk, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 18/74] linux-user: Split out wait4, waitid, waitpid, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 19/74] linux-user: Implement rusage argument to waitid, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 17/74] linux-user: Split out clone, fork, vfork, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 22/74] linux-user: Split out unlink, unlinkat, rmdir, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 21/74] linux-user: Split out link, linkat, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 13/74] linux-user: Split out ipc syscalls, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 23/74] linux-user: Split out execve, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 20/74] linux-user: Split out creat, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 24/74] linux-user: Implement execveat, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 26/74] linux-user: Split out time,
Richard Henderson <=
- [Qemu-devel] [PATCH v7 27/74] linux-user: Split out mknod, mknodat, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 30/74] linux-user: Split out getpid, getppid, getxpid, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 28/74] linux-user: Split out chmod, fchmod, fchmodat, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 25/74] linux-user: Split out chdir, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 33/74] linux-user: Split out stime, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 32/74] linux-user: Split out umount, umount2, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 29/74] linux-user: Split out lseek, llseek, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 31/74] linux-user: Split out mount, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 34/74] linux-user: Split out alarm, pause, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 35/74] linux-user: Split out utime, utimes, futimesat, Richard Henderson, 2019/05/19