about summary refs log tree commit diff
path: root/src/mq/mq_notify.c
Commit message (Collapse)AuthorAgeFilesLines
* mq_notify: block all (application) signals in the worker threadRich Felker2023-02-121-0/+5
| | | | | | | | | | | | | | | until the mq notification event arrives, it is mandatory that signals be blocked. otherwise, a signal can be received, and its handler executed, in a thread which does not yet exist on the abstract machine. after the point of the event arriving, having signals blocked is not a conformance requirement but a QoI requirement. while the application can unblock any signals it wants unblocked in the event handler thread, if they did not start out blocked, it could not block them without a race window where they are momentarily unblocked, and this would preclude controlled delivery or other forms of acceptance (sigwait, etc.) anywhere in the application.
* mq_notify: join worker thread before returning in error pathRich Felker2023-02-121-2/+5
| | | | | this avoids leaving behind transient resource consumption whose cleanup is subject to scheduling behavior.
* mq_notify: rework to fix use-after-close/double-close bugsRich Felker2023-02-121-8/+15
| | | | | | | | | | | | | in the error path where the mq_notify syscall fails, the initiating thread may have closed the socket before the worker thread calls recv on it. even in the absence of such a race, if the recv call failed, e.g. due to seccomp policy blocking it, the worker thread could proceed to close, producing a double-close condition. this can all be simplified by moving the mq_notify syscall into the new thread, so that the error case does not require pthread_cancel. now, the initiating thread only needs to read back the error status after waiting for the worker thread to consume its arguments.
* mq_notify: use semaphore instead of barrier to sync args consumptionRich Felker2023-02-111-5/+9
| | | | | semaphores are a much lighter primitive, and more idiomatic with current usage in the code base.
* fix longstanding missing static in mq_notify (namespace pollution)Rich Felker2012-04-291-1/+1
|
* const correctness in mq_notifyRich Felker2011-06-251-1/+1
| | | | why did gcc allow this invalid assignment to compile in the first place?
* implement mq_notifyRich Felker2011-06-071-2/+65
|
* add support for POSIX message queues, except mq_notifyRich Felker2011-06-071-0/+10