]> granicus.if.org Git - strace/blob - chmod.c
signal.c: make use of RVAL_DECODED
[strace] / chmod.c
1 #include "defs.h"
2
3 static int
4 decode_chmod(struct tcb *tcp, int offset)
5 {
6         if (entering(tcp)) {
7                 printpath(tcp, tcp->u_arg[offset]);
8                 tprintf(", %#lo", tcp->u_arg[offset + 1]);
9         }
10         return 0;
11 }
12
13 SYS_FUNC(chmod)
14 {
15         return decode_chmod(tcp, 0);
16 }
17
18 SYS_FUNC(fchmodat)
19 {
20         if (entering(tcp))
21                 print_dirfd(tcp, tcp->u_arg[0]);
22         return decode_chmod(tcp, 1);
23 }
24
25 SYS_FUNC(fchmod)
26 {
27         if (entering(tcp)) {
28                 printfd(tcp, tcp->u_arg[0]);
29                 tprintf(", %#lo", tcp->u_arg[1]);
30         }
31         return 0;
32 }