setup(2)

✨ setup(2) β€” the system call manual πŸ’–

okay bestie, so this is setup(2) from the System Calls Manual and I need you to know upfront: you cannot use this. Like, at all. It's the syscall equivalent of a VIP-only backstage pass and you are not on the list. But the lore is so good, so let's get into it πŸ¦‹


🌸 NAME 🌸

setup β€” set up devices and filesystems, mount the root filesystem

like, that's the whole job description. girlboss behaviour fr fr.


πŸ“š LIBRARY πŸ“š

Standard C library (libc, -lc)


✨ SYNOPSIS ✨

#include <unistd.h>

[[deprecated]] int setup(void);

see that [[deprecated]]? yeah. the compiler is literally side-eyeing it. πŸ’€


πŸ’… DESCRIPTION πŸ’…

okay so here's the tea: setup() gets called exactly once, from inside linux/init/main.c. one time. that's it. it's the opening number of the whole boot musical 🎭

what it does while it's up there:

  • calls the initialization functions for the devices and filesystems that are configured into the kernel
  • then mounts the root filesystem

and then it retires, because its moment has passed. periodt.

now the part you actually need to hear: no user process may call setup(). not you, not me, not your friend who thinks they know everything. any user process β€” and I mean any, even one with superuser permission β€” will receive EPERM. so don't even try it, the kernel said no and the kernel meant it πŸ™ˆ

warning bestie: this is not a "well maybe if I'm root" situation. root gets EPERM too. superuser privilege does NOT unlock this door. it's not a permission issue, it's a you are a user process issue. πŸ’€

🫢 RETURN VALUE 🫢

for a user process, setup() always returns -1. always. no exceptions, no lucky days, no "but I asked nicely." 😭


⭐ ERRORS ⭐

  • EPERM β€” Always, for a user process.

(note the word always. not "sometimes." not "in certain conditions." ALWAYS. iconic honestly.)


πŸ‘‘ STANDARDS πŸ‘‘

Linux.

just Linux. that's the whole vibe. 🐧


🧚 VERSIONS 🧚

  • Removed in Linux 2.1.121. she's gone, she's retired, we remember her fondly πŸŽ€
  • and the calling sequence was messy the whole time ngl β€” at some times setup() had a single argument void *BIOS, and at other times it had a single argument int magic. different eras, different signatures, no consistency, we love a chaotic queen πŸ’œ

🌈 and that's the whole page 🌈

lowkey the shortest man page you'll ever read but it ate. remember: you can't call it, you can't have it, it left in 2.1.121. iykyk πŸ’…

this was brought to you by Linux man-pages 6.20, dated 2026-02-08 β€” mwah, stay hydrated, read your man pages, bye bestie πŸ¦‹πŸ’–βœ¨

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