RT_SIGQUEUEINFORT_SIGQUEUEINFO



RT_SIGQUEUEINFORT_SIGQUEUEINFO

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
NOTES
CONFORMING TO
SEE ALSO
NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
VERSIONS
CONFORMING TO
NOTES
SEE ALSO
COLOPHON

NAME

rt_sigqueueinfo − queue a signal and data to a process

SYNOPSIS

long sys_rt_sigqueueinfo(int pid, int sig, siginfo_t * uinfo);

DESCRIPTION

sys_rt_sigqueueinfo() sends the signal specified in sig to the process whose PID is given in pid. The null signal (0) can be used to check if a process with a given PID exists.

The uinfo argument is used to specify an accompanying item of data (either an integer or a pointer value) in the sigval part of the siginfo_t structure to be sent with the signal.

If the receiving process has installed a handler for this signal using the SA_SIGINFO flag to sigaction(2), then it can obtain this data via the si_value field of the siginfo_t structure passed as the second argument to the handler. Furthermore, the si_code field of that structure will be set to SI_QUEUE.

RETURN VALUE

On success, sys_rt_sigqueueinfo() returns 0, indicating that the signal was successfully queued to the receiving proces. Otherwise, one of the following errors is returned.

ERRORS

-EAGAIN

The limit of signals which may be queued has been reached.

-EINVAL

sig was invalid.

-ESRCH

No process has a PID matching pid.

-EPERM

The process does not have permission to send the signal to the receiving process.

-EFAULT

memory error.

NOTES

If this function results in the sending of a signal to the process that invoked it, and that signal was not blocked by the calling thread, and no other threads were willing to handle this signal (either by having it unblocked, or by waiting for it using sigwait(3)), then at least some signal must be delivered to this thread before this function returns.

CONFORMING TO

POSIX 1003.1-2001

SEE ALSO

kill(2), sigaction(2), signal(2), sigwait(3), signal(7), sigqueue(2)

NAME

rt_sigqueueinfo, rt_tgsigqueueinfo − queue a signal and data

SYNOPSIS

int rt_sigqueueinfo(pid_t tgid, int sig, siginfo_t *uinfo);

int rt_tgsigqueueinfo(pid_t tgid, pid_t tid, int sig,
siginfo_t *
uinfo);

DESCRIPTION

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 uinfo 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:
si_code

This must be one of the SI_* codes in the kernel source file include/asm-generic/siginfo.h, with the restriction that the code must be negative (i.e., cannot be SI_USER, which is used by the kernel to indicate a signal sent by kill(2)) and cannot (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.

The rt_tgsigueueinfo() system call is like rt_sigueueinfo(), 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.

RETURN VALUE

On success, these system calls return 0. On error, they return −1 and errno is set to indicate the error.

ERRORS

EAGAIN

The limit of signals which may be queued has been reached. (See signal(7) for further information.)

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). Or: uinfo->si_code is invalid.

ESRCH

rt_sigqueinfo(): No thread group matching tgid was found.

rt_rtsigqueinfo(): No thread matching tgid and tid was found.

VERSIONS

The rt_sigqueueinfo() system call was added to Linux in version 2.2. The rt_tgsigqueueinfo() system call was added to Linux in version 2.6.31.

CONFORMING TO

These system calls are Linux-specific.

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.

As with kill(2), the null signal (0) can be used to check if the specified process or thread exists.

SEE ALSO

kill(2), sigaction(2), sigprocmask(2), tgkill(2), pthread_sigqueue(3), sigqueue(3), signal(7)

COLOPHON

This page is part of release 3.35 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://man7.org/linux/man-pages/.






Opportunity


Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.





Free Software


Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.


Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.





Free Books


The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.


Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.





Education


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.


Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.