PR_SET_SECUREBITS(2const)

πŸ’… PR_SET_SECUREBITS (the 2const one, obviously)

okay bestie so this is a page from the PR_SET_SECUREBITS(2const) manual β€” yeah, it's one of those little prctl(2) constant pages, and honestly? iconic. it's tiny, it's powerful, and it's about the "securebits" flags of the calling thread. let's get into it πŸŽ€


✨ NAME ✨

PR_SET_SECUREBITS β€” set the "securebits" flags of the calling thread πŸ¦‹


πŸ“š LIBRARY πŸ“š

Standard C library (libc, -lc). yeah she's a libc girlie, no surprises there πŸ’–


🧚 SYNOPSIS 🧚

#include <linux/prctl.h>  /* Definition of PR_* constants */
#include <sys/prctl.h>

int prctl(PR_SET_SECUREBITS, unsigned long flags);

literally that's the whole vibe. one call, one unsigned long, and prctl does its thing 🌸


πŸ”₯ DESCRIPTION πŸ”₯

so what does it actually do? it sets the "securebits" flags of the calling thread to whatever value you hand it in flags. that's it. that's the whole job. no cap 🫢

if you wanna know what those flags even mean and how they interact with all the capability chaos, go read capabilities(7) β€” that's where the real lore lives, iykyk.


⭐ RETURN VALUE ⭐

  • Slayed? πŸŽ€ you get 0. periodt.
  • Flopped? 😭 you get -1, and errno gets set to tell you exactly what went wrong, bestie.

πŸ’€ ERRORS πŸ’€

  • EINVAL β€” flags is not a valid value. like, that's not it, girl. try again with something real πŸ’…
  • EPERM β€” the caller is missing the CAP_SETPCAP capability, or tried to unset a "locked" flag, or tried to set a flag whose corresponding locked flag was already set (peep capabilities(7) for the full tea β˜•).
lowkey important: those "locked" flags? they don't unlock. that's the whole point of them being locked. so if you're trying to undo one, that's an EPERM and no amount of manifesting is gonna fix it πŸ™ˆ

🌈 STANDARDS 🌈

Linux. just Linux. that's her whole identity ✨


πŸ•°οΈ HISTORY πŸ•°οΈ

Linux 2.6.26. a classic. an elder. she's been here since 2.6.26 and she's still serving πŸ’œ


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the page!! πŸ’– this diva comes to you courtesy of the Linux man-pages 6.20 era, dated 2026-02-08 β€” so if the date ever changes, that's not on me bestie, that's upstream πŸŒΈπŸ¦‹

go set those securebits (responsibly!!) and stay iconic πŸ‘‘πŸ’…

πŸ“¦ 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