forked from strace/strace
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchmod.c
More file actions
41 lines (33 loc) · 632 Bytes
/
chmod.c
File metadata and controls
41 lines (33 loc) · 632 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* Copyright (c) 2014-2019 The strace developers.
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
static void
decode_chmod(struct tcb *tcp, const int offset)
{
printpath(tcp, tcp->u_arg[offset]);
tprints(", ");
print_numeric_umode_t(tcp->u_arg[offset + 1]);
}
SYS_FUNC(chmod)
{
decode_chmod(tcp, 0);
return RVAL_DECODED;
}
SYS_FUNC(fchmodat)
{
print_dirfd(tcp, tcp->u_arg[0]);
tprints(", ");
decode_chmod(tcp, 1);
return RVAL_DECODED;
}
SYS_FUNC(fchmod)
{
printfd(tcp, tcp->u_arg[0]);
tprints(", ");
print_numeric_umode_t(tcp->u_arg[1]);
return RVAL_DECODED;
}