blob: f28f69d78d290ef63a008692f9dec31dda7a766f [file] [log] [blame]
Dmitry V. Levin304cd812014-12-06 03:53:16 +00001#include "defs.h"
2
3#include <fcntl.h>
4
5#include "xlat/access_flags.h"
6
7static int
8decode_access(struct tcb *tcp, int offset)
9{
10 if (entering(tcp)) {
11 printpath(tcp, tcp->u_arg[offset]);
12 tprints(", ");
13 printflags(access_flags, tcp->u_arg[offset + 1], "?_OK");
14 }
15 return 0;
16}
17
18int
19sys_access(struct tcb *tcp)
20{
21 return decode_access(tcp, 0);
22}
23
24int
25sys_faccessat(struct tcb *tcp)
26{
27 if (entering(tcp))
28 print_dirfd(tcp, tcp->u_arg[0]);
29 return decode_access(tcp, 1);
30}