From 254ff1e6236895c5015956e6af127a2f0bf6d8b4 Mon Sep 17 00:00:00 2001 From: Elvira Khabirova Date: Mon, 3 Aug 2015 07:09:34 +0300 Subject: [PATCH] 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. --- Makefile.am | 1 + resource.c | 18 ------------------ times.c | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 times.c diff --git a/Makefile.am b/Makefile.am index ff05a250..5e9fb166 100644 --- a/Makefile.am +++ b/Makefile.am @@ -121,6 +121,7 @@ strace_SOURCES = \ sysmips.c \ term.c \ time.c \ + times.c \ truncate.c \ uid.c \ uid16.c \ diff --git a/resource.c b/resource.c index 39f2e99d..c68f0456 100644 --- a/resource.c +++ b/resource.c @@ -30,7 +30,6 @@ #include "defs.h" #include -#include #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; -} diff --git a/times.c b/times.c new file mode 100644 index 00000000..0301c9f9 --- /dev/null +++ b/times.c @@ -0,0 +1,19 @@ +#include "defs.h" +#include + +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; +} -- 2.50.1