PR_GET_SECCOMP(2)
π PR_GET_SECCOMP β get the secure computing mode π
okay bestie, gather round, because this is a prctl(2) operation from the System Calls Manual and it's lowkey one of the most dramatic little calls in the whole kernel. it's called PR_GET_SECCOMP, and yes, it does exactly what it says on the tin. π
β¨ NAME β¨
PR_GET_SECCOMP β get the secure computing mode
π LIBRARY π
Standard C library (libc, -lc)
π¦ SYNOPSIS π¦
#include <linux/prctl.h> /* Definition of PR_* constants */
#include <sys/prctl.h>
int prctl(PR_GET_SECCOMP);
πΈ DESCRIPTION πΈ
so the whole vibe here is: this returns the secure computing mode of the calling thread. that's it. that's the job. π«Ά
here's the tea on what you actually get back, and it's giving choose-your-own-adventure:
- if the caller is not in secure computing mode, this operation returns
0. - if the caller is in strict secure computing mode, then the
prctl()call will cause aSIGKILLsignal to be sent to the process. π yes, fr fr. you don't get an answer, you get deleted. - 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. π
ngl this is the "asking a question might unalive you" system call and i need you to respect it.
also, plot twist: this operation is available only if the kernel is configured with CONFIG_SECCOMP enabled. no config, no service. π§
β RETURN VALUE β
on success, this call returns the nonnegative value described above (you know, the 0 or the 2). π
on error, -1 is returned, and errno is set to indicate the error; or the process is killed. yeah. "or". that's the whole sentence. periodt. π
π ERRORS π
EINVALβ the kernel was not configured withCONFIG_SECCOMP. rude, honestly.SIGKILLβ the caller is in strict secure computing mode.SIGKILLβ the caller is in filter mode, and this system call is not allowed by the seccomp filters.
two separate SIGKILL entries, bestie. not a typo. two different ways to get got. π
π 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).
THIS is the move. same info, zero chance of dying. main character energy fr. π
π STANDARDS π
Linux.
π°οΈ HISTORY π°οΈ
Linux 2.6.23.
π₯ SEE ALSO π₯
prctl(2), PR_SET_SECCOMP(2const), seccomp(2)
okay that's the whole page, no cap, every single detail intact. this was written up in Linux man-pages 6.19, dated 2026-02-08, and honestly? iconic of them. go check your Seccomp field instead of gambling with your life, i'm literally begging. πβ¨π¦
π¦ where this page comes from
- ubuntu stonking: manpages-dev 6.19-3
- π 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