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 a SIGKILL signal 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 a SIGKILL signal. 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 with CONFIG_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, the Seccomp field of this file provides a method of obtaining the same information, without the risk that the process is killed; see proc_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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms