1seccomp_load(3)            libseccomp Documentation            seccomp_load(3)
2
3
4

NAME

6       seccomp_load - Load the current seccomp filter into the kernel
7

SYNOPSIS

9       #include <seccomp.h>
10
11       typedef void * scmp_filter_ctx;
12
13       int seccomp_load(scmp_filter_ctx ctx);
14
15       Link with -lseccomp.
16

DESCRIPTION

18       Loads  the seccomp filter provided by ctx into the kernel; if the func‐
19       tion succeeds the new seccomp filter will be active when  the  function
20       returns.
21

RETURN VALUE

23       Returns zero on success, negative errno values on failure.
24

EXAMPLES

26       #include <seccomp.h>
27
28       int main(int argc, char *argv[])
29       {
30            int rc = -1;
31            scmp_filter_ctx ctx;
32
33            ctx = seccomp_init(SCMP_ACT_KILL);
34            if (ctx == NULL)
35                 goto out;
36
37            /* ... */
38
39            rc = seccomp_load(ctx);
40            if (rc < 0)
41                 goto out;
42
43            /* ... */
44
45       out:
46            seccomp_release(ctx);
47            return -rc;
48       }
49

NOTES

51       While  the  seccomp  filter can be generated independent of the kernel,
52       kernel support is required to load and enforce the seccomp filter  gen‐
53       erated by libseccomp.
54
55       The  libseccomp project site, with more information and the source code
56       repository,  can  be  found  at  https://github.com/seccomp/libseccomp.
57       This tool, as well as the libseccomp library, is currently under devel‐
58       opment, please report any bugs at the project site or directly  to  the
59       author.
60

AUTHOR

62       Paul Moore <paul@paul-moore.com>
63

SEE ALSO

65       seccomp_init(3),     seccomp_reset(3),     seccomp_release(3),     sec‐
66       comp_rule_add(3), seccomp_rule_add_exact(3)
67
68
69
70
71
72paul@paul-moore.com              25 July 2012                  seccomp_load(3)
Impressum