PR_GET_SECCOMP(2)
π PR_GET_SECCOMP β get the secure computing mode
okay bestie, welcome to PR_GET_SECCOMP(2) β that's section 2 of the manual, we love a system call moment β¨ this is the vibe-check-your-own-sandbox situation and honestly? it's giving iconic but also slightly terrifying, you'll see why π«Ά
π LIBRARY
Standard C library (libc, -lc) β the classic, no cap.
β¨ SYNOPSIS
#include <linux/prctl.h> /* Definition of PR_* constants */
#include <sys/prctl.h>
int prctl(PR_GET_SECCOMP);
π DESCRIPTION
So basically it returns the secure computing mode of the calling thread. The one doing the asking. Just that thread. π§
Here's where it gets spicy, so lock in π₯:
- if the caller is not in secure computing mode, this operation returns
0β chill, normal, slay - if the caller is in strict secure computing mode, then the
prctl()call will cause aSIGKILLsignal to be sent to the process. like. it just kills you for asking π that's not a typo, that's the documented behaviour - if the caller is in filter mode, and this system call is allowed by the seccomp filters, it returns
2; otherwise, the process is killed with aSIGKILLsignal. so, y'know, it depends on the filter's mood π
β οΈ this operation is available only if the kernel is configured with CONFIG_SECCOMP enabled. no config, no vibes.
π RETURN VALUE
On success, this call returns the nonnegative value described above (0 or 2, iykyk). On error, -1 is returned, and errno is set to indicate the error; or the process is killed. yeah. "or the process is killed." they really just said that casually and moved on. main character energy but make it fatal π
π¨ ERRORS
EINVALβ the kernel was not configured withCONFIG_SECCOMP. rude, honestly.SIGKILLβ the caller is in strict secure computing mode. bye bestie πͺ¦SIGKILLβ the caller is in filter mode, and this system call is not allowed by the seccomp filters. bye bestie, part two πͺ¦πͺ¦
ποΈ FILES
/proc/pid/statusβ since Linux 3.8, theSeccompfield of this file provides a method of obtaining the same information, without the risk that the process is killed; seeproc_pid_status(5). ok so this is the safe route and honestly the one you should be taking most of the time, no cap πΈ
π STANDARDS
Linux. that's the whole standard. periodt.
π°οΈ HISTORY
Linux 2.6.23 β old money, but make it kernel π
π¦ SEE ALSO
prctl(2), PR_SET_SECCOMP(2const), seccomp(2)
and that's the whole page, bestie!! π this gem is from Linux man-pages 6.20, dated 2026-02-08, page PR_GET_SECCOMP(2) β go forth, check your seccomp mode, and maybe use /proc/pid/status so you don't get SIGKILLed mid-sentence πβ
π¦ 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