]> granicus.if.org Git - strace/blob - seccomp.c
Remove XLAT_END
[strace] / seccomp.c
1 /*
2  * Copyright (c) 2015-2018 Dmitry V. Levin <ldv@altlinux.org>
3  * All rights reserved.
4  *
5  * SPDX-License-Identifier: LGPL-2.1-or-later
6  */
7
8 #include "defs.h"
9
10 #ifdef HAVE_LINUX_SECCOMP_H
11 # include <linux/seccomp.h>
12 #endif
13 #include "xlat/seccomp_ops.h"
14 #include "xlat/seccomp_filter_flags.h"
15
16 SYS_FUNC(seccomp)
17 {
18         unsigned int op = tcp->u_arg[0];
19         unsigned int flags = tcp->u_arg[1];
20         unsigned int act;
21
22         printxval(seccomp_ops, op, "SECCOMP_SET_MODE_???");
23         tprints(", ");
24
25         switch (op) {
26         case SECCOMP_GET_ACTION_AVAIL:
27                 tprintf("%u, ", flags);
28                 if (!umove_or_printaddr(tcp, tcp->u_arg[2], &act)) {
29                         tprints("[");
30                         printxval(seccomp_ret_action, act, "SECCOMP_RET_???");
31                         tprints("]");
32                 }
33                 break;
34
35         case SECCOMP_SET_MODE_FILTER:
36                 printflags(seccomp_filter_flags, flags,
37                            "SECCOMP_FILTER_FLAG_???");
38                 tprints(", ");
39                 decode_seccomp_fprog(tcp, tcp->u_arg[2]);
40                 break;
41
42         case SECCOMP_SET_MODE_STRICT:
43         default:
44                 tprintf("%u, ", flags);
45                 printaddr(tcp->u_arg[2]);
46                 break;
47         }
48
49         return RVAL_DECODED;
50 }