pause(2)

โœจ pause(2) โœจ

okay bestie, welcome to pause(2) from the System Calls Manual โ€” literally the chillest syscall in the whole libc friend group ๐Ÿ’…


๐ŸŒธ NAME ๐ŸŒธ

pause โ€” wait for signal ๐Ÿฆ‹

๐Ÿ“š LIBRARY ๐Ÿ“š

Standard C library (libc, -lc) ๐ŸŽ€

๐Ÿช„ SYNOPSIS ๐Ÿช„

#include <unistd.h>

int pause(void);

๐Ÿ’– DESCRIPTION ๐Ÿ’–

so the way that pause() works is iconic in its simplicity: it makes the calling process (or thread โ€” yes, threads count too, periodt) go full sleepy-girl mode ๐Ÿ˜ด and just... sleep. It stays asleep until a signal shows up that either:

  • terminates the process, or
  • causes the invocation of a signal-catching function ๐Ÿ”ฅ

that's it. that's the whole vibe. no cap.

๐Ÿซถ RETURN VALUE ๐Ÿซถ

okay so here's the thing โ€” pause() lowkey never returns normally. It only comes back when a signal was caught and the signal-catching function returned. In that case:

  • pause() returns -1 ๐Ÿ˜ญ
  • and errno is set to EINTR

so it's giving "I woke up and I'm a little confused about it" energy fr fr.

๐Ÿ’€ ERRORS ๐Ÿ’€

  • EINTR โ€” a signal was caught and the signal-catching function returned. that's the one and only babe, no other options, no cap (the docs literally list just this one, so don't go looking for more ๐Ÿ™ˆ).

๐Ÿ‘‘ STANDARDS ๐Ÿ‘‘

POSIX.1-2024. she's certified, she's compliant, she ate โœจ

๐ŸŒˆ HISTORY ๐ŸŒˆ

POSIX.1-2001, SVr4, 4.3BSD โ€” so she's been around since forever, a true vintage queen ๐Ÿ‘‘

๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ


reminder bestie: if you're out here calling pause() and expecting it to return 0, that's not happening. It returns -1 with errno == EINTR or it doesn't return at all. Set your errno expectations accordingly ๐Ÿ’œ

kisses, this was pause(2) from Linux man-pages 6.20, dated 2026-02-08 ๐ŸŽ€ bye bestie, go read sigsuspend(2) next, it's the extroverted version of this one ๐ŸŽ€

๐Ÿ“ฆ 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