strace/times.c
Dmitry V. Levin bb509aafb6 mips n32, x32: fix printing of times syscall return value
As times syscall returns kernel's long value, it has to be printed as
RVAL_LUDECIMAL on systems where long type is less than kernel's long.

* times.c (SYS_FUNC(times)) [RVAL_LUDECIMAL && !IN_MPERS]:
Return RVAL_LUDECIMAL instead of RVAL_UDECIMAL.
2015-12-06 07:24:16 +00:00

30 lines
652 B
C

#include "defs.h"
#include DEF_MPERS_TYPE(tms_t)
#include <sys/times.h>
typedef struct tms tms_t;
#include MPERS_DEFS
SYS_FUNC(times)
{
tms_t tbuf;
if (entering(tcp))
return 0;
if (!umove_or_printaddr(tcp, tcp->u_arg[0], &tbuf)) {
tprintf("{tms_utime=%Lu, tms_stime=%Lu, ",
(unsigned long long) tbuf.tms_utime,
(unsigned long long) tbuf.tms_stime);
tprintf("tms_cutime=%Lu, tms_cstime=%Lu}",
(unsigned long long) tbuf.tms_cutime,
(unsigned long long) tbuf.tms_cstime);
}
return syserror(tcp) ? RVAL_DECIMAL :
#if defined(RVAL_LUDECIMAL) && !defined(IN_MPERS)
RVAL_LUDECIMAL;
#else
RVAL_UDECIMAL;
#endif
}