[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 07/49] linux-user: Split out close
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH v6 07/49] linux-user: Split out close |
Date: |
Sat, 19 Jan 2019 08:30:40 +1100 |
Signed-off-by: Richard Henderson <address@hidden>
---
linux-user/syscall-defs.h | 1 +
linux-user/syscall-file.inc.c | 8 ++++++++
linux-user/syscall.c | 4 ----
linux-user/strace.list | 3 ---
4 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/linux-user/syscall-defs.h b/linux-user/syscall-defs.h
index d1a6c6fa3c..797426ae6f 100644
--- a/linux-user/syscall-defs.h
+++ b/linux-user/syscall-defs.h
@@ -16,6 +16,7 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
+SYSCALL_DEF(close, ARG_DEC);
#ifdef TARGET_NR_open
SYSCALL_DEF(open, ARG_STR, ARG_OPENFLAG, ARG_MODEFLAG);
#endif
diff --git a/linux-user/syscall-file.inc.c b/linux-user/syscall-file.inc.c
index 841795f8aa..feb83c4e87 100644
--- a/linux-user/syscall-file.inc.c
+++ b/linux-user/syscall-file.inc.c
@@ -16,6 +16,14 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
+SYSCALL_IMPL(close)
+{
+ int fd = arg1;
+
+ fd_trans_unregister(fd);
+ return get_errno(close(fd));
+}
+
/*
* Helpers for do_openat, manipulating /proc/self/foo.
*/
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 035f17c0d9..f230fe161e 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6771,10 +6771,6 @@ static abi_long do_syscall1(void *cpu_env, int num,
abi_long arg1,
fd_trans_unregister(ret);
return ret;
#endif
- case TARGET_NR_close:
- fd_trans_unregister(arg1);
- return get_errno(close(arg1));
-
case TARGET_NR_brk:
return do_brk(arg1);
#ifdef TARGET_NR_fork
diff --git a/linux-user/strace.list b/linux-user/strace.list
index 2f466e5699..71a18123bf 100644
--- a/linux-user/strace.list
+++ b/linux-user/strace.list
@@ -97,9 +97,6 @@
#ifdef TARGET_NR_clone
{ TARGET_NR_clone, "clone" , NULL, print_clone, NULL },
#endif
-#ifdef TARGET_NR_close
-{ TARGET_NR_close, "close" , "%s(%d)", NULL, NULL },
-#endif
#ifdef TARGET_NR_connect
{ TARGET_NR_connect, "connect" , "%s(%d,%#x,%d)", NULL, NULL },
#endif
--
2.17.2
- [Qemu-devel] [PATCH v6 00/49] linux-user: Split do_syscall, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 05/49] linux-user: Tidy do_openat loop over fakes, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 07/49] linux-user: Split out close,
Richard Henderson <=
- [Qemu-devel] [PATCH v6 04/49] linux-user: Share more code for open and openat, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 06/49] linux-user: Split out readlink, readlinkat, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 08/49] linux-user: Split out read, write, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 03/49] linux-user: Split out open, open_at, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 09/49] linux-user: Reduce regpairs_aligned & target_offset64 ifdefs, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 01/49] linux-user: Setup split syscall infrastructure, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 10/49] linux-user: Split out readv, writev, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 11/49] linux-user: Split out pread64, pwrite64, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 12/49] linux-user: Split out preadv, pwritev, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 13/49] linux-user: Split out name_to_handle_at, open_by_handle_at, Richard Henderson, 2019/01/18