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:
Дмитрий Левин 2015-08-01 20:36:53 +00:00
parent 73a4fa43f5
commit 28471d17f9
3 changed files with 24 additions and 22 deletions

View File

@ -43,6 +43,7 @@ strace_SOURCES = \
desc.c \
dirent.c \
evdev.c \
eventfd.c \
execve.c \
exit.c \
fadvise.c \

22
desc.c
View File

@ -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
View 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);
}