Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > M


HP-UX 11i Version 3: February 2007

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index


mq_unlink — unlink a message queue


#include <sys/mqueue.h>

int mq_unlink(const char *name);


The mq_unlink() system call disassociates the queue name, from a message queue specified by the argument, name. After a successful call to mq_unlink(), attempts to open a message queue with the same name will fail, if the flag O_CREAT is not set in oflags.

If there are no processes with existing open descriptors for the message queue, the queue is destroyed. If one or more processes have the message queue open, the removal of the queue is postponed until all descriptors for the queue have been closed.

To use this function, link in the realtime library by specifying -lrt on the compiler or linker command line.

Security Restrictions

Some or all of the actions associated with this system call are subject to compartmentalization restrictions. See compartments(5) for more information.

Some or all of the actions associated with this system call require privileges. See privileges(5).


mq_unlink() returns the following values:


Successful completion.


Failure, errno is set to indicate the error.


If mq_unlink() fails, errno is set to one of the following values:


Permission to unlink the named message queue is denied.


The argument name is not a valid message queue name.


The length of the name string exceeds PATH_MAX bytes, or the length of a (pathname) component of the name string exceeds NAME_MAX bytes while _POSIX_NO_TRUNC is in effect.


The named message queue does not exist.


mq_unlink() is not supported by the implementation.


mq_unlink(): POSIX 1003.1b

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.