signal.c: move signalfd parsers to a separate file
* signalfd.c: New file. * Makefile.am (strace_SOURCES): Add it. * signal.c (do_signalfd, sys_signalfd, sys_signalfd4): Move to signalfd.c
This commit is contained in:
parent
57823c6836
commit
2307d5c968
@ -104,6 +104,7 @@ strace_SOURCES = \
|
||||
seccomp.c \
|
||||
sigaltstack.c \
|
||||
signal.c \
|
||||
signalfd.c \
|
||||
sigreturn.c \
|
||||
sock.c \
|
||||
socketutils.c \
|
||||
|
26
signal.c
26
signal.c
@ -685,29 +685,3 @@ SYS_FUNC(restart_syscall)
|
||||
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
|
||||
static int
|
||||
do_signalfd(struct tcb *tcp, int flags_arg)
|
||||
{
|
||||
/* NB: kernel requires arg[2] == NSIG / 8 */
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprints(", ");
|
||||
print_sigset_addr_len(tcp, tcp->u_arg[1], tcp->u_arg[2]);
|
||||
tprintf(", %lu", tcp->u_arg[2]);
|
||||
if (flags_arg >= 0) {
|
||||
tprints(", ");
|
||||
printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
|
||||
}
|
||||
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
|
||||
SYS_FUNC(signalfd)
|
||||
{
|
||||
return do_signalfd(tcp, -1);
|
||||
}
|
||||
|
||||
SYS_FUNC(signalfd4)
|
||||
{
|
||||
return do_signalfd(tcp, 3);
|
||||
}
|
||||
|
27
signalfd.c
Normal file
27
signalfd.c
Normal file
@ -0,0 +1,27 @@
|
||||
#include "defs.h"
|
||||
|
||||
static int
|
||||
do_signalfd(struct tcb *tcp, int flags_arg)
|
||||
{
|
||||
/* NB: kernel requires arg[2] == NSIG / 8 */
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprints(", ");
|
||||
print_sigset_addr_len(tcp, tcp->u_arg[1], tcp->u_arg[2]);
|
||||
tprintf(", %lu", tcp->u_arg[2]);
|
||||
if (flags_arg >= 0) {
|
||||
tprints(", ");
|
||||
printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
|
||||
}
|
||||
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
|
||||
SYS_FUNC(signalfd)
|
||||
{
|
||||
return do_signalfd(tcp, -1);
|
||||
}
|
||||
|
||||
SYS_FUNC(signalfd4)
|
||||
{
|
||||
return do_signalfd(tcp, 3);
|
||||
}
|
Loading…
Reference in New Issue
Block a user