blob: 6e396b05fa93994f9b6fb7702e0260af296c547c [file] [log] [blame]
Dmitry V. Levinfb470f32014-12-06 03:53:16 +00001#include "defs.h"
2
3int
4sys_utime(struct tcb *tcp)
5{
6 union {
7 long utl[2];
8 int uti[2];
9 long paranoia_for_huge_wordsize[4];
10 } u;
11 unsigned wordsize;
12
13 if (entering(tcp)) {
14 printpath(tcp, tcp->u_arg[0]);
15 tprints(", ");
16
17 wordsize = current_wordsize;
18 if (!tcp->u_arg[1])
19 tprints("NULL");
20 else if (!verbose(tcp))
21 tprintf("%#lx", tcp->u_arg[1]);
22 else if (umoven(tcp, tcp->u_arg[1], 2 * wordsize, (char *) &u) < 0)
23 tprints("[?, ?]");
24 else if (wordsize == sizeof u.utl[0]) {
25 tprintf("[%s,", sprinttime(u.utl[0]));
26 tprintf(" %s]", sprinttime(u.utl[1]));
27 }
28 else if (wordsize == sizeof u.uti[0]) {
29 tprintf("[%s,", sprinttime(u.uti[0]));
30 tprintf(" %s]", sprinttime(u.uti[1]));
31 }
32 else
33 tprintf("<decode error: unsupported wordsize %d>",
34 wordsize);
35 }
36 return 0;
37}