@@ -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
@@ -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.
*/
@@ -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
@@ -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
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- 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(-) -- 2.17.2