1 .TH "seccomp_syscall_priority" 3 "25 July 2012" "paul@paul-moore.com" "libseccomp Documentation"
2 .\" //////////////////////////////////////////////////////////////////////////
4 .\" //////////////////////////////////////////////////////////////////////////
5 seccomp_syscall_priority \- Prioritize syscalls in the seccomp filter
6 .\" //////////////////////////////////////////////////////////////////////////
8 .\" //////////////////////////////////////////////////////////////////////////
10 .B #include <seccomp.h>
12 .B typedef void * scmp_filter_ctx;
14 .BI "int SCMP_SYS(" syscall_name ");"
16 .BI "int seccomp_syscall_priority(scmp_filter_ctx " ctx ","
17 .BI " int " syscall ", uint8_t " priority ");"
19 Link with \fI\-lseccomp\fP.
21 .\" //////////////////////////////////////////////////////////////////////////
23 .\" //////////////////////////////////////////////////////////////////////////
26 .BR seccomp_syscall_priority ()
27 function provides a priority hint to the seccomp filter generator in libseccomp
28 such that higher priority syscalls are placed earlier in the seccomp filter code
29 so that they incur less overhead at the expense of lower priority syscalls. A
30 syscall's priority can be set regardless of if any rules currently exist for
31 that syscall; the library will remember the priority and it will be assigned to
32 the syscall if and when a rule for that syscall is created.
34 While it is possible to specify the
36 value directly using the standard
38 values, in order to ensure proper operation across multiple architectures it
39 is highly recommended to use the
41 macro instead. See the EXAMPLES section below.
45 parameter takes an 8-bit value ranging from 0 \- 255; a higher value represents
50 is the value returned by the call to
52 .\" //////////////////////////////////////////////////////////////////////////
54 .\" //////////////////////////////////////////////////////////////////////////
56 .BR seccomp_syscall_priority ()
57 function returns zero on success, negative errno values on failure. The
59 macro returns a value suitable for use as the
62 .BR seccomp_syscall_priority ().
63 .\" //////////////////////////////////////////////////////////////////////////
65 .\" //////////////////////////////////////////////////////////////////////////
69 int main(int argc, char *argv[])
74 ctx = seccomp_init(SCMP_ACT_KILL);
80 rc = seccomp_syscall_priority(ctx, SCMP_SYS(read), 200);
91 .\" //////////////////////////////////////////////////////////////////////////
93 .\" //////////////////////////////////////////////////////////////////////////
95 While the seccomp filter can be generated independent of the kernel, kernel
96 support is required to load and enforce the seccomp filter generated by
99 The libseccomp project site, with more information and the source code
100 repository, can be found at https://github.com/seccomp/libseccomp. This tool,
101 as well as the libseccomp library, is currently under development, please
102 report any bugs at the project site or directly to the author.
103 .\" //////////////////////////////////////////////////////////////////////////
105 .\" //////////////////////////////////////////////////////////////////////////
106 Paul Moore <paul@paul-moore.com>
107 .\" //////////////////////////////////////////////////////////////////////////
109 .\" //////////////////////////////////////////////////////////////////////////
110 .BR seccomp_rule_add (3),
111 .BR seccomp_rule_add_exact (3)