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.
This commit is contained in:
Дмитрий Левин 2015-04-07 01:36:50 +00:00
parent cc59f14fb8
commit a0bd3749fc
78 changed files with 335 additions and 938 deletions

View 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%
./$< > $@

View File

@ -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]);

View 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]);

15
aio.c
View File

@ -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],

15
bjm.c
View File

@ -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;

View 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 */

View 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]);

View File

@ -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]);

View File

@ -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]);

12
clone.c
View File

@ -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;

6
defs.h
View File

@ -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)

57
desc.c
View File

@ -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, ",

View File

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

View File

@ -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]);

3
exit.c
View File

@ -1,7 +1,6 @@
#include "defs.h"
int
sys_exit(struct tcb *tcp)
SYS_FUNC(exit)
{
if (exiting(tcp)) {
fprintf(stderr, "_exit returned!\n");

View File

@ -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;

View File

@ -6,8 +6,7 @@
#include "xlat/falloc_flags.h"
int
sys_fallocate(struct tcb *tcp)
SYS_FUNC(fallocate)
{
if (entering(tcp)) {
int argn;

View 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;

View 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]);

33
file.c
View File

@ -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]);

View File

@ -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;

View 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]);

View File

@ -1,7 +1,6 @@
#include "defs.h"
int
sys_getcpu(struct tcb *tcp)
SYS_FUNC(getcpu)
{
if (exiting(tcp)) {
unsigned u;

View File

@ -1,7 +1,6 @@
#include "defs.h"
int
sys_getcwd(struct tcb *tcp)
SYS_FUNC(getcwd)
{
if (exiting(tcp)) {
if (syserror(tcp))

View 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))

View 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))

View File

@ -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_???");

42
io.c
View File

@ -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;

View File

@ -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 */

42
ipc.c
View File

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

View File

@ -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;

View File

@ -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];

15
ldt.c
View File

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

12
link.c
View File

@ -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]);

View File

@ -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 */

View File

@ -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

View File

@ -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]);

63
mem.c
View File

@ -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;

View File

@ -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];

View File

@ -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;

63
net.c
View File

@ -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],

9
open.c
View File

@ -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]);

View 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], "???");

View 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_???");

View File

@ -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_???");

View File

@ -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;

View 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 */

View File

@ -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

View File

@ -1,7 +1,6 @@
#include "defs.h"
int
sys_readahead(struct tcb *tcp)
SYS_FUNC(readahead)
{
if (entering(tcp)) {
int argn;

View 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]);

View File

@ -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;

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

View 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;

18
sched.c
View File

@ -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]);

View File

@ -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];

View 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]);

View File

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

View 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"

3
sock.c
View File

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

View 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 */

View File

@ -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]);

View File

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

View File

@ -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];

View 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;

View File

@ -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;

View File

@ -1,8 +1,7 @@
#include "defs.h"
#include <sys/sysinfo.h>
int
sys_sysinfo(struct tcb *tcp)
SYS_FUNC(sysinfo)
{
struct sysinfo si;

View File

@ -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];

View File

@ -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], "???");

69
time.c
View File

@ -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]);

View 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]);

30
uid.c
View File

@ -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;

View File

@ -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]);

View File

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

View File

@ -2,8 +2,7 @@
#include <sys/utsname.h>
int
sys_uname(struct tcb *tcp)
SYS_FUNC(uname)
{
struct utsname uname;

View File

@ -1,7 +1,6 @@
#include "defs.h"
int
sys_utime(struct tcb *tcp)
SYS_FUNC(utime)
{
union {
long utl[2];

View File

@ -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]);

12
wait.c
View File

@ -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_???");

24
xattr.c
View File

@ -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]);