raise(3)

โœจ raise(3) โœจ

okay bestie come CLOSER ๐Ÿ’– we're talking about raise(3) today, a lil libc function from the Library Functions Manual and she is lowkey iconic for how much she does with so few letters.


๐Ÿซถ NAME ๐Ÿซถ

raise โ€” send a signal to the caller. that's it, that's the whole job, and she does it flawlessly. no cap. ๐Ÿ’…


๐Ÿ“š LIBRARY ๐Ÿ“š

Standard C library (libc, -lc) โ€” so yes, you get her for free, you just have to actually link her. ๐ŸŽ€


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

#include <signal.h>

int raise(int sig);

one header, one function, one int going in, one int coming out. it's giving minimalism. it's giving main character energy. โœจ


๐ŸŒธ DESCRIPTION ๐ŸŒธ

so here's the vibe: raise() sends a signal to the calling process or thread. meaning you raise your hand and you get the signal. it's self-care, but make it a signal. ๐Ÿ’€

in a single-threaded program it is equivalent to:

kill(getpid(), sig);

in a multithreaded program it is equivalent to:

pthread_kill(pthread_self(), sig);

so like, if you're in a thread, the signal goes to your thread specifically โ€” not the whole squad. very "this is about ME" of her. ๐Ÿ‘‘

and the important part: if the signal causes a handler to be called, raise() will return only after the signal handler has returned. so she waits. she's polite. she's not leaving until the handler finishes its little monologue. ๐ŸŽค


๐Ÿ’œ RETURN VALUE ๐Ÿ’œ

  • 0 โ€” success, we ate, no crumbs. ๐Ÿ“
  • nonzero โ€” failure, and honestly? not the vibe. ๐Ÿ˜ญ

๐Ÿงš ATTRIBUTES ๐Ÿงš

for an explanation of the terms used in this section, see attributes(7).

  • raise() โ€” Thread safety โ€” MT-Safe ๐Ÿ”ฅ

translation: she's safe to call from multiple threads at once. she will NOT start drama. periodt.

๐Ÿ’ก MT-Safe means multithread-safe, bestie โ€” different from MT-Safe env or race conditions, but for this one she's plain old MT-Safe and we love that for her.

๐ŸŒˆ STANDARDS ๐ŸŒˆ

  • C11
  • POSIX.1-2008

certified, official, on the list. ๐Ÿ’…


๐Ÿ‘‘ HISTORY ๐Ÿ‘‘

  • POSIX.1-2001
  • C89

so she's been around. she's a legacy queen and she's still slaying.

  • Since glibc 2.3.3, raise() is implemented by calling tgkill(2), if the kernel supports that system call.
  • Older glibc versions implemented raise() using kill(2).

glow-up arc fr fr โ€” she traded kill(2) for tgkill(2) and never looked back. ๐ŸŒŸ


๐ŸŽ€ SEE ALSO ๐ŸŽ€

go read those next, bestie, iykyk ๐Ÿซถ


mwah ๐Ÿ’‹ that's the whole page. this was Linux man-pages 6.20, dated 2026-02-08, for raise(3) โ€” and honestly? she understood the assignment. go send yourself a signal. respectfully. ๐ŸŒธ๐Ÿฆ‹๐Ÿ’–

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