PR_SET_SECCOMP(2const)
π PR_SET_SECCOMP β the <linux/prctl.h> / <sys/prctl.h> girly pop π
okay so bestie, this is the PR_SET_SECCOMP page from section 2const of the Linux manuals, and it's giving "prctl operation that locks your thread down into secure computing mode" β¨ lowkey iconic, highkey deprecated for the new stuff. Let's get into it π«Ά
πΈ NAME πΈ
PR_SET_SECCOMP β set the secure computing mode π
π LIBRARY π
Standard C library (libc, -lc) π
β¨ SYNOPSIS β¨
#include <linux/prctl.h> /* Definition of PR_* constants */
#include <sys/prctl.h>
[[deprecated]]
int prctl(PR_SET_SECCOMP, long mode, ...);
[[deprecated]]
int prctl(PR_SET_SECCOMP, SECCOMP_MODE_STRICT);
[[deprecated]]
int prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER,
struct sock_fprog *filter);
not the double [[deprecated]] jumpscare π yeah, this whole operation is marked deprecated. the compiler is gonna side-eye you and honestly? it's right.
π¦ DESCRIPTION π¦
Set the secure computing (seccomp) mode for the calling thread, to limit the available system calls. no cap, that's the whole vibe: your thread gets a smaller menu of syscalls and that's it.
the more recent seccomp(2) system call provides a superset of the functionality of PR_SET_SECCOMP, and is the preferred interface for new applications π so like. use that one. this one is the OG that walked so seccomp(2) could run.
The seccomp mode is selected via mode. The seccomp constants are defined in <linux/seccomp.h>. The following values can be specified:
SECCOMP_MODE_STRICT(since Linux 2.6.23) β see the description ofSECCOMP_SET_MODE_STRICTinseccomp(2). π§
This operation is available only if the kernel is configured with CONFIG_SECCOMP enabled.
SECCOMP_MODE_FILTER(since Linux 3.5) β the allowed system calls are defined by a pointer to a Berkeley Packet Filter passed in filter. It can be designed to filter arbitrary system calls and system call arguments. See the description ofSECCOMP_SET_MODE_FILTERinseccomp(2). π₯
This operation is available only if the kernel is configured with CONFIG_SECCOMP_FILTER enabled.
fr fr: both modes have a kernel-config prerequisite. if your kernel wasn't built with the matchingCONFIG_*, you're getting anEINVALand a reality check π
π RETURN VALUE π
On success, 0 is returned. π«Ά
On error, -1 is returned, and errno is set to indicate the error.
π ERRORS π
EACCESβ mode isSECCOMP_MODE_FILTER, but the process does not have theCAP_SYS_ADMINcapability or has not set theno_new_privsattribute (seePR_SET_NO_NEW_PRIVS(2const)).EFAULTβ mode isSECCOMP_MODE_FILTER, and filter is an invalid address.EINVALβ mode is not a valid value.EINVALβ the kernel was not configured withCONFIG_SECCOMP.EINVALβ mode isSECCOMP_MODE_FILTER, and the kernel was not configured withCONFIG_SECCOMP_FILTER.
literally three separate reasons to get EINVAL on this page. read the whole list before you start debugging, bestie π
π STANDARDS π
Linux. π§ that's it, that's the standard.
β HISTORY β
Linux 2.6.23. (yes, ancient. she's a millennial. respect your elders π)
π SEE ALSO π
and that's the page, babes π go read seccomp(2) if you're starting something new, and remember: this one's deprecated, so don't build your whole personality on it. mwah π«Ά
this cutie was served to you by Linux man-pages 6.20, dated 2026-02-08. stay safe, set your filters, and slay π β¨
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: Linux-man-pages-copyleft
- Copyright 2008-2015, Michael Kerrisk <mtk.manpages@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms