idle(2)

πŸ’€ idle(2) β€” the "make process 0 idle" situation

okay bestie so we're in idle from the System Calls Manual (that's section 2, the syscall girlies) and lemme tell you, this one is niche. Like, you will probably never call this. It's giving backstage pass. But we're gonna learn it anyway because we're thorough and iconic. πŸ’…


✨ NAME ✨

idle β€” make process 0 idle

that's it. that's the whole job description. πŸŽ€


✨ SYNOPSIS ✨

#include <unistd.h>

[[deprecated]] int idle(void);

so you include <unistd.h>, and the function is idle(), takes void (no arguments, no crumbs), and returns an int. But it's marked [[deprecated]], so the compiler is gonna side-eye you the entire time. πŸ™ˆ


✨ DESCRIPTION ✨

so idle() is an internal system call used during bootstrap. Bootstrap as in the kernel waking up, not the CSS framework, bestie. 🌸

When it runs, it does three things: it marks the process's pages as swappable, it lowers its priority, and then it enters the main scheduling loop. That's the whole arc. ✨

And the plot twist? idle() never returns. Not once. Not ever. It is committed. It is in its forever era. 😭

important: only process 0 may call idle(). Any user process β€” and yes, even a process with superuser permission β€” will receive EPERM. root cannot sweet-talk its way in. the gate is closed. 🚫

✨ RETURN VALUE ✨

so here's the thing:

  • for process 0, idle() never returns. periodt. it's gone, it's absorbed into the scheduler, it said bye.
  • for a user process, it always returns -1. rough. brutal, even. πŸ’€

✨ ERRORS ✨

  • EPERM β€” Always, for a user process. Not sometimes. Not "if you're unlucky". Always. it's consistent, at least. 🫢

✨ STANDARDS ✨

Linux. that's the standard listing. Linux only, no POSIX, no BSD, no group chat invite for anyone else. πŸ‘‘


✨ HISTORY ✨

Removed in Linux 2.3.13. so bestie... it's not even here anymore. this is a historical artifact. a museum piece. a relic in a glass case. 🧚


and that's the entire page, no SEE ALSO, no sibling syscalls to introduce you to, this one flies solo πŸ¦‹

this little slice of lore came to you from Linux man-pages 6.20, dated 2026-02-08 β€” ty for reading my unhinged explanation of a syscall that no longer exists, love u, stay swappable πŸ’–βœ¨πŸŒˆ

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