Move sysent shorthand notations to separate files
Avoid proliferation of exactly the same definitions of shorthand notations for macros defined in sysent.h by moving definitions and undefs of these shorthand notations to separate files. * sysent_shorthand_defs.h: New file. * sysent_shorthand_undefs.h: Likewise. * Makefile.am (strace_SOURCES): Add them. * syscall.c: Use them. Signed-off-by: Edgar Kaziakhmedov <edgar.kaziakhmedov@virtuozzo.com> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
This commit is contained in:
parent
f9638667ee
commit
3d565ef25a
@ -273,6 +273,8 @@ strace_SOURCES = \
|
||||
syscall.c \
|
||||
sysctl.c \
|
||||
sysent.h \
|
||||
sysent_shorthand_defs.h \
|
||||
sysent_shorthand_undefs.h \
|
||||
sysinfo.c \
|
||||
syslog.c \
|
||||
sysmips.c \
|
||||
|
41
syscall.c
41
syscall.c
@ -70,25 +70,7 @@
|
||||
#include "syscall.h"
|
||||
|
||||
/* Define these shorthand notations to simplify the syscallent files. */
|
||||
#define TD TRACE_DESC
|
||||
#define TF TRACE_FILE
|
||||
#define TI TRACE_IPC
|
||||
#define TN TRACE_NETWORK
|
||||
#define TP TRACE_PROCESS
|
||||
#define TS TRACE_SIGNAL
|
||||
#define TM TRACE_MEMORY
|
||||
#define TST TRACE_STAT
|
||||
#define TLST TRACE_LSTAT
|
||||
#define TFST TRACE_FSTAT
|
||||
#define TSTA TRACE_STAT_LIKE
|
||||
#define TSF TRACE_STATFS
|
||||
#define TFSF TRACE_FSTATFS
|
||||
#define TSFA TRACE_STATFS_LIKE
|
||||
#define NF SYSCALL_NEVER_FAILS
|
||||
#define MA MAX_ARGS
|
||||
#define SI STACKTRACE_INVALIDATE_CACHE
|
||||
#define SE STACKTRACE_CAPTURE_ON_ENTER
|
||||
#define CST COMPAT_SYSCALL_TYPES
|
||||
#include "sysent_shorthand_defs.h"
|
||||
|
||||
#define SEN(syscall_name) SEN_ ## syscall_name, SYS_FUNC_NAME(sys_ ## syscall_name)
|
||||
|
||||
@ -111,26 +93,7 @@ static const struct_sysent sysent2[] = {
|
||||
#endif
|
||||
|
||||
/* Now undef them since short defines cause wicked namespace pollution. */
|
||||
#undef SEN
|
||||
#undef TD
|
||||
#undef TF
|
||||
#undef TI
|
||||
#undef TN
|
||||
#undef TP
|
||||
#undef TS
|
||||
#undef TM
|
||||
#undef TST
|
||||
#undef TLST
|
||||
#undef TFST
|
||||
#undef TSTA
|
||||
#undef TSF
|
||||
#undef TFSF
|
||||
#undef TSFA
|
||||
#undef NF
|
||||
#undef MA
|
||||
#undef SI
|
||||
#undef SE
|
||||
#undef CST
|
||||
#include "sysent_shorthand_undefs.h"
|
||||
|
||||
/*
|
||||
* `ioctlent[012].h' files are automatically generated by the auxiliary
|
||||
|
19
sysent_shorthand_defs.h
Normal file
19
sysent_shorthand_defs.h
Normal file
@ -0,0 +1,19 @@
|
||||
#define TD TRACE_DESC
|
||||
#define TF TRACE_FILE
|
||||
#define TI TRACE_IPC
|
||||
#define TN TRACE_NETWORK
|
||||
#define TP TRACE_PROCESS
|
||||
#define TS TRACE_SIGNAL
|
||||
#define TM TRACE_MEMORY
|
||||
#define TST TRACE_STAT
|
||||
#define TLST TRACE_LSTAT
|
||||
#define TFST TRACE_FSTAT
|
||||
#define TSTA TRACE_STAT_LIKE
|
||||
#define TSF TRACE_STATFS
|
||||
#define TFSF TRACE_FSTATFS
|
||||
#define TSFA TRACE_STATFS_LIKE
|
||||
#define NF SYSCALL_NEVER_FAILS
|
||||
#define MA MAX_ARGS
|
||||
#define SI STACKTRACE_INVALIDATE_CACHE
|
||||
#define SE STACKTRACE_CAPTURE_ON_ENTER
|
||||
#define CST COMPAT_SYSCALL_TYPES
|
20
sysent_shorthand_undefs.h
Normal file
20
sysent_shorthand_undefs.h
Normal file
@ -0,0 +1,20 @@
|
||||
#undef SEN
|
||||
#undef TD
|
||||
#undef TF
|
||||
#undef TI
|
||||
#undef TN
|
||||
#undef TP
|
||||
#undef TS
|
||||
#undef TM
|
||||
#undef TST
|
||||
#undef TLST
|
||||
#undef TFST
|
||||
#undef TSTA
|
||||
#undef TSF
|
||||
#undef TFSF
|
||||
#undef TSFA
|
||||
#undef NF
|
||||
#undef MA
|
||||
#undef SI
|
||||
#undef SE
|
||||
#undef CST
|
Loading…
x
Reference in New Issue
Block a user