Dmitry V. Levin | fb470f3 | 2014-12-06 03:53:16 +0000 | [diff] [blame] | 1 | #include "defs.h" |
| 2 | |
| 3 | int |
| 4 | sys_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 | } |