process.c: move sethostname and gethostname parsers to a separate file
* hostname.c: New file. * Makefile.am (strace_SOURCES): Add it. * process.c (sys_sethostname, sys_gethostname): Move to hostname.c.
This commit is contained in:
parent
9175909acc
commit
03c06ea592
@ -42,6 +42,7 @@ strace_SOURCES = \
|
||||
getcpu.c \
|
||||
getcwd.c \
|
||||
groups.c \
|
||||
hostname.c \
|
||||
inotify.c \
|
||||
io.c \
|
||||
ioctl.c \
|
||||
|
26
hostname.c
Normal file
26
hostname.c
Normal file
@ -0,0 +1,26 @@
|
||||
#include "defs.h"
|
||||
|
||||
int
|
||||
sys_sethostname(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printstr(tcp, tcp->u_arg[0], tcp->u_arg[1]);
|
||||
tprintf(", %lu", tcp->u_arg[1]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(ALPHA)
|
||||
int
|
||||
sys_gethostname(struct tcb *tcp)
|
||||
{
|
||||
if (exiting(tcp)) {
|
||||
if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[0]);
|
||||
else
|
||||
printstr(tcp, tcp->u_arg[0], -1);
|
||||
tprintf(", %lu", tcp->u_arg[1]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif /* ALPHA */
|
25
process.c
25
process.c
@ -76,31 +76,6 @@
|
||||
# include <asm/rse.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
sys_sethostname(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printstr(tcp, tcp->u_arg[0], tcp->u_arg[1]);
|
||||
tprintf(", %lu", tcp->u_arg[1]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(ALPHA)
|
||||
int
|
||||
sys_gethostname(struct tcb *tcp)
|
||||
{
|
||||
if (exiting(tcp)) {
|
||||
if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[0]);
|
||||
else
|
||||
printstr(tcp, tcp->u_arg[0], -1);
|
||||
tprintf(", %lu", tcp->u_arg[1]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "xlat/ptrace_cmds.h"
|
||||
#include "xlat/ptrace_setoptions_flags.h"
|
||||
#include "xlat/nt_descriptor_types.h"
|
||||
|
Loading…
Reference in New Issue
Block a user