RTEMS Logo

RTEMS 4.10.2 On-Line Library


Message Passing Manager mq_unlink - Remove a Message Queue

PREV UP NEXT Bookshelf RTEMS POSIX API User's Guide

16.4.3: mq_unlink - Remove a Message Queue

CALLING SEQUENCE:

#include <mqueue.h>

int mq_unlink(
  const char *name
);

STATUS CODES:

EINVAL - The descriptor does not represent a valid message queue

DESCRIPTION:

The mq_unlink() function removes the named message queue. If the message queue is not open when mq_unlink is called, then the queue is immediately eliminated. Any messages that were on the queue are lost, and the queue can not be opened again. If processes have the queue open when mq_unlink is called, the removal of the queue is delayed until the last process using the queue has finished. However, the name of the message queue is removed so that no other process can open it. Upon successful completion, the function returns a value of zero. Otherwise, the named message queue is not changed by this function call, and the function returns a value of -1 and sets errno to indicate the error.

NOTES:

Calls to mq_open() to re-create the message queue may fail until the message queue is actually removed. However, the mq_unlink() call need not block until all references have been closed; it may return immediately.


PREV UP NEXT Bookshelf RTEMS POSIX API User's Guide

Copyright © 1988-2008 OAR Corporation