diff options
| author | Stephen Kitt <steve@sk2.org> | 2022-01-07 17:46:14 +0100 |
|---|---|---|
| committer | Alejandro Colomar <alx.manpages@gmail.com> | 2022-01-08 02:17:20 +0100 |
| commit | fdea98f2f25a742964dd03b67d15717990772fa5 (patch) | |
| tree | a6286e82f42487ead87c0e67cb9c4a4c8abf3fbd | |
| parent | 90de31894c9a35a6618ffea31d7d743c01108545 (diff) | |
| download | man-pages-fdea98f2f25a742964dd03b67d15717990772fa5.tar.gz | |
seccomp.2: Use syscall() in the example code
Since seccomp() doesn't exist in glibc, avoid relying on it, and use
syscall() instead. This updates the example program to match the
documentation, which was updated in commit 5945cd7bd3c3 ("seccomp.2:
Use syscall(SYS_...); for system calls without a wrapper").
Signed-off-by: Stephen Kitt <steve@sk2.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
| -rw-r--r-- | man2/seccomp.2 | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/man2/seccomp.2 b/man2/seccomp.2 index 4b96b6d8a9..4c589d185e 100644 --- a/man2/seccomp.2 +++ b/man2/seccomp.2 @@ -1134,6 +1134,7 @@ cecilia #include <linux/filter.h> #include <linux/seccomp.h> #include <sys/prctl.h> +#include <sys/syscall.h> #define X32_SYSCALL_BIT 0x40000000 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) @@ -1191,7 +1192,7 @@ install_filter(int syscall_nr, int t_arch, int f_errno) .filter = filter, }; - if (seccomp(SECCOMP_SET_MODE_FILTER, 0, &prog)) { + if (syscall(SYS_seccomp, SECCOMP_SET_MODE_FILTER, 0, &prog)) { perror("seccomp"); return 1; } |
