rt_sigqueueinfo(2) | System Calls Manual | rt_sigqueueinfo(2) |
rt_sigqueueinfo, rt_tgsigqueueinfo - queue a signal and data
Standard C library (libc, -lc)
#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 NOTES.
The rt_sigqueueinfo() and rt_tgsigqueueinfo() system calls are the low-level interfaces used to send a signal plus data to a process or thread. The receiver of the signal can obtain the accompanying data by establishing a signal handler with the sigaction(2) SA_SIGINFO flag.
These system calls are not intended for direct application use; they are provided to allow the implementation of sigqueue(3) and pthread_sigqueue(3).
The rt_sigqueueinfo() system call sends the signal sig to the thread group with the ID tgid. (The term "thread group" is synonymous with "process", and tid corresponds to the traditional UNIX process ID.) 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).
The info argument specifies the data to accompany the signal. This argument is 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:
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.
The rt_tgsigqueueinfo() system call 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.
On success, these system calls return 0. On error, they return -1 and errno is set to indicate the error.
rt_tgsigqueinfo(): No thread matching tgid and tid was found.
Linux.
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.
As with kill(2), the null signal (0) can be used to check if the specified process or thread exists.
kill(2), pidfd_send_signal(2), sigaction(2), sigprocmask(2), tgkill(2), pthread_sigqueue(3), sigqueue(3), signal(7)
2023-10-31 | Linux man-pages 6.7 |