]> granicus.if.org Git - strace/blob - chmod.c
Use macros for gcc attributes
[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 int
14 sys_chmod(struct tcb *tcp)
15 {
16         return decode_chmod(tcp, 0);
17 }
18
19 int
20 sys_fchmodat(struct tcb *tcp)
21 {
22         if (entering(tcp))
23                 print_dirfd(tcp, tcp->u_arg[0]);
24         return decode_chmod(tcp, 1);
25 }
26
27 int
28 sys_fchmod(struct tcb *tcp)
29 {
30         if (entering(tcp)) {
31                 printfd(tcp, tcp->u_arg[0]);
32                 tprintf(", %#lo", tcp->u_arg[1]);
33         }
34         return 0;
35 }