PR_SET_DUMPABLE(2const)
β¨ PR_SET_DUMPABLE β¨
okay so bestie, welcome to a (2const) page from the Linux man-pages π (that's a constant that lives in a header file, not a whole syscall β iykyk). This one's all about setting the "dumpable" attribute of the calling process. main character energy, but for core dumps π
πΈ NAME πΈ
PR_SET_DUMPABLE β set the "dumpable" attribute of the calling process π
π LIBRARY π
Standard C library (libc, -lc) π«Ά
π¦ SYNOPSIS π¦
#include <linux/prctl.h> /* Definition of PR_* constants */
#include <sys/prctl.h>
int prctl(PR_SET_DUMPABLE, long dumpable);
π DESCRIPTION π
So basically, this sets the state of the "dumpable" attribute, and that attribute is the thing that decides whether core dumps get produced for the calling process when a signal arrives whose default behavior is to produce a core dump. no cap π«‘
dumpable has to be either 0L (SUID_DUMP_DISABLE, process is not dumpable) or 1L (SUID_DUMP_USER, process is dumpable). only those two, bestie, don't try anything funky πΈ
Normally, the "dumpable" attribute is set to 1. But β and this is the plot twist π β it gets reset to the current value contained in the file /proc/sys/fs/suid_dumpable (which by default has the value 0) in these circumstances:
- The process's effective user or group ID is changed.
- The process's filesystem user or group ID is changed (see
credentials(7)). - The process executes (
execve(2)) a set-user-ID or set-group-ID program, resulting in a change of either the effective user ID or the effective group ID. - The process executes (
execve(2)) a program that has file capabilities (seecapabilities(7)), but only if the permitted capabilities gained exceed those already permitted for the process.
Processes that are not dumpable can not be attached via ptrace(2) PTRACE_ATTACH; see ptrace(2) for further details. like, the door is locked, bestie π
And if a process is not dumpable, the ownership of files in the process's /proc/pid directory is affected as described in proc_pid(5). yes queen, even your proc files care π
β RETURN VALUE β
On success, 0 is returned. On error, -1 is returned, and errno is set to indicate the error. slay when it's 0, sad when it's -1 π
π ERRORS π
EINVALβ arg2 is neitherSUID_DUMP_DISABLEnorSUID_DUMP_USER. (yeah, we told you. pick one of the two. π)
π FILES π
/proc/sys/fs/suid_dumpable/proc/pid/
π STANDARDS π
Linux. that's it, that's the standard π§
π HISTORY π
Linux 2.3.20. π
Between Linux 2.6.13 and Linux 2.6.17, the value 2L was also permitted, which caused any binary which normally would not be dumped to be dumped readable by root only; for security reasons, this feature has been removed. π« (See also the description of /proc/sys/fs/suid_dumpable in proc_sys_fs(5).) so if you see 2L in some ancient code, that's a relic, not a vibe β¨
π₯ SEE ALSO π₯
and that's the whole page, bestie π«Ά this was Linux man-pages 6.20, dated 2026-02-08 β go forth and dump responsibly, mwah π π
π¦ 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 2002-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