desc.c: move eventfd parsers to a separate file
* eventfd.c: New file. * Makefile.am (strace_SOURCES): Add it. * desc.c (do_eventfd, sys_eventfd, sys_eventfd2): Move to eventfd.c.
This commit is contained in:
parent
73a4fa43f5
commit
28471d17f9
@ -43,6 +43,7 @@ strace_SOURCES = \
|
||||
desc.c \
|
||||
dirent.c \
|
||||
evdev.c \
|
||||
eventfd.c \
|
||||
execve.c \
|
||||
exit.c \
|
||||
fadvise.c \
|
||||
|
22
desc.c
22
desc.c
@ -579,25 +579,3 @@ SYS_FUNC(pselect6)
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int
|
||||
do_eventfd(struct tcb *tcp, int flags_arg)
|
||||
{
|
||||
tprintf("%lu", tcp->u_arg[0]);
|
||||
if (flags_arg >= 0) {
|
||||
tprints(", ");
|
||||
printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
|
||||
}
|
||||
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
|
||||
SYS_FUNC(eventfd)
|
||||
{
|
||||
return do_eventfd(tcp, -1);
|
||||
}
|
||||
|
||||
SYS_FUNC(eventfd2)
|
||||
{
|
||||
return do_eventfd(tcp, 1);
|
||||
}
|
||||
|
23
eventfd.c
Normal file
23
eventfd.c
Normal file
@ -0,0 +1,23 @@
|
||||
#include "defs.h"
|
||||
|
||||
static int
|
||||
do_eventfd(struct tcb *tcp, int flags_arg)
|
||||
{
|
||||
tprintf("%lu", tcp->u_arg[0]);
|
||||
if (flags_arg >= 0) {
|
||||
tprints(", ");
|
||||
printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
|
||||
}
|
||||
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
|
||||
SYS_FUNC(eventfd)
|
||||
{
|
||||
return do_eventfd(tcp, -1);
|
||||
}
|
||||
|
||||
SYS_FUNC(eventfd2)
|
||||
{
|
||||
return do_eventfd(tcp, 1);
|
||||
}
|
Loading…
Reference in New Issue
Block a user