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 the SI_* codes in the Linux kernel source file include/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 by kill(2), and nor can it be SI_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 using tgkill(2).
  • 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 of sigqueue(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. (See signal(7) for further information.) the queue said "no more" 😭
  • EINVAL β€” sig, tgid, or tid was invalid.
  • EPERM β€” The caller does not have permission to send the signal to the target. For the required permissions, see kill(2).
  • EPERM β€” tgid specifies a process other than the caller and info->si_code is invalid.
  • ESRCH β€” rt_sigqueueinfo(): No thread group matching tgid was found.
  • rt_tgsigqueinfo(): No thread matching tgid and tid was found.
πŸ™ˆ also note: the original spells that last one rt_tgsigqueinfo() β€” no u after sigq. 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms