blob: a9663dc1cfb6a8d2d41d594bd97839fc0f1938b6 [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{
Dmitry V. Levin0b2eabe2015-07-20 19:27:51 +000010 printpath(tcp, tcp->u_arg[offset]);
11 tprints(", ");
12 printflags(access_flags, tcp->u_arg[offset + 1], "?_OK");
13
14 return RVAL_DECODED;
Dmitry V. Levin304cd812014-12-06 03:53:16 +000015}
16
Dmitry V. Levina0bd3742015-04-07 01:36:50 +000017SYS_FUNC(access)
Dmitry V. Levin304cd812014-12-06 03:53:16 +000018{
19 return decode_access(tcp, 0);
20}
21
Dmitry V. Levina0bd3742015-04-07 01:36:50 +000022SYS_FUNC(faccessat)
Dmitry V. Levin304cd812014-12-06 03:53:16 +000023{
Dmitry V. Levin0b2eabe2015-07-20 19:27:51 +000024 print_dirfd(tcp, tcp->u_arg[0]);
Dmitry V. Levin304cd812014-12-06 03:53:16 +000025 return decode_access(tcp, 1);
26}