Dmitry V. Levin | 304cd81 | 2014-12-06 03:53:16 +0000 | [diff] [blame] | 1 | #include "defs.h" |
| 2 | |
| 3 | #include <fcntl.h> |
| 4 | |
| 5 | #include "xlat/access_flags.h" |
| 6 | |
| 7 | static int |
| 8 | decode_access(struct tcb *tcp, int offset) |
| 9 | { |
Dmitry V. Levin | 0b2eabe | 2015-07-20 19:27:51 +0000 | [diff] [blame] | 10 | 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. Levin | 304cd81 | 2014-12-06 03:53:16 +0000 | [diff] [blame] | 15 | } |
| 16 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 17 | SYS_FUNC(access) |
Dmitry V. Levin | 304cd81 | 2014-12-06 03:53:16 +0000 | [diff] [blame] | 18 | { |
| 19 | return decode_access(tcp, 0); |
| 20 | } |
| 21 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 22 | SYS_FUNC(faccessat) |
Dmitry V. Levin | 304cd81 | 2014-12-06 03:53:16 +0000 | [diff] [blame] | 23 | { |
Dmitry V. Levin | 0b2eabe | 2015-07-20 19:27:51 +0000 | [diff] [blame] | 24 | print_dirfd(tcp, tcp->u_arg[0]); |
Dmitry V. Levin | 304cd81 | 2014-12-06 03:53:16 +0000 | [diff] [blame] | 25 | return decode_access(tcp, 1); |
| 26 | } |