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