file.c: move sync_file_range and sync_file_range2 parsers to a separate file

* sync_file_range.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* file.c: Move sys_sync_file_range, sys_sync_file_range2, and related
code to sync_file_range.c.
This commit is contained in:
Дмитрий Левин 2014-12-06 03:53:16 +00:00
parent 2795a5f7ac
commit 710b3ae4a2
3 changed files with 34 additions and 30 deletions

View File

@ -58,6 +58,7 @@ strace_SOURCES = \
strace.c \
stream.c \
swapon.c \
sync_file_range.c \
syscall.c \
sysctl.c \
sysinfo.c \

30
file.c
View File

@ -1883,33 +1883,3 @@ sys_fadvise64_64(struct tcb *tcp)
}
return 0;
}
#include "xlat/sync_file_range_flags.h"
int
sys_sync_file_range(struct tcb *tcp)
{
if (entering(tcp)) {
int argn;
printfd(tcp, tcp->u_arg[0]);
argn = printllval(tcp, ", %lld, ", 1);
argn = printllval(tcp, "%lld, ", argn);
printflags(sync_file_range_flags, tcp->u_arg[argn],
"SYNC_FILE_RANGE_???");
}
return 0;
}
int
sys_sync_file_range2(struct tcb *tcp)
{
if (entering(tcp)) {
int argn;
printfd(tcp, tcp->u_arg[0]);
printflags(sync_file_range_flags, 1,
"SYNC_FILE_RANGE_???");
argn = printllval(tcp, ", %lld, ", 2);
argn = printllval(tcp, "%lld, ", argn);
}
return 0;
}

33
sync_file_range.c Normal file
View File

@ -0,0 +1,33 @@
#include "defs.h"
#include <fcntl.h>
#include "xlat/sync_file_range_flags.h"
int
sys_sync_file_range(struct tcb *tcp)
{
if (entering(tcp)) {
int argn;
printfd(tcp, tcp->u_arg[0]);
argn = printllval(tcp, ", %lld, ", 1);
argn = printllval(tcp, "%lld, ", argn);
printflags(sync_file_range_flags, tcp->u_arg[argn],
"SYNC_FILE_RANGE_???");
}
return 0;
}
int
sys_sync_file_range2(struct tcb *tcp)
{
if (entering(tcp)) {
int argn;
printfd(tcp, tcp->u_arg[0]);
printflags(sync_file_range_flags, 1,
"SYNC_FILE_RANGE_???");
argn = printllval(tcp, ", %lld, ", 2);
argn = printllval(tcp, "%lld, ", argn);
}
return 0;
}