![]() |
![]() |
![]() |
Remove a queue
#include <mqueue.h> int mq_unlink( const char* name );
libc
The mq_unlink() function removes the queue name. If some process has the queue open when the call to mq_unlink() is made, then the actual deletion of the queue is postponed until it has been closed. If a queue exists in the nether-world between unlinking and the actual removal of the queue, then all calls to open queue name fail (even if O_CREAT is present in oflag). Once the queue is deleted, all elements currently on it are freed. Due to the lazy deletion of queues, it's impossible for any process to be blocked on the message queue when it's deleted.
Calling unlink() with a name that resolves to the message queue server's namespace (e.g. /dev/mqueue/my_queue) is analogous to calling mq_unlink() with name set to the last elements of the pathname (e.g. my_queue).
POSIX 1003.1 (Realtime Extensions)
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
![]() |
![]() |
![]() |