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 argumentvoid *BIOS, and at other times it had a single argumentint 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
- Copyright 1992, Drew Eckhardt <drew@cs.colorado.edu>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms