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 (see capabilities(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 neither SUID_DUMP_DISABLE nor SUID_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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms