resource.c: move times parser to a separate file
* times.c: New file. * Makefile.am (strace_SOURCES): Add it. * resource.c (sys_times): Move to times.c.
This commit is contained in:
parent
f1bb6391ea
commit
254ff1e623
@ -121,6 +121,7 @@ strace_SOURCES = \
|
||||
sysmips.c \
|
||||
term.c \
|
||||
time.c \
|
||||
times.c \
|
||||
truncate.c \
|
||||
uid.c \
|
||||
uid16.c \
|
||||
|
18
resource.c
18
resource.c
@ -30,7 +30,6 @@
|
||||
|
||||
#include "defs.h"
|
||||
#include <sys/resource.h>
|
||||
#include <sys/times.h>
|
||||
|
||||
#include "xlat/resources.h"
|
||||
|
||||
@ -197,20 +196,3 @@ SYS_FUNC(setpriority)
|
||||
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
|
||||
SYS_FUNC(times)
|
||||
{
|
||||
struct tms tbuf;
|
||||
|
||||
if (exiting(tcp)) {
|
||||
if (!umove_or_printaddr(tcp, tcp->u_arg[0], &tbuf)) {
|
||||
tprintf("{tms_utime=%llu, tms_stime=%llu, ",
|
||||
(unsigned long long) tbuf.tms_utime,
|
||||
(unsigned long long) tbuf.tms_stime);
|
||||
tprintf("tms_cutime=%llu, tms_cstime=%llu}",
|
||||
(unsigned long long) tbuf.tms_cutime,
|
||||
(unsigned long long) tbuf.tms_cstime);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
19
times.c
Normal file
19
times.c
Normal file
@ -0,0 +1,19 @@
|
||||
#include "defs.h"
|
||||
#include <sys/times.h>
|
||||
|
||||
SYS_FUNC(times)
|
||||
{
|
||||
struct tms tbuf;
|
||||
|
||||
if (exiting(tcp)) {
|
||||
if (!umove_or_printaddr(tcp, tcp->u_arg[0], &tbuf)) {
|
||||
tprintf("{tms_utime=%llu, tms_stime=%llu, ",
|
||||
(unsigned long long) tbuf.tms_utime,
|
||||
(unsigned long long) tbuf.tms_stime);
|
||||
tprintf("tms_cutime=%llu, tms_cstime=%llu}",
|
||||
(unsigned long long) tbuf.tms_cutime,
|
||||
(unsigned long long) tbuf.tms_cstime);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user