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 callingtgkill(2), if the kernel supports that system call. - Older glibc versions implemented
raise()usingkill(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
- Copyright 1993, Thomas Koenig <ig25@rz.uni-karlsruhe.de>
- Copyright 2008, Michael Kerrisk <mtk.manpages@gmail.com>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms