]> granicus.if.org Git - strace/blob - utimes.c
net: factor out interface index printing code
[strace] / utimes.c
1 #include "defs.h"
2
3 static int
4 decode_utimes(struct tcb *tcp, int offset, int special)
5 {
6         if (entering(tcp)) {
7                 printpath(tcp, tcp->u_arg[offset]);
8                 tprints(", ");
9                 if (tcp->u_arg[offset + 1] == 0)
10                         tprints("NULL");
11                 else {
12                         tprints("{");
13                         printtv_bitness(tcp, tcp->u_arg[offset + 1],
14                                         BITNESS_CURRENT, special);
15                         tprints(", ");
16                         printtv_bitness(tcp, tcp->u_arg[offset + 1]
17                                         + sizeof(struct timeval),
18                                         BITNESS_CURRENT, special);
19                         tprints("}");
20                 }
21         }
22         return 0;
23 }
24
25 SYS_FUNC(utimes)
26 {
27         return decode_utimes(tcp, 0, 0);
28 }
29
30 SYS_FUNC(futimesat)
31 {
32         if (entering(tcp))
33                 print_dirfd(tcp, tcp->u_arg[0]);
34         return decode_utimes(tcp, 1, 0);
35 }
36
37 SYS_FUNC(utimensat)
38 {
39         if (entering(tcp)) {
40                 print_dirfd(tcp, tcp->u_arg[0]);
41                 decode_utimes(tcp, 1, 1);
42                 tprints(", ");
43                 printflags(at_flags, tcp->u_arg[3], "AT_???");
44         }
45         return 0;
46 }
47
48 #ifdef ALPHA
49 SYS_FUNC(osf_utimes)
50 {
51         if (entering(tcp)) {
52                 printpath(tcp, tcp->u_arg[0]);
53                 tprints(", ");
54                 printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32,  0);
55         }
56         return 0;
57 }
58 #endif /* ALPHA */