]> granicus.if.org Git - strace/blob - access.c
tests: add support of multi-line diagnostics to check_h
[strace] / access.c
1 /*
2  * Copyright (c) 2014-2019 The strace developers.
3  * All rights reserved.
4  *
5  * SPDX-License-Identifier: LGPL-2.1-or-later
6  */
7
8 #include "defs.h"
9
10 #include <fcntl.h>
11
12 #include "xlat/access_flags.h"
13
14 static int
15 decode_access(struct tcb *tcp, int offset)
16 {
17         printpath(tcp, tcp->u_arg[offset]);
18         tprints(", ");
19         printflags(access_flags, tcp->u_arg[offset + 1], "?_OK");
20
21         return RVAL_DECODED;
22 }
23
24 SYS_FUNC(access)
25 {
26         return decode_access(tcp, 0);
27 }
28
29 SYS_FUNC(faccessat)
30 {
31         print_dirfd(tcp, tcp->u_arg[0]);
32         tprints(", ");
33         return decode_access(tcp, 1);
34 }