Dmitry V. Levin
a0bd3749fc
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.
39 lines
784 B
C
39 lines
784 B
C
#include "defs.h"
|
|
|
|
#include <sys/utsname.h>
|
|
|
|
SYS_FUNC(uname)
|
|
{
|
|
struct utsname uname;
|
|
|
|
if (entering(tcp))
|
|
return 0;
|
|
|
|
if (syserror(tcp) || !verbose(tcp))
|
|
tprintf("%#lx", tcp->u_arg[0]);
|
|
else if (umove(tcp, tcp->u_arg[0], &uname) < 0)
|
|
tprints("{...}");
|
|
else {
|
|
#define PRINT_UTS_MEMBER(prefix, member) \
|
|
tprints(prefix #member "="); \
|
|
print_quoted_string(uname.member, sizeof(uname.member), \
|
|
QUOTE_0_TERMINATED)
|
|
|
|
PRINT_UTS_MEMBER("{", sysname);
|
|
PRINT_UTS_MEMBER(", ", nodename);
|
|
if (abbrev(tcp)) {
|
|
tprints(", ...}");
|
|
return 0;
|
|
}
|
|
PRINT_UTS_MEMBER(", ", release);
|
|
PRINT_UTS_MEMBER(", ", version);
|
|
PRINT_UTS_MEMBER(", ", machine);
|
|
#ifdef HAVE_STRUCT_UTSNAME_DOMAINNAME
|
|
PRINT_UTS_MEMBER(", ", domainname);
|
|
#endif
|
|
tprints("}");
|
|
}
|
|
|
|
return 0;
|
|
}
|