Elvira Khabirova | 254ff1e | 2015-08-03 07:09:34 +0300 | [diff] [blame] | 1 | #include "defs.h" |
Elvira Khabirova | 6773d6d | 2015-08-03 07:26:53 +0300 | [diff] [blame] | 2 | #include DEF_MPERS_TYPE(tms_t) |
Elvira Khabirova | 254ff1e | 2015-08-03 07:09:34 +0300 | [diff] [blame] | 3 | #include <sys/times.h> |
Elvira Khabirova | 6773d6d | 2015-08-03 07:26:53 +0300 | [diff] [blame] | 4 | typedef struct tms tms_t; |
| 5 | #include MPERS_DEFS |
Elvira Khabirova | 254ff1e | 2015-08-03 07:09:34 +0300 | [diff] [blame] | 6 | |
| 7 | SYS_FUNC(times) |
| 8 | { |
Elvira Khabirova | 6773d6d | 2015-08-03 07:26:53 +0300 | [diff] [blame] | 9 | tms_t tbuf; |
Elvira Khabirova | 254ff1e | 2015-08-03 07:09:34 +0300 | [diff] [blame] | 10 | |
Dmitry V. Levin | d8ef5e7 | 2015-08-20 21:20:14 +0000 | [diff] [blame] | 11 | if (entering(tcp)) |
| 12 | return 0; |
| 13 | |
| 14 | if (!umove_or_printaddr(tcp, tcp->u_arg[0], &tbuf)) { |
| 15 | tprintf("{tms_utime=%llu, tms_stime=%llu, ", |
| 16 | (unsigned long long) tbuf.tms_utime, |
| 17 | (unsigned long long) tbuf.tms_stime); |
| 18 | tprintf("tms_cutime=%llu, tms_cstime=%llu}", |
| 19 | (unsigned long long) tbuf.tms_cutime, |
| 20 | (unsigned long long) tbuf.tms_cstime); |
Elvira Khabirova | 254ff1e | 2015-08-03 07:09:34 +0300 | [diff] [blame] | 21 | } |
Dmitry V. Levin | d8ef5e7 | 2015-08-20 21:20:14 +0000 | [diff] [blame] | 22 | |
| 23 | return syserror(tcp) ? RVAL_DECIMAL : RVAL_UDECIMAL; |
Elvira Khabirova | 254ff1e | 2015-08-03 07:09:34 +0300 | [diff] [blame] | 24 | } |