rt_sigqueueinfo(2)
π rt_sigqueueinfo β the manual page, but make it cute π
okay so bestie, you found the rt_sigqueueinfo(2) page in the System Calls Manual β yes, section 2, the deep lore section. this is the one where the kernel lets you yeet a signal plus a lil payload of data at a process or a thread. it's giving backstage-pass energy. let's get into it π
β¨ NAME β¨
rt_sigqueueinfo, rt_tgsigqueueinfo β queue a signal and data π
π LIBRARY π
Standard C library (libc, -lc) β the usual suspect, no cap.
πΈ SYNOPSIS πΈ
#include <linux/signal.h> /* Definition of SI_* constants */
#include <sys/syscall.h> /* Definition of SYS_* constants */
#include <unistd.h>
int syscall(SYS_rt_sigqueueinfo, pid_t tgid,
int sig, siginfo_t *info);
int syscall(SYS_rt_tgsigqueueinfo, pid_t tgid, pid_t tid,
int sig, siginfo_t *info);
β Note: There are no glibc wrappers for these system calls; see the NOTES section. so you're raw-dogging it with syscall(2), bestie π
π¦ DESCRIPTION π¦
So. rt_sigqueueinfo() and rt_tgsigqueueinfo() are the low-level interfaces used to send a signal plus data to a process or a thread. like, kill(2) but with a lil gift bag attached π
The receiver of the signal can obtain the accompanying data by establishing a signal handler with the sigaction(2) SA_SIGINFO flag. that's the whole trick. that's the vibe. iykyk.
These system calls are not intended for direct application use β they exist so that sigqueue(3) and pthread_sigqueue(3) can be implemented. they're the plumbing, the scaffolding, the backstage crew. respect them but don't date them.
rt_sigqueueinfo() sends the signal sig to the thread group with the ID tgid. and before you ask: yes, "thread group" is synonymous with "process", and tgid corresponds to the traditional UNIX process ID. periodt. π
The signal will be delivered to an arbitrary member of the thread group β i.e., one of the threads that is not currently blocking the signal. so like, whoever's free catches it. no assigned seating, main character roulette π
The info argument specifies the data to accompany the signal. it's a pointer to a structure of type siginfo_t, described in sigaction(2) (and defined by including <sigaction.h>). the caller should set the following fields in this structure:
π the fields you gotta set π
si_codeβ This should be one of theSI_*codes in the Linux kernel source fileinclude/asm-generic/siginfo.h. If the signal is being sent to any process other than the caller itself, the following restrictions apply:- The code can't be a value greater than or equal to zero. In particular, it can't be
SI_USER, which is used by the kernel to indicate a signal sent bykill(2), and nor can it beSI_KERNEL, which is used to indicate a signal generated by the kernel. - The code can't (since Linux 2.6.39) be
SI_TKILL, which is used by the kernel to indicate a signal sent usingtgkill(2).
- The code can't be a value greater than or equal to zero. In particular, it can't be
si_pidβ This should be set to a process ID, typically the process ID of the sender.si_uidβ This should be set to a user ID, typically the real user ID of the sender.si_valueβ This field contains the user data to accompany the signal. For more information, see the description of the last (union sigval) argument ofsigqueue(3).
Internally, the kernel sets the si_signo field to the value specified in sig, so that the receiver of the signal can also obtain the signal number via that field. sneaky. efficient. iconic β¨
rt_tgsigqueueinfo() is like rt_sigqueueinfo(), but sends the signal and data to the single thread specified by the combination of tgid, a thread group ID, and tid, a thread in that thread group. it's the targeted DM version instead of the group chat π«Ά
π« RETURN VALUE π«
On success, these system calls return 0. on error, they return -1 and errno is set to indicate the error. classic.
π ERRORS π
EAGAINβ The limit of signals that may be queued has been reached. (Seesignal(7)for further information.) the queue said "no more" πEINVALβsig,tgid, ortidwas invalid.EPERMβ The caller does not have permission to send the signal to the target. For the required permissions, seekill(2).EPERMβtgidspecifies a process other than the caller andinfo->si_codeis invalid.ESRCHβrt_sigqueueinfo(): No thread group matchingtgidwas found.rt_tgsigqueinfo(): No thread matchingtgidandtidwas found.
π also note: the original spells that last onert_tgsigqueinfo()β nouaftersigq. i'm keeping it exactly as written because that's the rule, bestie. character for character π
π STANDARDS π
Linux. just Linux. that's it. that's the whole standard. π§
π HISTORY π
rt_sigqueueinfo()β Linux 2.2.rt_tgsigqueueinfo()β Linux 2.6.31.
a whole glow-up arc across kernel versions, we love to see it π±
π§ NOTES π§
Since these system calls are not intended for application use, there are no glibc wrapper functions; use syscall(2) in the unlikely case that you want to call them directly. unlikely!! she said unlikely!!! okay but if you do, you do π
As with kill(2), the null signal (0) can be used to check if the specified process or thread exists. free vibe check, no signal actually sent π¦
π₯ SEE ALSO π₯
kill(2), pidfd_send_signal(2), sigaction(2), sigprocmask(2), tgkill(2), pthread_sigqueue(3), sigqueue(3), signal(7)
and that's the page, bestie π this was Linux man-pages 6.20, dated 2026-02-08, for your reading pleasure. go forth and queue responsibly, mwah π
π¦ 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 2002-2011, 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