From a0bd3749fc6fdf6364c1e269a4c02e8c153eb84b Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Tue, 7 Apr 2015 01:36:50 +0000 Subject: [PATCH] Declare syscall parsers using SYS_FUNC macro Introduce SYS_FUNC macro to declare and define all syscall parsers. * Makefile.am (BUILT_SOURCES, CLEANFILES): Add sys_func.h. (sys_func.h): New rule. * defs.h (SYS_FUNC_NAME, SYS_FUNC): New macros. * linux/syscall.h: Include "sys_func.h". [NEED_UID16_PARSERS]: Use SYS_FUNC to declare uid16 syscall parsers. Remove other declarations. * linux/alpha/syscallent.h (160, 161): Add sys_ prefix to osf_statfs and osf_fstatfs syscall parsers. * *.c: Use SYS_FUNC to define syscall parsers. --- Makefile.am | 11 +- access.c | 6 +- affinity.c | 6 +- aio.c | 15 +- bjm.c | 15 +- cacheflush.c | 9 +- capability.c | 6 +- chdir.c | 3 +- chmod.c | 9 +- clone.c | 12 +- defs.h | 6 + desc.c | 57 +++---- dirent.c | 9 +- execve.c | 6 +- exit.c | 3 +- fadvise.c | 6 +- fallocate.c | 3 +- fanotify.c | 6 +- fchownat.c | 3 +- file.c | 33 ++-- futex.c | 3 +- get_robust_list.c | 3 +- getcpu.c | 3 +- getcwd.c | 3 +- getrandom.c | 3 +- hostname.c | 6 +- inotify.c | 9 +- io.c | 42 ++--- ioprio.c | 6 +- ipc.c | 42 ++--- kexec.c | 3 +- keyctl.c | 9 +- ldt.c | 15 +- link.c | 12 +- linux/alpha/syscallent.h | 4 +- linux/syscall.h | 346 ++------------------------------------- lseek.c | 9 +- mem.c | 63 +++---- mknod.c | 9 +- mount.c | 3 +- net.c | 63 +++---- open.c | 9 +- or1k_atomic.c | 2 +- personality.c | 3 +- prctl.c | 6 +- process.c | 3 +- process_vm.c | 6 +- quota.c | 3 +- readahead.c | 3 +- readlink.c | 6 +- reboot.c | 3 +- renameat.c | 6 +- resource.c | 24 +-- sched.c | 18 +- seccomp.c | 3 +- sigaltstack.c | 3 +- signal.c | 56 +++---- sigreturn.c | 3 +- sock.c | 3 +- sram_alloc.c | 3 +- statfs.c | 18 +- stream.c | 21 +-- swapon.c | 3 +- sync_file_range.c | 6 +- sysctl.c | 3 +- sysinfo.c | 3 +- syslog.c | 3 +- sysmips.c | 2 +- time.c | 69 +++----- truncate.c | 12 +- uid.c | 30 ++-- umask.c | 3 +- umount.c | 3 +- uname.c | 3 +- utime.c | 3 +- utimes.c | 12 +- wait.c | 12 +- xattr.c | 24 +-- 78 files changed, 335 insertions(+), 938 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8193c9e1..549aebc4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -555,11 +555,18 @@ EXTRA_DIST = \ srpm: dist-xz rpmbuild --define '%_srcrpmdir .' -ts $(distdir).tar.xz -BUILT_SOURCES = .version +BUILT_SOURCES = .version sys_func.h $(srcdir)/.version: $(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@ +strace_SOURCES_c = $(filter %.c,$(strace_SOURCES)) + +sys_func.h: $(patsubst %,$(srcdir)/%,$(strace_SOURCES_c)) + for f in $^; do \ + sed -n 's/^SYS_FUNC(.*/extern &;/p' $$f; \ + done | sort -u > $@ + dist-hook: $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version @@ -586,7 +593,7 @@ ioctlsort_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_FOR_BUILD) ioctls_inc_h = $(wildcard $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h) ioctlent_h = $(patsubst $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%,ioctlent%,$(ioctls_inc_h)) BUILT_SOURCES += $(ioctlent_h) -CLEANFILES = $(ioctlent_h) +CLEANFILES = sys_func.h $(ioctlent_h) ioctlent%.h: ioctlsort% ./$< > $@ diff --git a/access.c b/access.c index f28f69d7..dd0d749d 100644 --- a/access.c +++ b/access.c @@ -15,14 +15,12 @@ decode_access(struct tcb *tcp, int offset) return 0; } -int -sys_access(struct tcb *tcp) +SYS_FUNC(access) { return decode_access(tcp, 0); } -int -sys_faccessat(struct tcb *tcp) +SYS_FUNC(faccessat) { if (entering(tcp)) print_dirfd(tcp, tcp->u_arg[0]); diff --git a/affinity.c b/affinity.c index 97d8b3e2..286e15c7 100644 --- a/affinity.c +++ b/affinity.c @@ -32,8 +32,7 @@ print_affinitylist(struct tcb *tcp, long list, unsigned int len) } } -int -sys_sched_setaffinity(struct tcb *tcp) +SYS_FUNC(sched_setaffinity) { if (entering(tcp)) { tprintf("%ld, %lu, ", tcp->u_arg[0], tcp->u_arg[1]); @@ -42,8 +41,7 @@ sys_sched_setaffinity(struct tcb *tcp) return 0; } -int -sys_sched_getaffinity(struct tcb *tcp) +SYS_FUNC(sched_getaffinity) { if (entering(tcp)) { tprintf("%ld, %lu, ", tcp->u_arg[0], tcp->u_arg[1]); diff --git a/aio.c b/aio.c index 18e53013..7d8fb650 100644 --- a/aio.c +++ b/aio.c @@ -38,8 +38,7 @@ # define IOCB_RESFD (1 << 0) #endif -int -sys_io_setup(struct tcb *tcp) +SYS_FUNC(io_setup) { if (entering(tcp)) tprintf("%ld, ", tcp->u_arg[0]); @@ -57,8 +56,7 @@ sys_io_setup(struct tcb *tcp) return 0; } -int -sys_io_destroy(struct tcb *tcp) +SYS_FUNC(io_destroy) { if (entering(tcp)) tprintf("%lu", tcp->u_arg[0]); @@ -112,8 +110,7 @@ print_common_flags(struct iocb *iocb) #endif /* HAVE_LIBAIO_H */ -int -sys_io_submit(struct tcb *tcp) +SYS_FUNC(io_submit) { if (entering(tcp)) { #ifdef HAVE_LIBAIO_H @@ -197,8 +194,7 @@ sys_io_submit(struct tcb *tcp) return 0; } -int -sys_io_cancel(struct tcb *tcp) +SYS_FUNC(io_cancel) { if (entering(tcp)) { #ifdef HAVE_LIBAIO_H @@ -232,8 +228,7 @@ sys_io_cancel(struct tcb *tcp) return 0; } -int -sys_io_getevents(struct tcb *tcp) +SYS_FUNC(io_getevents) { if (entering(tcp)) { tprintf("%ld, %ld, %ld, ", tcp->u_arg[0], tcp->u_arg[1], diff --git a/bjm.c b/bjm.c index c8d72a30..435d6bbf 100644 --- a/bjm.c +++ b/bjm.c @@ -72,8 +72,7 @@ struct module_info #include "xlat/modflags.h" #include "xlat/delete_module_flags.h" -int -sys_query_module(struct tcb *tcp) +SYS_FUNC(query_module) { if (entering(tcp)) { printstr(tcp, tcp->u_arg[0], -1); @@ -163,8 +162,7 @@ sys_query_module(struct tcb *tcp) return 0; } -int -sys_create_module(struct tcb *tcp) +SYS_FUNC(create_module) { if (entering(tcp)) { printpath(tcp, tcp->u_arg[0]); @@ -173,8 +171,7 @@ sys_create_module(struct tcb *tcp) return RVAL_HEX; } -int -sys_delete_module(struct tcb *tcp) +SYS_FUNC(delete_module) { if (entering(tcp)) { printstr(tcp, tcp->u_arg[0], -1); @@ -184,8 +181,7 @@ sys_delete_module(struct tcb *tcp) return 0; } -int -sys_init_module(struct tcb *tcp) +SYS_FUNC(init_module) { if (entering(tcp)) { tprintf("%#lx, %lu, ", tcp->u_arg[0], tcp->u_arg[1]); @@ -199,8 +195,7 @@ sys_init_module(struct tcb *tcp) #include "xlat/module_init_flags.h" -int -sys_finit_module(struct tcb *tcp) +SYS_FUNC(finit_module) { if (exiting(tcp)) return 0; diff --git a/cacheflush.c b/cacheflush.c index bfbf5838..727d49bc 100644 --- a/cacheflush.c +++ b/cacheflush.c @@ -20,8 +20,7 @@ static const struct xlat cacheflush_flags[] = { XLAT_END }; -int -sys_cacheflush(struct tcb *tcp) +SYS_FUNC(cacheflush) { if (entering(tcp)) { /* addr */ @@ -46,8 +45,7 @@ static const struct xlat cacheflush_flags[] = { XLAT_END }; -int -sys_cacheflush(struct tcb *tcp) +SYS_FUNC(cacheflush) { if (entering(tcp)) { /* start addr */ @@ -78,8 +76,7 @@ static const struct xlat cacheflush_flags[] = { XLAT_END }; -int -sys_cacheflush(struct tcb *tcp) +SYS_FUNC(cacheflush) { if (entering(tcp)) { /* addr */ diff --git a/capability.c b/capability.c index 26d9c66a..d18d7264 100644 --- a/capability.c +++ b/capability.c @@ -117,8 +117,7 @@ print_cap_data(struct tcb *tcp, unsigned long addr, const cap_user_header_t h) tprints("}"); } -int -sys_capget(struct tcb *tcp) +SYS_FUNC(capget) { cap_user_header_t h; @@ -133,8 +132,7 @@ sys_capget(struct tcb *tcp) return 0; } -int -sys_capset(struct tcb *tcp) +SYS_FUNC(capset) { if (entering(tcp)) { cap_user_header_t h = get_cap_header(tcp, tcp->u_arg[0]); diff --git a/chdir.c b/chdir.c index 29f0afc3..a91d366c 100644 --- a/chdir.c +++ b/chdir.c @@ -1,7 +1,6 @@ #include "defs.h" -int -sys_chdir(struct tcb *tcp) +SYS_FUNC(chdir) { if (entering(tcp)) { printpath(tcp, tcp->u_arg[0]); diff --git a/chmod.c b/chmod.c index 89453a98..21ce1154 100644 --- a/chmod.c +++ b/chmod.c @@ -10,22 +10,19 @@ decode_chmod(struct tcb *tcp, int offset) return 0; } -int -sys_chmod(struct tcb *tcp) +SYS_FUNC(chmod) { return decode_chmod(tcp, 0); } -int -sys_fchmodat(struct tcb *tcp) +SYS_FUNC(fchmodat) { if (entering(tcp)) print_dirfd(tcp, tcp->u_arg[0]); return decode_chmod(tcp, 1); } -int -sys_fchmod(struct tcb *tcp) +SYS_FUNC(fchmod) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); diff --git a/clone.c b/clone.c index a0a70964..6c2d196b 100644 --- a/clone.c +++ b/clone.c @@ -68,8 +68,7 @@ extern void print_user_desc(struct tcb *, long); #endif /* I386 || X86_64 || X32 */ -int -sys_clone(struct tcb *tcp) +SYS_FUNC(clone) { if (exiting(tcp)) { const char *sep = "|"; @@ -123,8 +122,7 @@ sys_clone(struct tcb *tcp) return 0; } -int -sys_setns(struct tcb *tcp) +SYS_FUNC(setns) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -134,16 +132,14 @@ sys_setns(struct tcb *tcp) return 0; } -int -sys_unshare(struct tcb *tcp) +SYS_FUNC(unshare) { if (entering(tcp)) printflags(clone_flags, tcp->u_arg[0], "CLONE_???"); return 0; } -int -sys_fork(struct tcb *tcp) +SYS_FUNC(fork) { if (exiting(tcp)) return RVAL_UDECIMAL; diff --git a/defs.h b/defs.h index 34f1603b..77c819c6 100644 --- a/defs.h +++ b/defs.h @@ -673,3 +673,9 @@ extern unsigned num_quals; /* Only ensures that sysent[scno] isn't out of range */ #define SCNO_IN_RANGE(scno) \ ((unsigned long)(scno) < nsyscalls) + +#ifndef SYS_FUNC_NAME +# define SYS_FUNC_NAME(syscall_name) sys_ ## syscall_name +#endif + +#define SYS_FUNC(syscall_name) int SYS_FUNC_NAME(syscall_name)(struct tcb *tcp) diff --git a/desc.c b/desc.c index 485c802b..1b9dd1a5 100644 --- a/desc.c +++ b/desc.c @@ -145,8 +145,7 @@ printflock(struct tcb *tcp, long addr, int getlk) tprints("}"); } -int -sys_fcntl(struct tcb *tcp) +SYS_FUNC(fcntl) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -244,8 +243,7 @@ sys_fcntl(struct tcb *tcp) #ifdef LOCK_SH -int -sys_flock(struct tcb *tcp) +SYS_FUNC(flock) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -256,8 +254,7 @@ sys_flock(struct tcb *tcp) } #endif /* LOCK_SH */ -int -sys_close(struct tcb *tcp) +SYS_FUNC(close) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -265,8 +262,7 @@ sys_close(struct tcb *tcp) return 0; } -int -sys_dup(struct tcb *tcp) +SYS_FUNC(dup) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -289,21 +285,18 @@ do_dup2(struct tcb *tcp, int flags_arg) return RVAL_FD; } -int -sys_dup2(struct tcb *tcp) +SYS_FUNC(dup2) { return do_dup2(tcp, -1); } -int -sys_dup3(struct tcb *tcp) +SYS_FUNC(dup3) { return do_dup2(tcp, 2); } #if defined(ALPHA) -int -sys_getdtablesize(struct tcb *tcp) +SYS_FUNC(getdtablesize) { return 0; } @@ -440,8 +433,7 @@ decode_select(struct tcb *tcp, long *args, enum bitness_t bitness) return 0; } -int -sys_oldselect(struct tcb *tcp) +SYS_FUNC(oldselect) { long args[5]; @@ -453,8 +445,7 @@ sys_oldselect(struct tcb *tcp) } #ifdef ALPHA -int -sys_osf_select(struct tcb *tcp) +SYS_FUNC(osf_select) { long *args = tcp->u_arg; return decode_select(tcp, args, BITNESS_32); @@ -466,14 +457,12 @@ sys_osf_select(struct tcb *tcp) #include "xlat/epollflags.h" /* Not aliased to printargs_ld: we want it to have a distinct address */ -int -sys_epoll_create(struct tcb *tcp) +SYS_FUNC(epoll_create) { return printargs_ld(tcp); } -int -sys_epoll_create1(struct tcb *tcp) +SYS_FUNC(epoll_create1) { if (entering(tcp)) printflags(epollflags, tcp->u_arg[0], "EPOLL_???"); @@ -493,8 +482,7 @@ print_epoll_event(struct epoll_event *ev) } #endif -int -sys_epoll_ctl(struct tcb *tcp) +SYS_FUNC(epoll_ctl) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -563,15 +551,13 @@ epoll_wait_common(struct tcb *tcp) } } -int -sys_epoll_wait(struct tcb *tcp) +SYS_FUNC(epoll_wait) { epoll_wait_common(tcp); return 0; } -int -sys_epoll_pwait(struct tcb *tcp) +SYS_FUNC(epoll_pwait) { epoll_wait_common(tcp); if (exiting(tcp)) { @@ -583,14 +569,12 @@ sys_epoll_pwait(struct tcb *tcp) return 0; } -int -sys_select(struct tcb *tcp) +SYS_FUNC(select) { return decode_select(tcp, tcp->u_arg, BITNESS_CURRENT); } -int -sys_pselect6(struct tcb *tcp) +SYS_FUNC(pselect6) { int rc = decode_select(tcp, tcp->u_arg, BITNESS_CURRENT); if (entering(tcp)) { @@ -636,20 +620,17 @@ do_eventfd(struct tcb *tcp, int flags_arg) return 0; } -int -sys_eventfd(struct tcb *tcp) +SYS_FUNC(eventfd) { return do_eventfd(tcp, -1); } -int -sys_eventfd2(struct tcb *tcp) +SYS_FUNC(eventfd2) { return do_eventfd(tcp, 1); } -int -sys_perf_event_open(struct tcb *tcp) +SYS_FUNC(perf_event_open) { if (entering(tcp)) { tprintf("%#lx, %d, %d, %d, ", diff --git a/dirent.c b/dirent.c index d30e0d2a..32f04b9e 100644 --- a/dirent.c +++ b/dirent.c @@ -38,8 +38,7 @@ print_old_dirent(struct tcb *tcp, long addr) tprints("}"); } -int -sys_readdir(struct tcb *tcp) +SYS_FUNC(readdir) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -58,8 +57,7 @@ sys_readdir(struct tcb *tcp) #include "xlat/direnttypes.h" -int -sys_getdents(struct tcb *tcp) +SYS_FUNC(getdents) { unsigned int i, len, dents = 0; char *buf; @@ -139,8 +137,7 @@ sys_getdents(struct tcb *tcp) return 0; } -int -sys_getdents64(struct tcb *tcp) +SYS_FUNC(getdents64) { /* the minimum size of a valid dirent64 structure */ const unsigned int d_name_offset = offsetof(struct dirent64, d_name); diff --git a/execve.c b/execve.c index 31e80a69..4f2639d2 100644 --- a/execve.c +++ b/execve.c @@ -42,8 +42,7 @@ printargc(const char *fmt, struct tcb *tcp, long addr) tprintf(fmt, count, count == 1 ? "" : "s"); } -int -sys_execve(struct tcb *tcp) +SYS_FUNC(execve) { if (entering(tcp)) { printpath(tcp, tcp->u_arg[0]); @@ -68,8 +67,7 @@ sys_execve(struct tcb *tcp) } #if defined(SPARC) || defined(SPARC64) -int -sys_execv(struct tcb *tcp) +SYS_FUNC(execv) { if (entering(tcp)) { printpath(tcp, tcp->u_arg[0]); diff --git a/exit.c b/exit.c index 0e0c2ea2..d23e5280 100644 --- a/exit.c +++ b/exit.c @@ -1,7 +1,6 @@ #include "defs.h" -int -sys_exit(struct tcb *tcp) +SYS_FUNC(exit) { if (exiting(tcp)) { fprintf(stderr, "_exit returned!\n"); diff --git a/fadvise.c b/fadvise.c index 850a4250..088f8575 100644 --- a/fadvise.c +++ b/fadvise.c @@ -4,8 +4,7 @@ #include "xlat/advise.h" -int -sys_fadvise64(struct tcb *tcp) +SYS_FUNC(fadvise64) { if (entering(tcp)) { int argn; @@ -17,8 +16,7 @@ sys_fadvise64(struct tcb *tcp) return 0; } -int -sys_fadvise64_64(struct tcb *tcp) +SYS_FUNC(fadvise64_64) { if (entering(tcp)) { int argn; diff --git a/fallocate.c b/fallocate.c index 990106d2..c096c982 100644 --- a/fallocate.c +++ b/fallocate.c @@ -6,8 +6,7 @@ #include "xlat/falloc_flags.h" -int -sys_fallocate(struct tcb *tcp) +SYS_FUNC(fallocate) { if (entering(tcp)) { int argn; diff --git a/fanotify.c b/fanotify.c index 63816b8d..8ceca0e4 100644 --- a/fanotify.c +++ b/fanotify.c @@ -10,8 +10,7 @@ # define FAN_NOFD -1 #endif -int -sys_fanotify_init(struct tcb *tcp) +SYS_FUNC(fanotify_init) { unsigned flags; @@ -34,8 +33,7 @@ sys_fanotify_init(struct tcb *tcp) #include "xlat/fan_mark_flags.h" #include "xlat/fan_event_flags.h" -int -sys_fanotify_mark(struct tcb *tcp) +SYS_FUNC(fanotify_mark) { unsigned long long mask = 0; int argn; diff --git a/fchownat.c b/fchownat.c index 95de6e4a..743b5747 100644 --- a/fchownat.c +++ b/fchownat.c @@ -1,7 +1,6 @@ #include "defs.h" -int -sys_fchownat(struct tcb *tcp) +SYS_FUNC(fchownat) { if (entering(tcp)) { print_dirfd(tcp, tcp->u_arg[0]); diff --git a/file.c b/file.c index 9dc75950..8e1952fc 100644 --- a/file.c +++ b/file.c @@ -275,8 +275,7 @@ printstat(struct tcb *tcp, long addr) do_printstat(tcp, &statbuf); } -int -sys_stat(struct tcb *tcp) +SYS_FUNC(stat) { if (entering(tcp)) { printpath(tcp, tcp->u_arg[0]); @@ -287,8 +286,7 @@ sys_stat(struct tcb *tcp) return 0; } -int -sys_fstat(struct tcb *tcp) +SYS_FUNC(fstat) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -385,8 +383,7 @@ printstat64(struct tcb *tcp, long addr) do_printstat64(tcp, &statbuf); } -int -sys_stat64(struct tcb *tcp) +SYS_FUNC(stat64) { if (entering(tcp)) { printpath(tcp, tcp->u_arg[0]); @@ -397,8 +394,7 @@ sys_stat64(struct tcb *tcp) return 0; } -int -sys_fstat64(struct tcb *tcp) +SYS_FUNC(fstat64) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -411,22 +407,19 @@ sys_fstat64(struct tcb *tcp) #else -int -sys_stat64(struct tcb *tcp) +SYS_FUNC(stat64) { return sys_stat(tcp); } -int -sys_fstat64(struct tcb *tcp) +SYS_FUNC(fstat64) { return sys_fstat(tcp); } #endif /* HAVE_STRUCT_STAT64 */ -int -sys_newfstatat(struct tcb *tcp) +SYS_FUNC(newfstatat) { if (entering(tcp)) { print_dirfd(tcp, tcp->u_arg[0]); @@ -499,8 +492,7 @@ printoldstat(struct tcb *tcp, long addr) do_printstat(tcp, &newstatbuf); } -int -sys_oldstat(struct tcb *tcp) +SYS_FUNC(oldstat) { if (entering(tcp)) { printpath(tcp, tcp->u_arg[0]); @@ -511,8 +503,7 @@ sys_oldstat(struct tcb *tcp) return 0; } -int -sys_oldfstat(struct tcb *tcp) +SYS_FUNC(oldfstat) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -527,8 +518,7 @@ sys_oldfstat(struct tcb *tcp) #if defined(SPARC) || defined(SPARC64) -int -sys_xstat(struct tcb *tcp) +SYS_FUNC(xstat) { if (entering(tcp)) { tprintf("%ld, ", tcp->u_arg[0]); @@ -540,8 +530,7 @@ sys_xstat(struct tcb *tcp) return 0; } -int -sys_fxstat(struct tcb *tcp) +SYS_FUNC(fxstat) { if (entering(tcp)) { tprintf("%ld, ", tcp->u_arg[0]); diff --git a/futex.c b/futex.c index a1781c0e..f59587cd 100644 --- a/futex.c +++ b/futex.c @@ -98,8 +98,7 @@ #include "xlat/futexwakeops.h" #include "xlat/futexwakecmps.h" -int -sys_futex(struct tcb *tcp) +SYS_FUNC(futex) { if (entering(tcp)) { long int cmd = tcp->u_arg[1] & 127; diff --git a/get_robust_list.c b/get_robust_list.c index 1b667cab..d9e0f1aa 100644 --- a/get_robust_list.c +++ b/get_robust_list.c @@ -1,7 +1,6 @@ #include "defs.h" -int -sys_get_robust_list(struct tcb *tcp) +SYS_FUNC(get_robust_list) { if (entering(tcp)) { tprintf("%ld, ", (long) (pid_t) tcp->u_arg[0]); diff --git a/getcpu.c b/getcpu.c index 522786fd..47af7950 100644 --- a/getcpu.c +++ b/getcpu.c @@ -1,7 +1,6 @@ #include "defs.h" -int -sys_getcpu(struct tcb *tcp) +SYS_FUNC(getcpu) { if (exiting(tcp)) { unsigned u; diff --git a/getcwd.c b/getcwd.c index 1b974485..66af8345 100644 --- a/getcwd.c +++ b/getcwd.c @@ -1,7 +1,6 @@ #include "defs.h" -int -sys_getcwd(struct tcb *tcp) +SYS_FUNC(getcwd) { if (exiting(tcp)) { if (syserror(tcp)) diff --git a/getrandom.c b/getrandom.c index 068b2e6e..b67916d9 100644 --- a/getrandom.c +++ b/getrandom.c @@ -1,8 +1,7 @@ #include "defs.h" #include "xlat/getrandom_flags.h" -int -sys_getrandom(struct tcb *tcp) +SYS_FUNC(getrandom) { if (exiting(tcp)) { if (syserror(tcp)) diff --git a/hostname.c b/hostname.c index d2e0471b..c497dc5a 100644 --- a/hostname.c +++ b/hostname.c @@ -1,7 +1,6 @@ #include "defs.h" -int -sys_sethostname(struct tcb *tcp) +SYS_FUNC(sethostname) { if (entering(tcp)) { printstr(tcp, tcp->u_arg[0], tcp->u_arg[1]); @@ -11,8 +10,7 @@ sys_sethostname(struct tcb *tcp) } #if defined(ALPHA) -int -sys_gethostname(struct tcb *tcp) +SYS_FUNC(gethostname) { if (exiting(tcp)) { if (syserror(tcp)) diff --git a/inotify.c b/inotify.c index 81c8c5d8..34902b8a 100644 --- a/inotify.c +++ b/inotify.c @@ -4,8 +4,7 @@ #include "xlat/inotify_flags.h" #include "xlat/inotify_init_flags.h" -int -sys_inotify_add_watch(struct tcb *tcp) +SYS_FUNC(inotify_add_watch) { if (entering(tcp)) { /* file descriptor */ @@ -20,8 +19,7 @@ sys_inotify_add_watch(struct tcb *tcp) return 0; } -int -sys_inotify_rm_watch(struct tcb *tcp) +SYS_FUNC(inotify_rm_watch) { if (entering(tcp)) { /* file descriptor */ @@ -32,8 +30,7 @@ sys_inotify_rm_watch(struct tcb *tcp) return 0; } -int -sys_inotify_init1(struct tcb *tcp) +SYS_FUNC(inotify_init1) { if (entering(tcp)) printflags(inotify_init_flags, tcp->u_arg[0], "IN_???"); diff --git a/io.c b/io.c index 06185096..30ed5781 100644 --- a/io.c +++ b/io.c @@ -32,8 +32,7 @@ #include #include -int -sys_read(struct tcb *tcp) +SYS_FUNC(read) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -48,8 +47,7 @@ sys_read(struct tcb *tcp) return 0; } -int -sys_write(struct tcb *tcp) +SYS_FUNC(write) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -142,8 +140,7 @@ tprint_iov(struct tcb *tcp, unsigned long len, unsigned long addr, int decode_io tprint_iov_upto(tcp, len, addr, decode_iov, (unsigned long) -1L); } -int -sys_readv(struct tcb *tcp) +SYS_FUNC(readv) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -160,8 +157,7 @@ sys_readv(struct tcb *tcp) return 0; } -int -sys_writev(struct tcb *tcp) +SYS_FUNC(writev) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -183,8 +179,7 @@ sys_writev(struct tcb *tcp) #define PREAD_OFFSET_ARG 3 #endif -int -sys_pread(struct tcb *tcp) +SYS_FUNC(pread) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -200,8 +195,7 @@ sys_pread(struct tcb *tcp) return 0; } -int -sys_pwrite(struct tcb *tcp) +SYS_FUNC(pwrite) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -239,8 +233,7 @@ print_llu_from_low_high_val(struct tcb *tcp, int arg) #endif } -int -sys_preadv(struct tcb *tcp) +SYS_FUNC(preadv) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -257,8 +250,7 @@ sys_preadv(struct tcb *tcp) return 0; } -int -sys_pwritev(struct tcb *tcp) +SYS_FUNC(pwritev) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -296,8 +288,7 @@ print_off_t(struct tcb *tcp, long addr) tprintf("[%lu]", offset); } -int -sys_sendfile(struct tcb *tcp) +SYS_FUNC(sendfile) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -323,8 +314,7 @@ print_loff_t(struct tcb *tcp, long addr) tprintf("[%llu]", (unsigned long long int) offset); } -int -sys_sendfile64(struct tcb *tcp) +SYS_FUNC(sendfile64) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -339,8 +329,7 @@ sys_sendfile64(struct tcb *tcp) #include "xlat/splice_flags.h" -int -sys_tee(struct tcb *tcp) +SYS_FUNC(tee) { if (entering(tcp)) { /* int fd_in */ @@ -357,8 +346,7 @@ sys_tee(struct tcb *tcp) return 0; } -int -sys_splice(struct tcb *tcp) +SYS_FUNC(splice) { if (entering(tcp)) { /* int fd_in */ @@ -381,8 +369,7 @@ sys_splice(struct tcb *tcp) return 0; } -int -sys_vmsplice(struct tcb *tcp) +SYS_FUNC(vmsplice) { if (entering(tcp)) { /* int fd */ @@ -397,8 +384,7 @@ sys_vmsplice(struct tcb *tcp) return 0; } -int -sys_ioctl(struct tcb *tcp) +SYS_FUNC(ioctl) { const struct_ioctlent *iop; diff --git a/ioprio.c b/ioprio.c index 6826e56d..20866dcc 100644 --- a/ioprio.c +++ b/ioprio.c @@ -42,8 +42,7 @@ sprint_ioprio(int ioprio) return outstr; } -int -sys_ioprio_get(struct tcb *tcp) +SYS_FUNC(ioprio_get) { if (entering(tcp)) { /* int which */ @@ -60,8 +59,7 @@ sys_ioprio_get(struct tcb *tcp) } } -int -sys_ioprio_set(struct tcb *tcp) +SYS_FUNC(ioprio_set) { if (entering(tcp)) { /* int which */ diff --git a/ipc.c b/ipc.c index a94f572c..f2c064b2 100644 --- a/ipc.c +++ b/ipc.c @@ -72,7 +72,7 @@ extern void printsigevent(struct tcb *tcp, long arg); #include "xlat/ipc_msg_flags.h" #include "xlat/semop_flags.h" -int sys_msgget(struct tcb *tcp) +SYS_FUNC(msgget) { if (entering(tcp)) { if (tcp->u_arg[0]) @@ -100,7 +100,7 @@ indirect_ipccall(struct tcb *tcp) return tcp->s_ent->sys_flags & TRACE_INDIRECT_SUBCALL; } -int sys_msgctl(struct tcb *tcp) +SYS_FUNC(msgctl) { if (entering(tcp)) { tprintf("%lu, ", tcp->u_arg[0]); @@ -127,7 +127,7 @@ tprint_msgsnd(struct tcb *tcp, long addr, unsigned long count, printflags(ipc_msg_flags, flags, "MSG_???"); } -int sys_msgsnd(struct tcb *tcp) +SYS_FUNC(msgsnd) { if (entering(tcp)) { tprintf("%d, ", (int) tcp->u_arg[0]); @@ -157,7 +157,7 @@ tprint_msgrcv(struct tcb *tcp, long addr, unsigned long count, long msgtyp) tprintf(", %lu, %ld, ", count, msgtyp); } -int sys_msgrcv(struct tcb *tcp) +SYS_FUNC(msgrcv) { if (entering(tcp)) { tprintf("%d, ", (int) tcp->u_arg[0]); @@ -227,7 +227,7 @@ tprint_sembuf(struct tcb *tcp, long addr, unsigned long count) tprintf("}, %lu", count); } -int sys_semop(struct tcb *tcp) +SYS_FUNC(semop) { if (entering(tcp)) { tprintf("%lu, ", tcp->u_arg[0]); @@ -240,7 +240,7 @@ int sys_semop(struct tcb *tcp) return 0; } -int sys_semtimedop(struct tcb *tcp) +SYS_FUNC(semtimedop) { if (entering(tcp)) { tprintf("%lu, ", tcp->u_arg[0]); @@ -261,7 +261,7 @@ int sys_semtimedop(struct tcb *tcp) return 0; } -int sys_semget(struct tcb *tcp) +SYS_FUNC(semget) { if (entering(tcp)) { if (tcp->u_arg[0]) @@ -276,7 +276,7 @@ int sys_semget(struct tcb *tcp) return 0; } -int sys_semctl(struct tcb *tcp) +SYS_FUNC(semctl) { if (entering(tcp)) { tprintf("%lu, %lu, ", tcp->u_arg[0], tcp->u_arg[1]); @@ -295,7 +295,7 @@ int sys_semctl(struct tcb *tcp) return 0; } -int sys_shmget(struct tcb *tcp) +SYS_FUNC(shmget) { if (entering(tcp)) { if (tcp->u_arg[0]) @@ -310,7 +310,7 @@ int sys_shmget(struct tcb *tcp) return 0; } -int sys_shmctl(struct tcb *tcp) +SYS_FUNC(shmctl) { if (entering(tcp)) { tprintf("%lu, ", tcp->u_arg[0]); @@ -324,7 +324,7 @@ int sys_shmctl(struct tcb *tcp) return 0; } -int sys_shmat(struct tcb *tcp) +SYS_FUNC(shmat) { if (exiting(tcp)) { tprintf("%lu", tcp->u_arg[0]); @@ -348,7 +348,7 @@ int sys_shmat(struct tcb *tcp) return 0; } -int sys_shmdt(struct tcb *tcp) +SYS_FUNC(shmdt) { if (entering(tcp)) { if (indirect_ipccall(tcp)) { @@ -360,8 +360,7 @@ int sys_shmdt(struct tcb *tcp) return 0; } -int -sys_mq_open(struct tcb *tcp) +SYS_FUNC(mq_open) { if (entering(tcp)) { printpath(tcp, tcp->u_arg[0]); @@ -387,8 +386,7 @@ sys_mq_open(struct tcb *tcp) return 0; } -int -sys_mq_timedsend(struct tcb *tcp) +SYS_FUNC(mq_timedsend) { if (entering(tcp)) { tprintf("%ld, ", tcp->u_arg[0]); @@ -399,8 +397,7 @@ sys_mq_timedsend(struct tcb *tcp) return 0; } -int -sys_mq_timedreceive(struct tcb *tcp) +SYS_FUNC(mq_timedreceive) { if (entering(tcp)) tprintf("%ld, ", tcp->u_arg[0]); @@ -412,8 +409,7 @@ sys_mq_timedreceive(struct tcb *tcp) return 0; } -int -sys_mq_notify(struct tcb *tcp) +SYS_FUNC(mq_notify) { if (entering(tcp)) { tprintf("%ld, ", tcp->u_arg[0]); @@ -445,8 +441,7 @@ printmqattr(struct tcb *tcp, long addr) } } -int -sys_mq_getsetattr(struct tcb *tcp) +SYS_FUNC(mq_getsetattr) { if (entering(tcp)) { tprintf("%ld, ", tcp->u_arg[0]); @@ -457,8 +452,7 @@ sys_mq_getsetattr(struct tcb *tcp) return 0; } -int -sys_ipc(struct tcb *tcp) +SYS_FUNC(ipc) { return printargs(tcp); } diff --git a/kexec.c b/kexec.c index 6bec51c9..781280a6 100644 --- a/kexec.c +++ b/kexec.c @@ -72,8 +72,7 @@ print_kexec_segments(struct tcb *tcp, unsigned long addr, unsigned long len) tprintf(" %#lx", addr); } -int -sys_kexec_load(struct tcb *tcp) +SYS_FUNC(kexec_load) { unsigned long n; diff --git a/keyctl.c b/keyctl.c index e77557e9..0447745e 100644 --- a/keyctl.c +++ b/keyctl.c @@ -15,8 +15,7 @@ print_keyring_serial_number(key_serial_t id) tprintf("%d", id); } -int -sys_add_key(struct tcb *tcp) +SYS_FUNC(add_key) { if (entering(tcp)) { /* type */ @@ -35,8 +34,7 @@ sys_add_key(struct tcb *tcp) return 0; } -int -sys_request_key(struct tcb *tcp) +SYS_FUNC(request_key) { if (entering(tcp)) { /* type */ @@ -263,8 +261,7 @@ keyctl_set_reqkey_keyring(struct tcb *tcp, int reqkey) #include "xlat/keyctl_commands.h" -int -sys_keyctl(struct tcb *tcp) +SYS_FUNC(keyctl) { int cmd = tcp->u_arg[0]; diff --git a/ldt.c b/ldt.c index 0376d2b7..dbe49d92 100644 --- a/ldt.c +++ b/ldt.c @@ -39,8 +39,7 @@ print_user_desc(struct tcb *tcp, long addr) desc.useable); } -int -sys_modify_ldt(struct tcb *tcp) +SYS_FUNC(modify_ldt) { if (entering(tcp)) { tprintf("%ld, ", tcp->u_arg[0]); @@ -55,8 +54,7 @@ sys_modify_ldt(struct tcb *tcp) return 0; } -int -sys_set_thread_area(struct tcb *tcp) +SYS_FUNC(set_thread_area) { if (entering(tcp)) { print_user_desc(tcp, tcp->u_arg[0]); @@ -76,8 +74,7 @@ sys_set_thread_area(struct tcb *tcp) return 0; } -int -sys_get_thread_area(struct tcb *tcp) +SYS_FUNC(get_thread_area) { if (exiting(tcp)) { if (syserror(tcp)) @@ -91,8 +88,7 @@ sys_get_thread_area(struct tcb *tcp) #endif /* I386 || X86_64 || X32 */ #if defined(M68K) || defined(MIPS) -int -sys_set_thread_area(struct tcb *tcp) +SYS_FUNC(set_thread_area) { if (entering(tcp)) tprintf("%#lx", tcp->u_arg[0]); @@ -102,8 +98,7 @@ sys_set_thread_area(struct tcb *tcp) #endif #if defined(M68K) -int -sys_get_thread_area(struct tcb *tcp) +SYS_FUNC(get_thread_area) { return RVAL_HEX; } diff --git a/link.c b/link.c index 2f5298f8..74ff5142 100644 --- a/link.c +++ b/link.c @@ -20,8 +20,7 @@ #include "xlat/at_flags.h" -int -sys_link(struct tcb *tcp) +SYS_FUNC(link) { if (entering(tcp)) { printpath(tcp, tcp->u_arg[0]); @@ -31,8 +30,7 @@ sys_link(struct tcb *tcp) return 0; } -int -sys_linkat(struct tcb *tcp) +SYS_FUNC(linkat) { if (entering(tcp)) { print_dirfd(tcp, tcp->u_arg[0]); @@ -46,8 +44,7 @@ sys_linkat(struct tcb *tcp) return 0; } -int -sys_unlinkat(struct tcb *tcp) +SYS_FUNC(unlinkat) { if (entering(tcp)) { print_dirfd(tcp, tcp->u_arg[0]); @@ -58,8 +55,7 @@ sys_unlinkat(struct tcb *tcp) return 0; } -int -sys_symlinkat(struct tcb *tcp) +SYS_FUNC(symlinkat) { if (entering(tcp)) { printpath(tcp, tcp->u_arg[0]); diff --git a/linux/alpha/syscallent.h b/linux/alpha/syscallent.h index 5b17165b..7a25b44c 100644 --- a/linux/alpha/syscallent.h +++ b/linux/alpha/syscallent.h @@ -185,8 +185,8 @@ [157] = { 5, 0, printargs, "osf_sigwaitprim" }, /*not implemented */ [158] = { 5, 0, printargs, "osf_nfssvc" }, /*not implemented */ [159] = { 4, 0, printargs, "osf_getdirentries" }, -[160] = { 3, 0, osf_statfs, "osf_statfs" }, -[161] = { 3, 0, osf_fstatfs, "osf_fstatfs" }, +[160] = { 3, 0, sys_osf_statfs, "osf_statfs" }, +[161] = { 3, 0, sys_osf_fstatfs, "osf_fstatfs" }, [162] = { }, [163] = { 5, 0, printargs, "osf_asynch_daemon" }, /*not implemented */ [164] = { 5, 0, printargs, "osf_getfh" }, /*not implemented */ diff --git a/linux/syscall.h b/linux/syscall.h index dbf2d20f..bd706019 100644 --- a/linux/syscall.h +++ b/linux/syscall.h @@ -27,341 +27,17 @@ */ #include "dummy.h" - -/* common syscalls */ - -int sys_accept(); -int sys_accept4(); -int sys_access(); -int sys_add_key(); -int sys_adjtimex(); -int sys_arch_prctl(); -int sys_bind(); -int sys_brk(); -int sys_capget(); -int sys_capset(); -int sys_chdir(); -int sys_chmod(); -int sys_chown(); -int sys_clock_adjtime(); -int sys_clock_gettime(); -int sys_clock_nanosleep(); -int sys_clock_settime(); -int sys_clone(); -int sys_close(); -int sys_connect(); -int sys_creat(); -int sys_create_module(); -int sys_delete_module(); -int sys_dup(); -int sys_dup2(); -int sys_dup3(); -int sys_epoll_create(); -int sys_epoll_create1(); -int sys_epoll_ctl(); -int sys_epoll_pwait(); -int sys_epoll_wait(); -int sys_eventfd(); -int sys_eventfd2(); -int sys_execve(); -int sys_exit(); -int sys_faccessat(); -int sys_fadvise64(); -int sys_fadvise64_64(); -int sys_fallocate(); -int sys_fanotify_init(); -int sys_fanotify_mark(); -int sys_fchmod(); -int sys_fchmodat(); -int sys_fchown(); -int sys_fchownat(); -int sys_fcntl(); -int sys_fgetxattr(); -int sys_finit_module(); -int sys_flistxattr(); -int sys_flock(); -int sys_fork(); -int sys_fremovexattr(); -int sys_fsetxattr(); -int sys_fstat(); -int sys_fstat64(); -int sys_fstatfs(); -int sys_fstatfs64(); -int sys_ftruncate(); -int sys_ftruncate64(); -int sys_futex(); -int sys_futimesat(); -int sys_get_mempolicy(); -int sys_get_robust_list(); -int sys_get_thread_area(); -int sys_getcpu(); -int sys_getcwd(); -int sys_getdents(); -int sys_getdents64(); -int sys_getdtablesize(); -int sys_getgroups(); -int sys_gethostname(); -int sys_getitimer(); -int sys_getpmsg(); /* TODO: non-Linux, remove? */ -int sys_getpriority(); -int sys_getrandom(); -int sys_getresuid(); -int sys_getrlimit(); -int sys_getrusage(); -int sys_getsockname(); -int sys_getsockopt(); -int sys_gettimeofday(); -int sys_getuid(); -int sys_getxattr(); -int sys_init_module(); -int sys_inotify_add_watch(); -int sys_inotify_init1(); -int sys_inotify_rm_watch(); -int sys_io_cancel(); -int sys_io_destroy(); -int sys_io_getevents(); -int sys_io_setup(); -int sys_io_submit(); -int sys_ioctl(); -int sys_ioprio_get(); -int sys_ioprio_set(); -int sys_ipc(); -int sys_keyctl(); -int sys_kexec_load(); -int sys_kill(); -int sys_link(); -int sys_linkat(); -int sys_listen(); -int sys_listxattr(); -int sys_llseek(); -int sys_lseek(); -int sys_madvise(); -int sys_mbind(); -int sys_migrate_pages(); -int sys_mincore(); -int sys_mknod(); -int sys_mknodat(); -int sys_mlockall(); -int sys_mmap(); -int sys_mmap_pgoff(); -int sys_mmap_4koff(); -int sys_modify_ldt(); -int sys_mount(); -int sys_move_pages(); -int sys_mprotect(); -int sys_mq_getsetattr(); -int sys_mq_notify(); -int sys_mq_open(); -int sys_mq_timedreceive(); -int sys_mq_timedsend(); -int sys_mremap(); -int sys_msgctl(); -int sys_msgget(); -int sys_msgrcv(); -int sys_msgsnd(); -int sys_msync(); -int sys_munmap(); -int sys_nanosleep(); -int sys_newfstatat(); -int sys_old_mmap(); -int sys_old_mmap_pgoff(); -int sys_oldfstat(); -int sys_oldselect(); -int sys_oldstat(); -int sys_open(); -int sys_openat(); -int sys_perf_event_open(); -int sys_personality(); -int sys_pipe(); -int sys_pipe2(); -int sys_poll(); -int sys_poll(); -int sys_ppoll(); -int sys_prctl(); -int sys_pread(); -int sys_preadv(); -int sys_prlimit64(); -int sys_process_vm_readv(); -int sys_process_vm_writev(); -int sys_pselect6(); -int sys_ptrace(); -int sys_putpmsg(); /* TODO: non-Linux, remove? */ -int sys_pwrite(); -int sys_pwritev(); -int sys_query_module(); -int sys_quotactl(); -int sys_read(); -int sys_readahead(); -int sys_readdir(); -int sys_readlink(); -int sys_readlinkat(); -int sys_readv(); -int sys_reboot(); -int sys_recv(); -int sys_recvfrom(); -int sys_recvmmsg(); -int sys_recvmsg(); -int sys_remap_file_pages(); -int sys_removexattr(); -int sys_renameat(); -int sys_renameat2(); -int sys_request_key(); -int sys_restart_syscall(); -int sys_rt_sigaction(); -int sys_rt_sigpending(); -int sys_rt_sigprocmask(); -int sys_rt_sigqueueinfo(); -int sys_rt_sigsuspend(); -int sys_rt_sigtimedwait(); -int sys_rt_tgsigqueueinfo(); -int sys_sched_get_priority_min(); -int sys_sched_getaffinity(); -int sys_sched_getparam(); -int sys_sched_getscheduler(); -int sys_sched_rr_get_interval(); -int sys_sched_setaffinity(); -int sys_sched_setparam(); -int sys_sched_setscheduler(); -int sys_seccomp(); -int sys_select(); -int sys_semctl(); -int sys_semget(); -int sys_semop(); -int sys_semtimedop(); -int sys_send(); -int sys_sendfile(); -int sys_sendfile64(); -int sys_sendmmsg(); -int sys_sendmsg(); -int sys_sendto(); -int sys_set_mempolicy(); -int sys_set_thread_area(); -int sys_setfsuid(); -int sys_setgroups(); -int sys_sethostname(); -int sys_setitimer(); -int sys_setns(); -int sys_setpriority(); -int sys_setresuid(); -int sys_setreuid(); -int sys_setrlimit(); -int sys_setsockopt(); -int sys_settimeofday(); -int sys_setuid(); -int sys_setxattr(); -int sys_shmat(); -int sys_shmctl(); -int sys_shmdt(); -int sys_shmget(); -int sys_shutdown(); -int sys_sigaction(); -int sys_sigaltstack(); -int sys_siggetmask(); -int sys_signal(); -int sys_signalfd(); -int sys_signalfd4(); -int sys_sigpending(); -int sys_sigprocmask(); -int sys_sigreturn(); -int sys_sigsetmask(); -int sys_sigsuspend(); -int sys_socket(); -int sys_socketcall(); -int sys_socketpair(); -int sys_splice(); -int sys_stat(); -int sys_stat64(); -int sys_statfs(); -int sys_statfs64(); -int sys_swapon(); -int sys_symlinkat(); -int sys_sync_file_range(); -int sys_sync_file_range2(); -int sys_sysctl(); -int sys_sysinfo(); -int sys_syslog(); -int sys_tee(); -int sys_tgkill(); -int sys_time(); -int sys_timer_create(); -int sys_timer_gettime(); -int sys_timer_settime(); -int sys_timerfd(); -int sys_timerfd_create(); -int sys_timerfd_gettime(); -int sys_timerfd_settime(); -int sys_times(); -int sys_truncate(); -int sys_truncate64(); -int sys_umask(); -int sys_umount2(); -int sys_uname(); -int sys_unlinkat(); -int sys_unshare(); -int sys_utime(); -int sys_utimensat(); -int sys_utimes(); -int sys_vmsplice(); -int sys_wait4(); -int sys_waitid(); -int sys_waitpid(); -int sys_write(); -int sys_writev(); - -/* architecture-specific calls */ -#ifdef ALPHA -int osf_statfs(); -int osf_fstatfs(); -int sys_osf_getitimer(); -int sys_osf_getrusage(); -int sys_osf_gettimeofday(); -int sys_osf_select(); -int sys_osf_setitimer(); -int sys_osf_settimeofday(); -int sys_osf_utimes(); -int sys_osf_wait4(); -#endif - -#if defined(ALPHA) || defined(IA64) || defined(SPARC) || defined(SPARC64) -int sys_getpagesize(); -#endif - -#ifdef MIPS -int sys_sysmips(); -#endif - -#if defined M68K || defined SH -int sys_cacheflush(); -#endif - -#if defined OR1K -int sys_or1k_atomic(); -#endif - -#ifdef POWERPC -int sys_subpage_prot(); -#endif - -#ifdef BFIN -int sys_cacheflush(); -int sys_sram_alloc(); -#endif - -#if defined SPARC || defined SPARC64 -int sys_execv(); -int sys_getmsg(); -int sys_putmsg(); -#endif +#include "sys_func.h" #if NEED_UID16_PARSERS -int sys_chown16(); -int sys_fchown16(); -int sys_getgroups16(); -int sys_getresuid16(); -int sys_getuid16(); -int sys_setfsuid16(); -int sys_setgroups16(); -int sys_setresuid16(); -int sys_setreuid16(); -int sys_setuid16(); +extern SYS_FUNC(chown16); +extern SYS_FUNC(fchown16); +extern SYS_FUNC(getgroups16); +extern SYS_FUNC(getresuid16); +extern SYS_FUNC(getuid16); +extern SYS_FUNC(setfsuid16); +extern SYS_FUNC(setgroups16); +extern SYS_FUNC(setresuid16); +extern SYS_FUNC(setreuid16); +extern SYS_FUNC(setuid16); #endif diff --git a/lseek.c b/lseek.c index 7a0a501e..74441edb 100644 --- a/lseek.c +++ b/lseek.c @@ -10,8 +10,7 @@ * Use test/x32_lseek.c to test lseek decoding. */ #if defined(LINUX_MIPSN32) || defined(X32) -int -sys_lseek(struct tcb *tcp) +SYS_FUNC(lseek) { long long offset; int whence; @@ -29,8 +28,7 @@ sys_lseek(struct tcb *tcp) return RVAL_LUDECIMAL; } #else -int -sys_lseek(struct tcb *tcp) +SYS_FUNC(lseek) { long offset; int whence; @@ -62,8 +60,7 @@ sys_lseek(struct tcb *tcp) * for hi and lo. We would need to use tcp->ext_arg[N] on x32... * ...however, x32 (and x86_64) does not _have_ llseek syscall as such. */ -int -sys_llseek(struct tcb *tcp) +SYS_FUNC(llseek) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); diff --git a/mem.c b/mem.c index 40826587..322b7eb7 100644 --- a/mem.c +++ b/mem.c @@ -44,8 +44,7 @@ get_pagesize(void) return pagesize; } -int -sys_brk(struct tcb *tcp) +SYS_FUNC(brk) { if (entering(tcp)) { tprintf("%#lx", tcp->u_arg[0]); @@ -95,8 +94,7 @@ print_mmap(struct tcb *tcp, long *u_arg, unsigned long long offset) */ /* Params are pointed to by u_arg[0], offset is in bytes */ -int -sys_old_mmap(struct tcb *tcp) +SYS_FUNC(old_mmap) { long u_arg[6]; #if defined(IA64) @@ -127,8 +125,7 @@ sys_old_mmap(struct tcb *tcp) #if defined(S390) /* Params are pointed to by u_arg[0], offset is in pages */ -int -sys_old_mmap_pgoff(struct tcb *tcp) +SYS_FUNC(old_mmap_pgoff) { long u_arg[5]; int i; @@ -145,8 +142,7 @@ sys_old_mmap_pgoff(struct tcb *tcp) #endif /* Params are passed directly, offset is in bytes */ -int -sys_mmap(struct tcb *tcp) +SYS_FUNC(mmap) { unsigned long long offset = (unsigned long) tcp->u_arg[5]; #if defined(LINUX_MIPSN32) || defined(X32) @@ -162,8 +158,7 @@ sys_mmap(struct tcb *tcp) } /* Params are passed directly, offset is in pages */ -int -sys_mmap_pgoff(struct tcb *tcp) +SYS_FUNC(mmap_pgoff) { /* Try test/mmap_offset_decode.c */ unsigned long long offset; @@ -173,8 +168,7 @@ sys_mmap_pgoff(struct tcb *tcp) } /* Params are passed directly, offset is in 4k units */ -int -sys_mmap_4koff(struct tcb *tcp) +SYS_FUNC(mmap_4koff) { unsigned long long offset; offset = (unsigned long) tcp->u_arg[5]; @@ -182,8 +176,7 @@ sys_mmap_4koff(struct tcb *tcp) return print_mmap(tcp, tcp->u_arg, offset); } -int -sys_munmap(struct tcb *tcp) +SYS_FUNC(munmap) { if (entering(tcp)) { tprintf("%#lx, %lu", @@ -192,8 +185,7 @@ sys_munmap(struct tcb *tcp) return 0; } -int -sys_mprotect(struct tcb *tcp) +SYS_FUNC(mprotect) { if (entering(tcp)) { tprintf("%#lx, %lu, ", @@ -205,8 +197,7 @@ sys_mprotect(struct tcb *tcp) #include "xlat/mremap_flags.h" -int -sys_mremap(struct tcb *tcp) +SYS_FUNC(mremap) { if (entering(tcp)) { tprintf("%#lx, %lu, %lu, ", tcp->u_arg[0], tcp->u_arg[1], @@ -223,8 +214,7 @@ sys_mremap(struct tcb *tcp) #include "xlat/madvise_cmds.h" -int -sys_madvise(struct tcb *tcp) +SYS_FUNC(madvise) { if (entering(tcp)) { tprintf("%#lx, %lu, ", tcp->u_arg[0], tcp->u_arg[1]); @@ -235,8 +225,7 @@ sys_madvise(struct tcb *tcp) #include "xlat/mlockall_flags.h" -int -sys_mlockall(struct tcb *tcp) +SYS_FUNC(mlockall) { if (entering(tcp)) { printflags(mlockall_flags, tcp->u_arg[0], "MCL_???"); @@ -246,8 +235,7 @@ sys_mlockall(struct tcb *tcp) #include "xlat/mctl_sync.h" -int -sys_msync(struct tcb *tcp) +SYS_FUNC(msync) { if (entering(tcp)) { /* addr */ @@ -260,8 +248,7 @@ sys_msync(struct tcb *tcp) return 0; } -int -sys_mincore(struct tcb *tcp) +SYS_FUNC(mincore) { if (entering(tcp)) { tprintf("%#lx, %lu, ", tcp->u_arg[0], tcp->u_arg[1]); @@ -291,8 +278,7 @@ sys_mincore(struct tcb *tcp) } #if defined(ALPHA) || defined(IA64) || defined(SPARC) || defined(SPARC64) -int -sys_getpagesize(struct tcb *tcp) +SYS_FUNC(getpagesize) { if (exiting(tcp)) return RVAL_HEX; @@ -300,8 +286,7 @@ sys_getpagesize(struct tcb *tcp) } #endif -int -sys_remap_file_pages(struct tcb *tcp) +SYS_FUNC(remap_file_pages) { if (entering(tcp)) { tprintf("%#lx, %lu, ", tcp->u_arg[0], tcp->u_arg[1]); @@ -377,8 +362,7 @@ get_nodes(struct tcb *tcp, unsigned long ptr, unsigned long maxnodes, int err) tprintf(", %lu", maxnodes); } -int -sys_mbind(struct tcb *tcp) +SYS_FUNC(mbind) { if (entering(tcp)) { tprintf("%#lx, %lu, ", tcp->u_arg[0], tcp->u_arg[1]); @@ -390,8 +374,7 @@ sys_mbind(struct tcb *tcp) return 0; } -int -sys_set_mempolicy(struct tcb *tcp) +SYS_FUNC(set_mempolicy) { if (entering(tcp)) { printxval(policies, tcp->u_arg[0], "MPOL_???"); @@ -400,8 +383,7 @@ sys_set_mempolicy(struct tcb *tcp) return 0; } -int -sys_get_mempolicy(struct tcb *tcp) +SYS_FUNC(get_mempolicy) { if (exiting(tcp)) { int pol; @@ -418,8 +400,7 @@ sys_get_mempolicy(struct tcb *tcp) return 0; } -int -sys_migrate_pages(struct tcb *tcp) +SYS_FUNC(migrate_pages) { if (entering(tcp)) { tprintf("%ld, ", (long) (pid_t) tcp->u_arg[0]); @@ -430,8 +411,7 @@ sys_migrate_pages(struct tcb *tcp) return 0; } -int -sys_move_pages(struct tcb *tcp) +SYS_FUNC(move_pages) { if (entering(tcp)) { unsigned long npages = tcp->u_arg[1]; @@ -502,8 +482,7 @@ sys_move_pages(struct tcb *tcp) } #if defined(POWERPC) -int -sys_subpage_prot(struct tcb *tcp) +SYS_FUNC(subpage_prot) { if (entering(tcp)) { unsigned long cur, end, abbrev_end, entries; diff --git a/mknod.c b/mknod.c index 1463232c..dbca736d 100644 --- a/mknod.c +++ b/mknod.c @@ -40,14 +40,12 @@ decode_mknod(struct tcb *tcp, int offset) return 0; } -int -sys_mknod(struct tcb *tcp) +SYS_FUNC(mknod) { return decode_mknod(tcp, 0); } -int -sys_mknodat(struct tcb *tcp) +SYS_FUNC(mknodat) { if (entering(tcp)) print_dirfd(tcp, tcp->u_arg[0]); @@ -55,8 +53,7 @@ sys_mknodat(struct tcb *tcp) } #if defined(SPARC) || defined(SPARC64) -int -sys_xmknod(struct tcb *tcp) +SYS_FUNC(xmknod) { int mode = tcp->u_arg[2]; diff --git a/mount.c b/mount.c index f6c8f758..7b30b371 100644 --- a/mount.c +++ b/mount.c @@ -32,8 +32,7 @@ #include "xlat/mount_flags.h" -int -sys_mount(struct tcb *tcp) +SYS_FUNC(mount) { if (entering(tcp)) { int ignore_type = 0, ignore_data = 0; diff --git a/net.c b/net.c index 58c54c87..2ed950de 100644 --- a/net.c +++ b/net.c @@ -729,8 +729,7 @@ tprint_sock_type(int flags) printflags(sock_type_flags, flags, "SOCK_???"); } -int -sys_socket(struct tcb *tcp) +SYS_FUNC(socket) { if (entering(tcp)) { printxval(domains, tcp->u_arg[0], "PF_???"); @@ -770,8 +769,7 @@ sys_socket(struct tcb *tcp) return 0; } -int -sys_bind(struct tcb *tcp) +SYS_FUNC(bind) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -782,14 +780,12 @@ sys_bind(struct tcb *tcp) return 0; } -int -sys_connect(struct tcb *tcp) +SYS_FUNC(connect) { return sys_bind(tcp); } -int -sys_listen(struct tcb *tcp) +SYS_FUNC(listen) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -828,22 +824,19 @@ do_sockname(struct tcb *tcp, int flags_arg) return 0; } -int -sys_accept(struct tcb *tcp) +SYS_FUNC(accept) { do_sockname(tcp, -1); return RVAL_FD; } -int -sys_accept4(struct tcb *tcp) +SYS_FUNC(accept4) { do_sockname(tcp, 3); return RVAL_FD; } -int -sys_send(struct tcb *tcp) +SYS_FUNC(send) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -856,8 +849,7 @@ sys_send(struct tcb *tcp) return 0; } -int -sys_sendto(struct tcb *tcp) +SYS_FUNC(sendto) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -877,8 +869,7 @@ sys_sendto(struct tcb *tcp) #ifdef HAVE_SENDMSG -int -sys_sendmsg(struct tcb *tcp) +SYS_FUNC(sendmsg) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -891,8 +882,7 @@ sys_sendmsg(struct tcb *tcp) return 0; } -int -sys_sendmmsg(struct tcb *tcp) +SYS_FUNC(sendmmsg) { if (entering(tcp)) { /* sockfd */ @@ -912,8 +902,7 @@ sys_sendmmsg(struct tcb *tcp) #endif /* HAVE_SENDMSG */ -int -sys_recv(struct tcb *tcp) +SYS_FUNC(recv) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -930,8 +919,7 @@ sys_recv(struct tcb *tcp) return 0; } -int -sys_recvfrom(struct tcb *tcp) +SYS_FUNC(recvfrom) { int fromlen; @@ -977,8 +965,7 @@ sys_recvfrom(struct tcb *tcp) #ifdef HAVE_SENDMSG -int -sys_recvmsg(struct tcb *tcp) +SYS_FUNC(recvmsg) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -995,8 +982,7 @@ sys_recvmsg(struct tcb *tcp) return 0; } -int -sys_recvmmsg(struct tcb *tcp) +SYS_FUNC(recvmmsg) { /* +5 chars are for "left " prefix */ static char str[5 + TIMESPEC_TEXT_BUFSIZE]; @@ -1044,8 +1030,7 @@ sys_recvmmsg(struct tcb *tcp) #include "xlat/shutdown_modes.h" -int -sys_shutdown(struct tcb *tcp) +SYS_FUNC(shutdown) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -1055,8 +1040,7 @@ sys_shutdown(struct tcb *tcp) return 0; } -int -sys_getsockname(struct tcb *tcp) +SYS_FUNC(getsockname) { return do_sockname(tcp, -1); } @@ -1090,20 +1074,17 @@ do_pipe(struct tcb *tcp, int flags_arg) return 0; } -int -sys_pipe(struct tcb *tcp) +SYS_FUNC(pipe) { return do_pipe(tcp, -1); } -int -sys_pipe2(struct tcb *tcp) +SYS_FUNC(pipe2) { return do_pipe(tcp, 1); } -int -sys_socketpair(struct tcb *tcp) +SYS_FUNC(socketpair) { int fds[2]; @@ -1306,8 +1287,7 @@ done: tprintf(", [%d]", len); } -int -sys_getsockopt(struct tcb *tcp) +SYS_FUNC(getsockopt) { if (entering(tcp)) { print_sockopt_fd_level_name(tcp, tcp->u_arg[0], @@ -1493,8 +1473,7 @@ done: tprintf(", %d", len); } -int -sys_setsockopt(struct tcb *tcp) +SYS_FUNC(setsockopt) { if (entering(tcp)) { print_sockopt_fd_level_name(tcp, tcp->u_arg[0], diff --git a/open.c b/open.c index 5d82981f..4a70d89c 100644 --- a/open.c +++ b/open.c @@ -97,22 +97,19 @@ decode_open(struct tcb *tcp, int offset) return RVAL_FD; } -int -sys_open(struct tcb *tcp) +SYS_FUNC(open) { return decode_open(tcp, 0); } -int -sys_openat(struct tcb *tcp) +SYS_FUNC(openat) { if (entering(tcp)) print_dirfd(tcp, tcp->u_arg[0]); return decode_open(tcp, 1); } -int -sys_creat(struct tcb *tcp) +SYS_FUNC(creat) { if (entering(tcp)) { printpath(tcp, tcp->u_arg[0]); diff --git a/or1k_atomic.c b/or1k_atomic.c index 1b60272c..05509a77 100644 --- a/or1k_atomic.c +++ b/or1k_atomic.c @@ -14,7 +14,7 @@ #include "xlat/atomic_ops.h" -int sys_or1k_atomic(struct tcb *tcp) +SYS_FUNC(or1k_atomic) { if (entering(tcp)) { printxval(atomic_ops, tcp->u_arg[0], "???"); diff --git a/personality.c b/personality.c index a90d7dd7..98b8bba1 100644 --- a/personality.c +++ b/personality.c @@ -4,8 +4,7 @@ #include "xlat/personality_options.h" -int -sys_personality(struct tcb *tcp) +SYS_FUNC(personality) { if (entering(tcp)) printxval(personality_options, tcp->u_arg[0], "PER_???"); diff --git a/prctl.c b/prctl.c index 0ec0fc88..4a6bd253 100644 --- a/prctl.c +++ b/prctl.c @@ -281,8 +281,7 @@ prctl_exit(struct tcb *tcp) return 0; } -int -sys_prctl(struct tcb *tcp) +SYS_FUNC(prctl) { return entering(tcp) ? prctl_enter(tcp) : prctl_exit(tcp); } @@ -291,8 +290,7 @@ sys_prctl(struct tcb *tcp) # include # include "xlat/archvals.h" -int -sys_arch_prctl(struct tcb *tcp) +SYS_FUNC(arch_prctl) { if (entering(tcp)) printxval(archvals, tcp->u_arg[0], "ARCH_???"); diff --git a/process.c b/process.c index 690ca8ef..73092a22 100644 --- a/process.c +++ b/process.c @@ -55,8 +55,7 @@ static const struct xlat struct_user_offsets[] = { XLAT_END }; -int -sys_ptrace(struct tcb *tcp) +SYS_FUNC(ptrace) { const struct xlat *x; unsigned long addr; diff --git a/process_vm.c b/process_vm.c index 02058a5d..310223eb 100644 --- a/process_vm.c +++ b/process_vm.c @@ -1,7 +1,6 @@ #include "defs.h" -int -sys_process_vm_readv(struct tcb *tcp) +SYS_FUNC(process_vm_readv) { if (entering(tcp)) { /* arg 1: pid */ @@ -28,8 +27,7 @@ sys_process_vm_readv(struct tcb *tcp) return 0; } -int -sys_process_vm_writev(struct tcb *tcp) +SYS_FUNC(process_vm_writev) { if (entering(tcp)) { /* arg 1: pid */ diff --git a/quota.c b/quota.c index f9a1bc57..fd0ae029 100644 --- a/quota.c +++ b/quota.c @@ -524,8 +524,7 @@ decode_cmd_data(struct tcb *tcp, u_int32_t cmd, unsigned long data) } } -int -sys_quotactl(struct tcb *tcp) +SYS_FUNC(quotactl) { /* * The Linux kernel only looks at the low 32 bits of command and id diff --git a/readahead.c b/readahead.c index 8f47988d..a34b60d9 100644 --- a/readahead.c +++ b/readahead.c @@ -1,7 +1,6 @@ #include "defs.h" -int -sys_readahead(struct tcb *tcp) +SYS_FUNC(readahead) { if (entering(tcp)) { int argn; diff --git a/readlink.c b/readlink.c index efa8e9f8..fcb41533 100644 --- a/readlink.c +++ b/readlink.c @@ -23,14 +23,12 @@ decode_readlink(struct tcb *tcp, int offset) return 0; } -int -sys_readlink(struct tcb *tcp) +SYS_FUNC(readlink) { return decode_readlink(tcp, 0); } -int -sys_readlinkat(struct tcb *tcp) +SYS_FUNC(readlinkat) { if (entering(tcp)) print_dirfd(tcp, tcp->u_arg[0]); diff --git a/reboot.c b/reboot.c index 5c4752d9..2d118510 100644 --- a/reboot.c +++ b/reboot.c @@ -4,8 +4,7 @@ #include "xlat/bootflags2.h" #include "xlat/bootflags3.h" -int -sys_reboot(struct tcb *tcp) +SYS_FUNC(reboot) { if (exiting(tcp)) return 0; diff --git a/renameat.c b/renameat.c index 1c025514..ac8d2023 100644 --- a/renameat.c +++ b/renameat.c @@ -10,8 +10,7 @@ decode_renameat(struct tcb *tcp) printpath(tcp, tcp->u_arg[3]); } -int -sys_renameat(struct tcb *tcp) +SYS_FUNC(renameat) { if (entering(tcp)) { decode_renameat(tcp); @@ -22,8 +21,7 @@ sys_renameat(struct tcb *tcp) #include #include "xlat/rename_flags.h" -int -sys_renameat2(struct tcb *tcp) +SYS_FUNC(renameat2) { if (entering(tcp)) { decode_renameat(tcp); diff --git a/resource.c b/resource.c index 57ce17e0..687f8d88 100644 --- a/resource.c +++ b/resource.c @@ -142,8 +142,7 @@ decode_rlimit(struct tcb *tcp, unsigned long addr) #endif -int -sys_getrlimit(struct tcb *tcp) +SYS_FUNC(getrlimit) { if (entering(tcp)) { printxval(resources, tcp->u_arg[0], "RLIMIT_???"); @@ -155,8 +154,7 @@ sys_getrlimit(struct tcb *tcp) return 0; } -int -sys_setrlimit(struct tcb *tcp) +SYS_FUNC(setrlimit) { if (entering(tcp)) { printxval(resources, tcp->u_arg[0], "RLIMIT_???"); @@ -166,8 +164,7 @@ sys_setrlimit(struct tcb *tcp) return 0; } -int -sys_prlimit64(struct tcb *tcp) +SYS_FUNC(prlimit64) { if (entering(tcp)) { tprintf("%ld, ", tcp->u_arg[0]); @@ -276,8 +273,7 @@ printrusage(struct tcb *tcp, long addr) } } -int -sys_getrusage(struct tcb *tcp) +SYS_FUNC(getrusage) { if (entering(tcp)) { printxval(usagewho, tcp->u_arg[0], "RUSAGE_???"); @@ -289,8 +285,7 @@ sys_getrusage(struct tcb *tcp) } #ifdef ALPHA -int -sys_osf_getrusage(struct tcb *tcp) +SYS_FUNC(osf_getrusage) { if (entering(tcp)) { printxval(usagewho, tcp->u_arg[0], "RUSAGE_???"); @@ -304,8 +299,7 @@ sys_osf_getrusage(struct tcb *tcp) #include "xlat/priorities.h" -int -sys_getpriority(struct tcb *tcp) +SYS_FUNC(getpriority) { if (entering(tcp)) { printxval(priorities, tcp->u_arg[0], "PRIO_???"); @@ -314,8 +308,7 @@ sys_getpriority(struct tcb *tcp) return 0; } -int -sys_setpriority(struct tcb *tcp) +SYS_FUNC(setpriority) { if (entering(tcp)) { printxval(priorities, tcp->u_arg[0], "PRIO_???"); @@ -324,8 +317,7 @@ sys_setpriority(struct tcb *tcp) return 0; } -int -sys_times(struct tcb *tcp) +SYS_FUNC(times) { struct tms tbuf; diff --git a/sched.c b/sched.c index d3192fa2..8bb7c253 100644 --- a/sched.c +++ b/sched.c @@ -4,8 +4,7 @@ #include "xlat/schedulers.h" -int -sys_sched_getscheduler(struct tcb *tcp) +SYS_FUNC(sched_getscheduler) { if (entering(tcp)) { tprintf("%d", (int) tcp->u_arg[0]); @@ -17,8 +16,7 @@ sys_sched_getscheduler(struct tcb *tcp) return 0; } -int -sys_sched_setscheduler(struct tcb *tcp) +SYS_FUNC(sched_setscheduler) { if (entering(tcp)) { struct sched_param p; @@ -32,8 +30,7 @@ sys_sched_setscheduler(struct tcb *tcp) return 0; } -int -sys_sched_getparam(struct tcb *tcp) +SYS_FUNC(sched_getparam) { if (entering(tcp)) { tprintf("%d, ", (int) tcp->u_arg[0]); @@ -47,8 +44,7 @@ sys_sched_getparam(struct tcb *tcp) return 0; } -int -sys_sched_setparam(struct tcb *tcp) +SYS_FUNC(sched_setparam) { if (entering(tcp)) { struct sched_param p; @@ -60,8 +56,7 @@ sys_sched_setparam(struct tcb *tcp) return 0; } -int -sys_sched_get_priority_min(struct tcb *tcp) +SYS_FUNC(sched_get_priority_min) { if (entering(tcp)) { printxval(schedulers, tcp->u_arg[0], "SCHED_???"); @@ -69,8 +64,7 @@ sys_sched_get_priority_min(struct tcb *tcp) return 0; } -int -sys_sched_rr_get_interval(struct tcb *tcp) +SYS_FUNC(sched_rr_get_interval) { if (entering(tcp)) { tprintf("%ld, ", (long) (pid_t) tcp->u_arg[0]); diff --git a/seccomp.c b/seccomp.c index 9939c117..09c6bbaf 100644 --- a/seccomp.c +++ b/seccomp.c @@ -230,8 +230,7 @@ decode_seccomp_set_mode_strict(unsigned int flags, unsigned long addr) tprints("NULL"); } -int -sys_seccomp(struct tcb *tcp) +SYS_FUNC(seccomp) { if (entering(tcp)) { unsigned int op = tcp->u_arg[0]; diff --git a/sigaltstack.c b/sigaltstack.c index feba59b2..b3b834f1 100644 --- a/sigaltstack.c +++ b/sigaltstack.c @@ -40,8 +40,7 @@ print_stack_t(struct tcb *tcp, unsigned long addr) } } -int -sys_sigaltstack(struct tcb *tcp) +SYS_FUNC(sigaltstack) { if (entering(tcp)) { print_stack_t(tcp, tcp->u_arg[0]); diff --git a/signal.c b/signal.c index 0b52ddb6..c9e7518f 100644 --- a/signal.c +++ b/signal.c @@ -249,8 +249,7 @@ print_sigset_addr_len(struct tcb *tcp, long addr, long len) tprints(sprintsigmask_n("", mask, len)); } -int -sys_sigsetmask(struct tcb *tcp) +SYS_FUNC(sigsetmask) { if (entering(tcp)) { tprintsigmask_val("", tcp->u_arg[0]); @@ -359,8 +358,7 @@ decode_old_sigaction(struct tcb *tcp, long addr) tprints("}"); } -int -sys_sigaction(struct tcb *tcp) +SYS_FUNC(sigaction) { if (entering(tcp)) { printsignal(tcp->u_arg[0]); @@ -372,8 +370,7 @@ sys_sigaction(struct tcb *tcp) return 0; } -int -sys_signal(struct tcb *tcp) +SYS_FUNC(signal) { if (entering(tcp)) { printsignal(tcp->u_arg[0]); @@ -411,8 +408,7 @@ sys_signal(struct tcb *tcp) #endif /* HAVE_SIGACTION */ -int -sys_siggetmask(struct tcb *tcp) +SYS_FUNC(siggetmask) { if (exiting(tcp)) { tcp->auxstr = sprintsigmask_val("mask ", tcp->u_rval); @@ -420,8 +416,7 @@ sys_siggetmask(struct tcb *tcp) return RVAL_HEX | RVAL_STR; } -int -sys_sigsuspend(struct tcb *tcp) +SYS_FUNC(sigsuspend) { if (entering(tcp)) { tprintsigmask_val("", tcp->u_arg[2]); @@ -432,8 +427,7 @@ sys_sigsuspend(struct tcb *tcp) #ifdef HAVE_SIGACTION /* "Old" sigprocmask, which operates with word-sized signal masks */ -int -sys_sigprocmask(struct tcb *tcp) +SYS_FUNC(sigprocmask) { # ifdef ALPHA if (entering(tcp)) { @@ -474,8 +468,7 @@ sys_sigprocmask(struct tcb *tcp) #endif /* HAVE_SIGACTION */ -int -sys_kill(struct tcb *tcp) +SYS_FUNC(kill) { if (entering(tcp)) { tprintf("%ld, %s", @@ -486,8 +479,7 @@ sys_kill(struct tcb *tcp) return 0; } -int -sys_tgkill(struct tcb *tcp) +SYS_FUNC(tgkill) { if (entering(tcp)) { tprintf("%ld, %ld, %s", @@ -499,8 +491,7 @@ sys_tgkill(struct tcb *tcp) return 0; } -int -sys_sigpending(struct tcb *tcp) +SYS_FUNC(sigpending) { if (exiting(tcp)) { if (syserror(tcp)) @@ -511,8 +502,7 @@ sys_sigpending(struct tcb *tcp) return 0; } -int -sys_rt_sigprocmask(struct tcb *tcp) +SYS_FUNC(rt_sigprocmask) { /* Note: arg[3] is the length of the sigset. Kernel requires NSIG / 8 */ if (entering(tcp)) { @@ -637,8 +627,7 @@ decode_new_sigaction(struct tcb *tcp, long addr) tprints("}"); } -int -sys_rt_sigaction(struct tcb *tcp) +SYS_FUNC(rt_sigaction) { if (entering(tcp)) { printsignal(tcp->u_arg[0]); @@ -658,8 +647,7 @@ sys_rt_sigaction(struct tcb *tcp) return 0; } -int -sys_rt_sigpending(struct tcb *tcp) +SYS_FUNC(rt_sigpending) { if (exiting(tcp)) { /* @@ -677,8 +665,7 @@ sys_rt_sigpending(struct tcb *tcp) return 0; } -int -sys_rt_sigsuspend(struct tcb *tcp) +SYS_FUNC(rt_sigsuspend) { if (entering(tcp)) { /* NB: kernel requires arg[1] == NSIG / 8 */ @@ -696,8 +683,7 @@ print_sigqueueinfo(struct tcb *tcp, int sig, unsigned long uinfo) printsiginfo_at(tcp, uinfo); } -int -sys_rt_sigqueueinfo(struct tcb *tcp) +SYS_FUNC(rt_sigqueueinfo) { if (entering(tcp)) { tprintf("%lu, ", tcp->u_arg[0]); @@ -706,8 +692,7 @@ sys_rt_sigqueueinfo(struct tcb *tcp) return 0; } -int -sys_rt_tgsigqueueinfo(struct tcb *tcp) +SYS_FUNC(rt_tgsigqueueinfo) { if (entering(tcp)) { tprintf("%lu, %lu, ", tcp->u_arg[0], tcp->u_arg[1]); @@ -716,7 +701,7 @@ sys_rt_tgsigqueueinfo(struct tcb *tcp) return 0; } -int sys_rt_sigtimedwait(struct tcb *tcp) +SYS_FUNC(rt_sigtimedwait) { /* NB: kernel requires arg[3] == NSIG / 8 */ if (entering(tcp)) { @@ -742,8 +727,7 @@ int sys_rt_sigtimedwait(struct tcb *tcp) return 0; }; -int -sys_restart_syscall(struct tcb *tcp) +SYS_FUNC(restart_syscall) { if (entering(tcp)) { tprintf("<... resuming interrupted %s ...>", @@ -772,14 +756,12 @@ do_signalfd(struct tcb *tcp, int flags_arg) return 0; } -int -sys_signalfd(struct tcb *tcp) +SYS_FUNC(signalfd) { return do_signalfd(tcp, -1); } -int -sys_signalfd4(struct tcb *tcp) +SYS_FUNC(signalfd4) { return do_signalfd(tcp, 3); } diff --git a/sigreturn.c b/sigreturn.c index b3fc038b..3909d1d1 100644 --- a/sigreturn.c +++ b/sigreturn.c @@ -13,8 +13,7 @@ # error NSIG < 32 #endif -int -sys_sigreturn(struct tcb *tcp) +SYS_FUNC(sigreturn) { if (entering(tcp)) { #include "arch_sigreturn.c" diff --git a/sock.c b/sock.c index dc8febc1..48bf74b5 100644 --- a/sock.c +++ b/sock.c @@ -291,8 +291,7 @@ sock_ioctl(struct tcb *tcp, const unsigned int code, long arg) } } -int -sys_socketcall(struct tcb *tcp) +SYS_FUNC(socketcall) { return printargs(tcp); } diff --git a/sram_alloc.c b/sram_alloc.c index b524c7b2..a27941ab 100644 --- a/sram_alloc.c +++ b/sram_alloc.c @@ -6,8 +6,7 @@ #include "xlat/sram_alloc_flags.h" -int -sys_sram_alloc(struct tcb *tcp) +SYS_FUNC(sram_alloc) { if (entering(tcp)) { /* size */ diff --git a/statfs.c b/statfs.c index 6373195d..3845c2a7 100644 --- a/statfs.c +++ b/statfs.c @@ -52,8 +52,7 @@ printstatfs(struct tcb *tcp, const long addr) tprints("}"); } -int -sys_statfs(struct tcb *tcp) +SYS_FUNC(statfs) { if (entering(tcp)) { printpath(tcp, tcp->u_arg[0]); @@ -64,8 +63,7 @@ sys_statfs(struct tcb *tcp) return 0; } -int -sys_fstatfs(struct tcb *tcp) +SYS_FUNC(fstatfs) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -181,16 +179,14 @@ do_statfs64_fstatfs64(struct tcb *tcp) return 0; } -int -sys_statfs64(struct tcb *tcp) +SYS_FUNC(statfs64) { if (entering(tcp)) printpath(tcp, tcp->u_arg[0]); return do_statfs64_fstatfs64(tcp); } -int -sys_fstatfs64(struct tcb *tcp) +SYS_FUNC(fstatfs64) { if (entering(tcp)) printfd(tcp, tcp->u_arg[0]); @@ -199,8 +195,7 @@ sys_fstatfs64(struct tcb *tcp) #endif /* HAVE_STRUCT_STATFS64 */ #ifdef ALPHA -int -osf_statfs(struct tcb *tcp) +SYS_FUNC(osf_statfs) { if (entering(tcp)) { printpath(tcp, tcp->u_arg[0]); @@ -212,8 +207,7 @@ osf_statfs(struct tcb *tcp) return 0; } -int -osf_fstatfs(struct tcb *tcp) +SYS_FUNC(osf_fstatfs) { if (entering(tcp)) { tprintf("%lu, ", tcp->u_arg[0]); diff --git a/stream.c b/stream.c index 3ebbfb73..4d8549ba 100644 --- a/stream.c +++ b/stream.c @@ -86,8 +86,7 @@ printstrbufarg(struct tcb *tcp, long arg, int getting) tprints(", "); } -int -sys_putmsg(struct tcb *tcp) +SYS_FUNC(putmsg) { int i; @@ -103,8 +102,7 @@ sys_putmsg(struct tcb *tcp) return 0; } -int -sys_getmsg(struct tcb *tcp) +SYS_FUNC(getmsg) { int i, flags; @@ -152,8 +150,7 @@ sys_getmsg(struct tcb *tcp) # if defined SYS_putpmsg || defined SYS_getpmsg #include "xlat/pmsgflags.h" # ifdef SYS_putpmsg -int -sys_putpmsg(struct tcb *tcp) +SYS_FUNC(putpmsg) { int i; @@ -172,8 +169,7 @@ sys_putpmsg(struct tcb *tcp) } # endif # ifdef SYS_getpmsg -int -sys_getpmsg(struct tcb *tcp) +SYS_FUNC(getpmsg) { int i, flags; @@ -363,8 +359,7 @@ decode_poll(struct tcb *tcp, long pts) } } -int -sys_poll(struct tcb *tcp) +SYS_FUNC(poll) { int rc = decode_poll(tcp, 0); if (entering(tcp)) { @@ -378,8 +373,7 @@ sys_poll(struct tcb *tcp) return rc; } -int -sys_ppoll(struct tcb *tcp) +SYS_FUNC(ppoll) { int rc = decode_poll(tcp, tcp->u_arg[2]); if (entering(tcp)) { @@ -393,8 +387,7 @@ sys_ppoll(struct tcb *tcp) } #else /* !HAVE_SYS_POLL_H */ -int -sys_poll(struct tcb *tcp) +SYS_FUNC(poll) { return 0; } diff --git a/swapon.c b/swapon.c index 8200a9b5..4006d962 100644 --- a/swapon.c +++ b/swapon.c @@ -17,8 +17,7 @@ #include "xlat/swap_flags.h" -int -sys_swapon(struct tcb *tcp) +SYS_FUNC(swapon) { if (entering(tcp)) { int flags = tcp->u_arg[1]; diff --git a/sync_file_range.c b/sync_file_range.c index 4b1977b7..5264f15c 100644 --- a/sync_file_range.c +++ b/sync_file_range.c @@ -4,8 +4,7 @@ #include "xlat/sync_file_range_flags.h" -int -sys_sync_file_range(struct tcb *tcp) +SYS_FUNC(sync_file_range) { if (entering(tcp)) { int argn; @@ -18,8 +17,7 @@ sys_sync_file_range(struct tcb *tcp) return 0; } -int -sys_sync_file_range2(struct tcb *tcp) +SYS_FUNC(sync_file_range2) { if (entering(tcp)) { int argn; diff --git a/sysctl.c b/sysctl.c index a550edae..03d7b1c8 100644 --- a/sysctl.c +++ b/sysctl.c @@ -14,8 +14,7 @@ #include "xlat/sysctl_net_ipv6.h" #include "xlat/sysctl_net_ipv6_route.h" -int -sys_sysctl(struct tcb *tcp) +SYS_FUNC(sysctl) { struct __sysctl_args info; int *name; diff --git a/sysinfo.c b/sysinfo.c index 21a62465..6f22165f 100644 --- a/sysinfo.c +++ b/sysinfo.c @@ -1,8 +1,7 @@ #include "defs.h" #include -int -sys_sysinfo(struct tcb *tcp) +SYS_FUNC(sysinfo) { struct sysinfo si; diff --git a/syslog.c b/syslog.c index 6e4b1ba1..6071ed68 100644 --- a/syslog.c +++ b/syslog.c @@ -16,8 +16,7 @@ enum { #include "xlat/syslog_action_type.h" -int -sys_syslog(struct tcb *tcp) +SYS_FUNC(syslog) { int type = tcp->u_arg[0]; diff --git a/sysmips.c b/sysmips.c index 6728b8a7..d7d5455e 100644 --- a/sysmips.c +++ b/sysmips.c @@ -15,7 +15,7 @@ #include "xlat/sysmips_operations.h" -int sys_sysmips(struct tcb *tcp) +SYS_FUNC(sysmips) { if (entering(tcp)) { printxval(sysmips_operations, tcp->u_arg[0], "???"); diff --git a/time.c b/time.c index 6db35635..b30fd0f2 100644 --- a/time.c +++ b/time.c @@ -158,8 +158,7 @@ sprint_timespec(char *buf, struct tcb *tcp, long addr) } } -int -sys_time(struct tcb *tcp) +SYS_FUNC(time) { if (exiting(tcp)) { printnum_long(tcp, tcp->u_arg[0], "%ld"); @@ -167,8 +166,7 @@ sys_time(struct tcb *tcp) return 0; } -int -sys_gettimeofday(struct tcb *tcp) +SYS_FUNC(gettimeofday) { if (exiting(tcp)) { if (syserror(tcp)) { @@ -183,8 +181,7 @@ sys_gettimeofday(struct tcb *tcp) } #ifdef ALPHA -int -sys_osf_gettimeofday(struct tcb *tcp) +SYS_FUNC(osf_gettimeofday) { if (exiting(tcp)) { if (syserror(tcp)) { @@ -199,8 +196,7 @@ sys_osf_gettimeofday(struct tcb *tcp) } #endif -int -sys_settimeofday(struct tcb *tcp) +SYS_FUNC(settimeofday) { if (entering(tcp)) { printtv(tcp, tcp->u_arg[0]); @@ -211,8 +207,7 @@ sys_settimeofday(struct tcb *tcp) } #ifdef ALPHA -int -sys_osf_settimeofday(struct tcb *tcp) +SYS_FUNC(osf_settimeofday) { if (entering(tcp)) { printtv_bitness(tcp, tcp->u_arg[0], BITNESS_32, 0); @@ -223,8 +218,7 @@ sys_osf_settimeofday(struct tcb *tcp) } #endif -int -sys_adjtime(struct tcb *tcp) +SYS_FUNC(adjtime) { if (entering(tcp)) { printtv(tcp, tcp->u_arg[0]); @@ -238,8 +232,7 @@ sys_adjtime(struct tcb *tcp) return 0; } -int -sys_nanosleep(struct tcb *tcp) +SYS_FUNC(nanosleep) { if (entering(tcp)) { print_timespec(tcp, tcp->u_arg[0]); @@ -314,8 +307,7 @@ printitv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness) #define printitv(tcp, addr) \ printitv_bitness((tcp), (addr), BITNESS_CURRENT) -int -sys_getitimer(struct tcb *tcp) +SYS_FUNC(getitimer) { if (entering(tcp)) { printxval(itimer_which, tcp->u_arg[0], "ITIMER_???"); @@ -330,8 +322,7 @@ sys_getitimer(struct tcb *tcp) } #ifdef ALPHA -int -sys_osf_getitimer(struct tcb *tcp) +SYS_FUNC(osf_getitimer) { if (entering(tcp)) { printxval(itimer_which, tcp->u_arg[0], "ITIMER_???"); @@ -346,8 +337,7 @@ sys_osf_getitimer(struct tcb *tcp) } #endif -int -sys_setitimer(struct tcb *tcp) +SYS_FUNC(setitimer) { if (entering(tcp)) { printxval(itimer_which, tcp->u_arg[0], "ITIMER_???"); @@ -364,8 +354,7 @@ sys_setitimer(struct tcb *tcp) } #ifdef ALPHA -int -sys_osf_setitimer(struct tcb *tcp) +SYS_FUNC(osf_setitimer) { if (entering(tcp)) { printxval(itimer_which, tcp->u_arg[0], "ITIMER_???"); @@ -496,8 +485,7 @@ do_adjtimex(struct tcb *tcp, long addr) return 0; } -int -sys_adjtimex(struct tcb *tcp) +SYS_FUNC(adjtimex) { if (exiting(tcp)) return do_adjtimex(tcp, tcp->u_arg[0]); @@ -530,8 +518,7 @@ printclockname(int clockid) printxval(clocknames, clockid, "CLOCK_???"); } -int -sys_clock_settime(struct tcb *tcp) +SYS_FUNC(clock_settime) { if (entering(tcp)) { printclockname(tcp->u_arg[0]); @@ -541,8 +528,7 @@ sys_clock_settime(struct tcb *tcp) return 0; } -int -sys_clock_gettime(struct tcb *tcp) +SYS_FUNC(clock_gettime) { if (entering(tcp)) { printclockname(tcp->u_arg[0]); @@ -556,8 +542,7 @@ sys_clock_gettime(struct tcb *tcp) return 0; } -int -sys_clock_nanosleep(struct tcb *tcp) +SYS_FUNC(clock_nanosleep) { if (entering(tcp)) { printclockname(tcp->u_arg[0]); @@ -575,8 +560,7 @@ sys_clock_nanosleep(struct tcb *tcp) return 0; } -int -sys_clock_adjtime(struct tcb *tcp) +SYS_FUNC(clock_adjtime) { if (exiting(tcp)) return do_adjtimex(tcp, tcp->u_arg[1]); @@ -672,8 +656,7 @@ printsigevent(struct tcb *tcp, long arg) } } -int -sys_timer_create(struct tcb *tcp) +SYS_FUNC(timer_create) { if (entering(tcp)) { printclockname(tcp->u_arg[0]); @@ -691,8 +674,7 @@ sys_timer_create(struct tcb *tcp) return 0; } -int -sys_timer_settime(struct tcb *tcp) +SYS_FUNC(timer_settime) { if (entering(tcp)) { tprintf("%#lx, ", tcp->u_arg[0]); @@ -709,8 +691,7 @@ sys_timer_settime(struct tcb *tcp) return 0; } -int -sys_timer_gettime(struct tcb *tcp) +SYS_FUNC(timer_gettime) { if (entering(tcp)) { tprintf("%#lx, ", tcp->u_arg[0]); @@ -811,8 +792,7 @@ rtc_ioctl(struct tcb *tcp, const unsigned int code, long arg) #include "xlat/timerfdflags.h" -int -sys_timerfd(struct tcb *tcp) +SYS_FUNC(timerfd) { if (entering(tcp)) { /* It does not matter that the kernel uses itimerspec. */ @@ -826,8 +806,7 @@ sys_timerfd(struct tcb *tcp) return 0; } -int -sys_timerfd_create(struct tcb *tcp) +SYS_FUNC(timerfd_create) { if (entering(tcp)) { printclockname(tcp->u_arg[0]); @@ -837,8 +816,7 @@ sys_timerfd_create(struct tcb *tcp) return 0; } -int -sys_timerfd_settime(struct tcb *tcp) +SYS_FUNC(timerfd_settime) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -852,8 +830,7 @@ sys_timerfd_settime(struct tcb *tcp) return 0; } -int -sys_timerfd_gettime(struct tcb *tcp) +SYS_FUNC(timerfd_gettime) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); diff --git a/truncate.c b/truncate.c index fd1a0db4..e7e9968d 100644 --- a/truncate.c +++ b/truncate.c @@ -1,7 +1,6 @@ #include "defs.h" -int -sys_truncate(struct tcb *tcp) +SYS_FUNC(truncate) { if (entering(tcp)) { printpath(tcp, tcp->u_arg[0]); @@ -10,8 +9,7 @@ sys_truncate(struct tcb *tcp) return 0; } -int -sys_truncate64(struct tcb *tcp) +SYS_FUNC(truncate64) { if (entering(tcp)) { printpath(tcp, tcp->u_arg[0]); @@ -20,8 +18,7 @@ sys_truncate64(struct tcb *tcp) return 0; } -int -sys_ftruncate(struct tcb *tcp) +SYS_FUNC(ftruncate) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -30,8 +27,7 @@ sys_ftruncate(struct tcb *tcp) return 0; } -int -sys_ftruncate64(struct tcb *tcp) +SYS_FUNC(ftruncate64) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); diff --git a/uid.c b/uid.c index 96b3d38f..02cd699a 100644 --- a/uid.c +++ b/uid.c @@ -37,16 +37,14 @@ # define uid_t_(size) uid_t__(size) # define uid_t__(size) uint ## size ## _t -int -sys_getuid(struct tcb *tcp) +SYS_FUNC(getuid) { if (exiting(tcp)) tcp->u_rval = (uid_t) tcp->u_rval; return RVAL_UDECIMAL; } -int -sys_setfsuid(struct tcb *tcp) +SYS_FUNC(setfsuid) { if (entering(tcp)) tprintf("%u", (uid_t) tcp->u_arg[0]); @@ -55,8 +53,7 @@ sys_setfsuid(struct tcb *tcp) return RVAL_UDECIMAL; } -int -sys_setuid(struct tcb *tcp) +SYS_FUNC(setuid) { if (entering(tcp)) { tprintf("%u", (uid_t) tcp->u_arg[0]); @@ -75,8 +72,7 @@ get_print_uid(struct tcb *tcp, const char *prefix, const long addr) tprintf("%s[%u]", prefix, uid); } -int -sys_getresuid(struct tcb *tcp) +SYS_FUNC(getresuid) { if (exiting(tcp)) { if (syserror(tcp)) { @@ -91,8 +87,7 @@ sys_getresuid(struct tcb *tcp) return 0; } -int -sys_setreuid(struct tcb *tcp) +SYS_FUNC(setreuid) { if (entering(tcp)) { printuid("", tcp->u_arg[0]); @@ -101,8 +96,7 @@ sys_setreuid(struct tcb *tcp) return 0; } -int -sys_setresuid(struct tcb *tcp) +SYS_FUNC(setresuid) { if (entering(tcp)) { printuid("", tcp->u_arg[0]); @@ -112,8 +106,7 @@ sys_setresuid(struct tcb *tcp) return 0; } -int -sys_chown(struct tcb *tcp) +SYS_FUNC(chown) { if (entering(tcp)) { printpath(tcp, tcp->u_arg[0]); @@ -123,8 +116,7 @@ sys_chown(struct tcb *tcp) return 0; } -int -sys_fchown(struct tcb *tcp) +SYS_FUNC(fchown) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -143,8 +135,7 @@ printuid(const char *text, const unsigned int uid) tprintf("%s%u", text, uid); } -int -sys_setgroups(struct tcb *tcp) +SYS_FUNC(setgroups) { if (entering(tcp)) { unsigned long len, size, start, cur, end, abbrev_end; @@ -197,8 +188,7 @@ sys_setgroups(struct tcb *tcp) return 0; } -int -sys_getgroups(struct tcb *tcp) +SYS_FUNC(getgroups) { unsigned long len; diff --git a/umask.c b/umask.c index cc00cc6a..9b503855 100644 --- a/umask.c +++ b/umask.c @@ -1,7 +1,6 @@ #include "defs.h" -int -sys_umask(struct tcb *tcp) +SYS_FUNC(umask) { if (entering(tcp)) { tprintf("%#lo", tcp->u_arg[0]); diff --git a/umount.c b/umount.c index ca5037f5..b015f838 100644 --- a/umount.c +++ b/umount.c @@ -6,8 +6,7 @@ #include "xlat/umount_flags.h" -int -sys_umount2(struct tcb *tcp) +SYS_FUNC(umount2) { if (entering(tcp)) { printstr(tcp, tcp->u_arg[0], -1); diff --git a/uname.c b/uname.c index 74f8efbc..0f699d86 100644 --- a/uname.c +++ b/uname.c @@ -2,8 +2,7 @@ #include -int -sys_uname(struct tcb *tcp) +SYS_FUNC(uname) { struct utsname uname; diff --git a/utime.c b/utime.c index ba253567..af286a43 100644 --- a/utime.c +++ b/utime.c @@ -1,7 +1,6 @@ #include "defs.h" -int -sys_utime(struct tcb *tcp) +SYS_FUNC(utime) { union { long utl[2]; diff --git a/utimes.c b/utimes.c index 40f9566f..41fc529f 100644 --- a/utimes.c +++ b/utimes.c @@ -22,22 +22,19 @@ decode_utimes(struct tcb *tcp, int offset, int special) return 0; } -int -sys_utimes(struct tcb *tcp) +SYS_FUNC(utimes) { return decode_utimes(tcp, 0, 0); } -int -sys_futimesat(struct tcb *tcp) +SYS_FUNC(futimesat) { if (entering(tcp)) print_dirfd(tcp, tcp->u_arg[0]); return decode_utimes(tcp, 1, 0); } -int -sys_utimensat(struct tcb *tcp) +SYS_FUNC(utimensat) { if (entering(tcp)) { print_dirfd(tcp, tcp->u_arg[0]); @@ -49,8 +46,7 @@ sys_utimensat(struct tcb *tcp) } #ifdef ALPHA -int -sys_osf_utimes(struct tcb *tcp) +SYS_FUNC(osf_utimes) { if (entering(tcp)) { printpath(tcp, tcp->u_arg[0]); diff --git a/wait.c b/wait.c index 08e33976..d2eb36d1 100644 --- a/wait.c +++ b/wait.c @@ -139,21 +139,18 @@ printwaitn(struct tcb *tcp, int n, int bitness) return 0; } -int -sys_waitpid(struct tcb *tcp) +SYS_FUNC(waitpid) { return printwaitn(tcp, 3, 0); } -int -sys_wait4(struct tcb *tcp) +SYS_FUNC(wait4) { return printwaitn(tcp, 4, 0); } #ifdef ALPHA -int -sys_osf_wait4(struct tcb *tcp) +SYS_FUNC(osf_wait4) { return printwaitn(tcp, 4, 1); } @@ -161,8 +158,7 @@ sys_osf_wait4(struct tcb *tcp) #include "xlat/waitid_types.h" -int -sys_waitid(struct tcb *tcp) +SYS_FUNC(waitid) { if (entering(tcp)) { printxval(waitid_types, tcp->u_arg[0], "P_???"); diff --git a/xattr.c b/xattr.c index 60419e92..3b05d38d 100644 --- a/xattr.c +++ b/xattr.c @@ -54,8 +54,7 @@ failed: tprintf(", 0x%lx, %ld", arg, insize); } -int -sys_setxattr(struct tcb *tcp) +SYS_FUNC(setxattr) { if (entering(tcp)) { printpath(tcp, tcp->u_arg[0]); @@ -68,8 +67,7 @@ sys_setxattr(struct tcb *tcp) return 0; } -int -sys_fsetxattr(struct tcb *tcp) +SYS_FUNC(fsetxattr) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -82,8 +80,7 @@ sys_fsetxattr(struct tcb *tcp) return 0; } -int -sys_getxattr(struct tcb *tcp) +SYS_FUNC(getxattr) { if (entering(tcp)) { printpath(tcp, tcp->u_arg[0]); @@ -96,8 +93,7 @@ sys_getxattr(struct tcb *tcp) return 0; } -int -sys_fgetxattr(struct tcb *tcp) +SYS_FUNC(fgetxattr) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -128,8 +124,7 @@ print_xattr_list(struct tcb *tcp, unsigned long addr, unsigned long size) tprintf(", %lu", size); } -int -sys_listxattr(struct tcb *tcp) +SYS_FUNC(listxattr) { if (entering(tcp)) { printpath(tcp, tcp->u_arg[0]); @@ -140,8 +135,7 @@ sys_listxattr(struct tcb *tcp) return 0; } -int -sys_flistxattr(struct tcb *tcp) +SYS_FUNC(flistxattr) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); @@ -152,8 +146,7 @@ sys_flistxattr(struct tcb *tcp) return 0; } -int -sys_removexattr(struct tcb *tcp) +SYS_FUNC(removexattr) { if (entering(tcp)) { printpath(tcp, tcp->u_arg[0]); @@ -163,8 +156,7 @@ sys_removexattr(struct tcb *tcp) return 0; } -int -sys_fremovexattr(struct tcb *tcp) +SYS_FUNC(fremovexattr) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); -- 2.40.0