1 /*
2 * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
3 * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
4 * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
5 * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
6 * Copyright (c) 2012 H.J. Lu <hongjiu.lu@intel.com>
7 * Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
8 * Copyright (c) 2015 Dmitry V. Levin <ldv@strace.io>
9 * Copyright (c) 2015-2021 The strace developers.
10 * All rights reserved.
11 *
12 * SPDX-License-Identifier: LGPL-2.1-or-later
13 */
14
15 #include "defs.h"
16 #include DEF_MPERS_TYPE(tms_t)
17 #include <sys/times.h>
18 typedef struct tms tms_t;
19 #include MPERS_DEFS
20
21 SYS_FUNC(times)
22 {
23 tms_t tbuf;
24
25 if (exiting(tcp) && !umove_or_printaddr(tcp, tcp->u_arg[0], &tbuf)) {
26 tprint_struct_begin();
27 PRINT_FIELD_CLOCK_T(tbuf, tms_utime);
28 tprint_struct_next();
29 PRINT_FIELD_CLOCK_T(tbuf, tms_stime);
30 tprint_struct_next();
31 PRINT_FIELD_CLOCK_T(tbuf, tms_cutime);
32 tprint_struct_next();
33 PRINT_FIELD_CLOCK_T(tbuf, tms_cstime);
34 tprint_struct_end();
35 }
36
37 return 0;
38 }