* defs.h (RVAL_FD): New macro.
(RVAL_MASK, RVAL_STR, RVAL_NONE): Update.
* desc.c (sys_dup, sys_delete_module): New functions.
(do_dup2, decode_open, sys_creat): Change return value to RVAL_FD.
* linux/dummy.h (sys_delete_module, sys_dup): Remove.
* linux/syscall.h (sys_delete_module, sys_dup): New prototypes.
* syscall.c (trace_syscall_exiting): Handle RVAL_FD.
Signed-off-by: Zubin Mithra <zubin.mithra@gmail.com>
# endif
# define RVAL_LUDECIMAL 007 /* long unsigned decimal format */
#endif
-#define RVAL_MASK 007 /* mask for these values */
+#define RVAL_FD 010 /* file descriptor */
+#define RVAL_MASK 017 /* mask for these values */
-#define RVAL_STR 010 /* Print `auxstr' field after return val */
-#define RVAL_NONE 020 /* Print nothing */
+#define RVAL_STR 020 /* Print `auxstr' field after return val */
+#define RVAL_NONE 040 /* Print nothing */
#define TRACE_FILE 001 /* Trace file-related syscalls. */
#define TRACE_IPC 002 /* Trace IPC-related syscalls. */
return 0;
}
+int
+sys_dup(struct tcb *tcp)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ }
+ return RVAL_FD;
+}
+
static int
do_dup2(struct tcb *tcp, int flags_arg)
{
printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
}
}
- return 0;
+ return RVAL_FD;
}
int
tprintf(", %#lo", tcp->u_arg[offset + 2]);
}
}
- return 0;
+ return RVAL_FD;
}
int
return decode_open(tcp, 0);
}
+int sys_delete_module(struct tcb *tcp)
+{
+ decode_open(tcp, 0);
+ return RVAL_DECIMAL;
+}
+
int
sys_openat(struct tcb *tcp)
{
printpath(tcp, tcp->u_arg[0]);
tprintf(", %#lo", tcp->u_arg[1]);
}
- return 0;
+ return RVAL_FD;
}
#include "xlat/access_flags.h"
#define sys_acct sys_chdir
#define sys_chroot sys_chdir
#define sys_clock_getres sys_clock_gettime
-#define sys_delete_module sys_open
-#define sys_dup sys_close
#define sys_fchdir sys_close
#define sys_fdatasync sys_close
#define sys_fsync sys_close
int sys_connect();
int sys_creat();
int sys_create_module();
+int sys_delete_module();
+int sys_dup();
int sys_dup2();
int sys_dup3();
int sys_epoll_create();
case RVAL_DECIMAL:
tprintf("= %ld", tcp->u_rval);
break;
+ case RVAL_FD:
+ if (show_fd_path) {
+ tprints("= ");
+ printfd(tcp, tcp->u_rval);
+ }
+ else
+ tprintf("= %ld", tcp->u_rval);
+ break;
#if defined(LINUX_MIPSN32) || defined(X32)
/*
case RVAL_LHEX: