]> granicus.if.org Git - strace/commitdiff
Declare syscall parsers using SYS_FUNC macro
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 7 Apr 2015 01:36:50 +0000 (01:36 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 7 Apr 2015 11:22:49 +0000 (11:22 +0000)
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.

78 files changed:
Makefile.am
access.c
affinity.c
aio.c
bjm.c
cacheflush.c
capability.c
chdir.c
chmod.c
clone.c
defs.h
desc.c
dirent.c
execve.c
exit.c
fadvise.c
fallocate.c
fanotify.c
fchownat.c
file.c
futex.c
get_robust_list.c
getcpu.c
getcwd.c
getrandom.c
hostname.c
inotify.c
io.c
ioprio.c
ipc.c
kexec.c
keyctl.c
ldt.c
link.c
linux/alpha/syscallent.h
linux/syscall.h
lseek.c
mem.c
mknod.c
mount.c
net.c
open.c
or1k_atomic.c
personality.c
prctl.c
process.c
process_vm.c
quota.c
readahead.c
readlink.c
reboot.c
renameat.c
resource.c
sched.c
seccomp.c
sigaltstack.c
signal.c
sigreturn.c
sock.c
sram_alloc.c
statfs.c
stream.c
swapon.c
sync_file_range.c
sysctl.c
sysinfo.c
syslog.c
sysmips.c
time.c
truncate.c
uid.c
umask.c
umount.c
uname.c
utime.c
utimes.c
wait.c
xattr.c

index 8193c9e17bae6f7b041a8fb537d251a85464cb63..549aebc4e3c1a9743060cf8452eda174c9bd2bb8 100644 (file)
@@ -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%
        ./$< > $@
index f28f69d78d290ef63a008692f9dec31dda7a766f..dd0d749d6b4b429edb475fb76d32e5e2f7d2f04f 100644 (file)
--- 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]);
index 97d8b3e2b0971aea4156d2512097fdcc35024613..286e15c7a55c28b3d6650e08fe671e715c07fd46 100644 (file)
@@ -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 18e53013f208c5373496299e375e7f11dc13fd26..7d8fb65041830497f4c80ba0b844165deadedad1 100644 (file)
--- 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 c8d72a3090311ffc6ece580360bfad3f21e95698..435d6bbf2549f7b78629b35ab49cca77f07fa24a 100644 (file)
--- 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;
index bfbf58388ab762dee04d93b6476f41dfc67cea3b..727d49bc8280073258db69ebce28ff36bac3b169 100644 (file)
@@ -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 */
index 26d9c66aaad55c0a71ca18b4e35bd2683ffe797d..d18d7264d3b19444bc46de4a78a2c2642e58faa4 100644 (file)
@@ -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 29f0afc3a3a9fb260b94ae2c526302f3f3ba7a10..a91d366ceabd400f2bc44026187cda7b47c30553 100644 (file)
--- 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 89453a98fdb6cea7cf538454fa9c070e14074886..21ce11549f86a18a6938936d6cab31817aae29fe 100644 (file)
--- 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 a0a70964c13c96bfb11edbbb2e63090ec67b4a08..6c2d196bbe4664282e27cf209b59f5cf9d6a5d56 100644 (file)
--- 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 34f1603b816271342b159c9cba5292a2227bf7c2..77c819c62a5997b59737525e45e7449bea5f2b16 100644 (file)
--- 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 485c802b9d344972d886b4322ddee45392b7aeb1..1b9dd1a5fb9a7c50d24321aaf0c27844b1735d18 100644 (file)
--- 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, ",
index d30e0d2af7f133f1e4464fe92b2e41935d277ae6..32f04b9e965ac748583ee0b4090f0f888e996ab4 100644 (file)
--- 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);
index 31e80a696e5f811d097f31a779e2ba5f54ad0e60..4f2639d23aea6bc4766764174d9ad3c65a4ebb04 100644 (file)
--- 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 0e0c2ea2059e3377f2501e713147fee599cb0916..d23e528004a204083d25d14a5d1e2e190439c0ca 100644 (file)
--- 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");
index 850a4250d48c5d80602f6055d2eaea983a3a177f..088f85754718663364407053a2d8114bf35fa012 100644 (file)
--- 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;
index 990106d2288649a0979fda44b65e7a613d9eb028..c096c9823d07b75e955323d1d1742c2cde29a58e 100644 (file)
@@ -6,8 +6,7 @@
 
 #include "xlat/falloc_flags.h"
 
-int
-sys_fallocate(struct tcb *tcp)
+SYS_FUNC(fallocate)
 {
        if (entering(tcp)) {
                int argn;
index 63816b8d3e9a5b15fd09e468b87f73d91f7c223f..8ceca0e47db870e4102ee754906b658e88e020cb 100644 (file)
@@ -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;
index 95de6e4af92e6d9ab0bbb58460d2ceecc6827e02..743b57474fa9f9f1578108b884eaa563e98c6758 100644 (file)
@@ -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 9dc75950215baf0414ad32d9450b56bc5f05d966..8e1952fc253913368c756b6e10328da411e4afc4 100644 (file)
--- 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 a1781c0e97bdf9f078f8a3cde0098bc16128fd88..f59587cdbc8790d059df673f3346df04e3ba41cf 100644 (file)
--- 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;
index 1b667cab81193c9a154703e16612398b4644430b..d9e0f1aaec9d46abf8425b345d77008139f5e3b6 100644 (file)
@@ -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]);
index 522786fd33614e94c5d71f2e9bd968a8f3ee8fbd..47af7950cb69c9e3b05ff4502da179df766361a4 100644 (file)
--- 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;
index 1b97448514a565613af7a2bdd427170b753e0f23..66af8345c9c21a669d917e1022a26de373fdfdbd 100644 (file)
--- 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))
index 068b2e6e49b360436a5c2e5878152a03b0badf51..b67916d9990f109cda06ea2687895c59eecb167d 100644 (file)
@@ -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))
index d2e0471b7eb479190605118b6382179359bfea28..c497dc5ae9079a9ac87f841581ecd654cef0c385 100644 (file)
@@ -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))
index 81c8c5d832b3e59bb90265f9d34bec85e6a2dc23..34902b8af95944e7aa3dbc7d9327f6b13c653a6d 100644 (file)
--- 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 06185096219b736101350b082fc684c4faca51a1..30ed5781a71cc56bd1ddafe5de039ae86a117203 100644 (file)
--- a/io.c
+++ b/io.c
@@ -32,8 +32,7 @@
 #include <fcntl.h>
 #include <sys/uio.h>
 
-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;
 
index 6826e56d62030c3d6feaa840c92c23f768e5ed4b..20866dcc3f3e6e1a2be2153ebe83d3a277b95648 100644 (file)
--- 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 a94f572c9f393e1165f0bc800baeea2c1fe92721..f2c064b2090c99cf38da972880c133f4acb0d195 100644 (file)
--- 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 6bec51c9837581d60f3b73cc32c094346840f90e..781280a6702e4a4a2b4ed23c3a4edcc41aa0da51 100644 (file)
--- 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;
 
index e77557e96794bf2ffeada2e1d128750e93403cba..0447745e68b62dd9ddd5669a529d681d71193aa9 100644 (file)
--- 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 0376d2b7d896ed37466d0bc848e73ac229941e7b..dbe49d92ff5d804451411b510006cdf0d73da08d 100644 (file)
--- 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 2f5298f8186fbe4f098f52034444bcf4fee4c7e5..74ff5142227c5c8e080bdbfdf7ace95b3fd22e7d 100644 (file)
--- 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]);
index 5b17165b00dd79af27d1424f4e1ad6c7798de0b7..7a25b44c67cdbb3e98aa416c74a0bd8aa7c555d0 100644 (file)
 [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 */
index dbf2d20f07ace0d5a38620736d510b54f7b0e8bd..bd706019c6da57b47dd56cb2f46da8e72251e6bb 100644 (file)
  */
 
 #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 7a0a501e8a288b8501b2622dd99a7a9c80b2047d..74441edb0b5118327a879071a9ed02e6943071b1 100644 (file)
--- 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 408265877b42ffd619a9c1de681bce85c140e5f3..322b7eb76b5f0cb71ac16b6a7a76813ca5412d51 100644 (file)
--- 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 1463232cbc677e2b4e92fb6080383322fe28ed1f..dbca736d800262579cad3a43f3ee45028212e936 100644 (file)
--- 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 f6c8f758be518b072f7814744c6162c1e4d6dae7..7b30b3715ec212ef013b124ce6facf9660dcf38e 100644 (file)
--- 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 58c54c875b867a5ea50a060e5b3dbdf5a1847a44..2ed950de316eec5a2506260862b48b67ce209d39 100644 (file)
--- 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 5d82981fa63b9341962914efb48bd297b9e2f882..4a70d89c780d14b002960f853d35f8c8c2b26ea2 100644 (file)
--- 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]);
index 1b60272cc1a09be59169712a09315332fd067351..05509a778e51bcaa3f9841cb1e15d452577f6fe3 100644 (file)
@@ -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], "???");
index a90d7dd7290299567b123bb6d98775b4288e6a36..98b8bba11dd8811feabfd1722bebc74ddc0afdd4 100644 (file)
@@ -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 0ec0fc8812cd7816463b7cc8affb9e59477e7508..4a6bd253f91caf627a7849ff3330121d63c53503 100644 (file)
--- 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 <asm/prctl.h>
 # 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_???");
index 690ca8effb0706e41c82f54495d53245aa2b5a3e..73092a22c216ff95893218aa6907ac88fce68842 100644 (file)
--- 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;
index 02058a5db6254011a2aca92d5013a6e5ea42d6c3..310223ebf36c55baaca38b184d0cf3fc470c705c 100644 (file)
@@ -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 f9a1bc57cac31af9cb63e14df02ec24698d8adeb..fd0ae0295d4db28b9b8c79029d3dcf6342d3df86 100644 (file)
--- 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
index 8f47988d8d0534ab10c4fe54582c3bdf57fec2d1..a34b60d9f20dfa7c46ca69e64c95e0e4d98c5f56 100644 (file)
@@ -1,7 +1,6 @@
 #include "defs.h"
 
-int
-sys_readahead(struct tcb *tcp)
+SYS_FUNC(readahead)
 {
        if (entering(tcp)) {
                int argn;
index efa8e9f8bb88ff23e6ad38133b938ce132ea7484..fcb415334c7e93bc0e2acc5c7171fb553a53637e 100644 (file)
@@ -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]);
index 5c4752d9441307cad98bae04bad38baf824fc886..2d118510df55a319abc7ccbe987e32dd25f9bc36 100644 (file)
--- 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;
index 1c0255144d3dc002ce4a9e2a43d742686ee09fcf..ac8d2023848619ae07d272c5f4cd7779eb282c6f 100644 (file)
@@ -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 <linux/fs.h>
 #include "xlat/rename_flags.h"
 
-int
-sys_renameat2(struct tcb *tcp)
+SYS_FUNC(renameat2)
 {
        if (entering(tcp)) {
                decode_renameat(tcp);
index 57ce17e0023f88ec009b44e9f8106e87961887d1..687f8d8861642f2b309555d1024dad88a77fa8f1 100644 (file)
@@ -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 d3192fa2161619878a405f6dea265e27b07a0c56..8bb7c253eb8d3401c592166b8f8d2f9ec97815b2 100644 (file)
--- 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]);
index 9939c117aa02031e11541fd1586b635f948e666f..09c6bbaf2c56b02d3cdb49ea256e0f313a9cc4bd 100644 (file)
--- 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];
index feba59b20017ba8600314dae38755ae297616dea..b3b834f16a6ea041b4fc1bb33ab4054a24e0bfce 100644 (file)
@@ -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]);
index 0b52ddb61d24160248ffae4bf6f224e88d61b38b..c9e7518f92f28efacac3c17962a74593f356846b 100644 (file)
--- 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);
 }
index b3fc038ba2d58e146f14323f75907d751e7c6974..3909d1d1b0dcc0a15515458d699194c5e868e243 100644 (file)
@@ -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 dc8febc11d8c6cf40d1c7d713967d9d3b1d62a95..48bf74b536b4741ca6d3c1eeb68bb7cb1b1309b7 100644 (file)
--- 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);
 }
index b524c7b25144169096ae6f0150ee0bbbc77aa8fc..a27941abdb226317606091f1defbf98b84785f07 100644 (file)
@@ -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 */
index 6373195d2edb3356b3fec84241f64d4cf9d43066..3845c2a7c9b877d80c740148e9d677947411b2c4 100644 (file)
--- 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]);
index 3ebbfb731755bbca79351360ef1a17491fbfdb4e..4d8549ba59924a40b1b3f978429bda67ab1dfb7d 100644 (file)
--- 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;
 }
index 8200a9b5d00588896309dd4af2354c3dcf050183..4006d9629b5132a471b4faae0d4cb7185e4d1f6c 100644 (file)
--- 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];
index 4b1977b71a66ba267504d694f6edfe3d075707aa..5264f15c814acd29947d4a8cebf45430a126ff5b 100644 (file)
@@ -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;
index a550edae876f1bf65358383b510fe5b5cc7cdbca..03d7b1c89906138dbbd54d26e3fe0722fab53fcf 100644 (file)
--- 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;
index 21a62465bb5d1f037e999547a8a9eeefad3a9a62..6f22165f66d296c552a3386a868989304bc2a133 100644 (file)
--- a/sysinfo.c
+++ b/sysinfo.c
@@ -1,8 +1,7 @@
 #include "defs.h"
 #include <sys/sysinfo.h>
 
-int
-sys_sysinfo(struct tcb *tcp)
+SYS_FUNC(sysinfo)
 {
        struct sysinfo si;
 
index 6e4b1ba125e9a106082ca953dfa2c7dccf4fa5e5..6071ed68433c8ba5e28ac411b3654718f1badfbc 100644 (file)
--- 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];
 
index 6728b8a73574ce6ef9b9e0cc901ad8df2158d3bf..d7d5455e1dcb11bdb489b5a2ee33f674d0ce5410 100644 (file)
--- 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 6db35635df637f77610244d061d508f947324abd..b30fd0f2a93d133e9189fb47d571fdf1f417ffc8 100644 (file)
--- 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]);
index fd1a0db40911084d72773858d4ade4c2b9430d98..e7e9968de520aa393be62e68b786d59e66e76602 100644 (file)
@@ -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 96b3d38f5e86307cbd4789d71564e685d5a0c285..02cd699a8aca55420a36a6e3776d84e68c35d6d0 100644 (file)
--- a/uid.c
+++ b/uid.c
 # 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 cc00cc6a03c9d5f7bfdcb2e01569aa0783f0a215..9b50385506b8fd7a27a033f2d01e2d23d2ec0bbc 100644 (file)
--- 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]);
index ca5037f53e6184a43360f4785172f63f8d0c7f20..b015f83871feba3bcea6c7e3f3e2d76e717c9ab0 100644 (file)
--- 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 74f8efbc06d6e8b3d769c86983d34109b07878f2..0f699d863fdc1ccb142c9713c16bfbf71096719c 100644 (file)
--- a/uname.c
+++ b/uname.c
@@ -2,8 +2,7 @@
 
 #include <sys/utsname.h>
 
-int
-sys_uname(struct tcb *tcp)
+SYS_FUNC(uname)
 {
        struct utsname uname;
 
diff --git a/utime.c b/utime.c
index ba2535671ca1f8d7f06c878f79d01cc6ade41142..af286a43f40f59e8f7ea796d3bd9c4e93c6eadd0 100644 (file)
--- 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];
index 40f9566f588ae8222f40ab07bfb0047161ebcf81..41fc529fe4ef1c8fa97fd0609a5b91b6fc4c95da 100644 (file)
--- 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 08e3397693f251ea505411f484508c44ec8b9e44..d2eb36d14afb5ed36fefabccabc9a6a234738c04 100644 (file)
--- 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 60419e924407e55f7ac17fca9397f689b3ff0a98..3b05d38d3d10d7bd2546e84fde072d52c5f37944 100644 (file)
--- 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]);