mq_notify.3: Add "C library/kernel ABI differences" subsection

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2015-04-06 10:35:29 +02:00
parent 4c33c15ad3
commit c5aee02706
1 changed files with 22 additions and 0 deletions

View File

@ -173,6 +173,28 @@ notifications for the queue
.IR mqdes .
.SH CONFORMING TO
POSIX.1-2001.
.SH NOTES
.\"
.SS C library/kernel ABI differences
In the glibc implementation, the
.BR mq_notify ()
library function is implemented on top of the system call of the same name.
When
.I sevp
is NULL, or specifies a notification mechanism other than
.BR SIGEV_THREAD ,
the library function directly invokes the system call.
For
.BR SIGEV_THREAD ,
much of the implementation resides within the library,
rather than the kernel.
(This is necessarily so,
since the thread involved in handling the notification is one
that must be managed by the C library POSIX threads implementation.)
The implementation involves the use of a raw
.BR netlink (7)
socket and creates a new thread for each notification that is
delivered to the process.
.SH EXAMPLE
The following program registers a notification request for the
message queue named in its command-line argument.