1.\" $NetBSD: mq_unlink.3,v 1.1 2009/01/05 21:19:49 rmind Exp $ 2.\" 3.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved 4.\" 5.Dd August 19, 2009 6.Dt MQ_UNLINK 2 7.Os 8.Sh NAME 9.Nm mq_unlink 10.Nd remove a message queue (REALTIME) 11.Sh LIBRARY 12.Lb librt 13.Sh SYNOPSIS 14.In mqueue.h 15.Ft int 16.Fn mq_unlink "const char *name" 17.Sh DESCRIPTION 18The 19.Fn mq_unlink 20function removes the message queue named by the pathname 21.Fa name . 22After a successful call to 23.Fn mq_unlink 24with 25.Fa name , 26a call to 27.Xr mq_open 2 28with 29.Fa name 30fails if the flag 31.Dv O_CREAT 32is not set in 33.Fa flags . 34If one or more processes have the message queue open when 35.Fn mq_unlink 36is called, destruction of the message queue will be postponed until 37all references to the message queue have been closed. 38.Pp 39Calls to 40.Xr mq_open 2 41to recreate the message queue may fail until the message queue is 42actually removed. 43However, the 44.Fn mq_unlink 45call need not block until all references have been closed; 46it may return immediately. 47.Sh RETURN VALUES 48Upon successful completion, the function returns a value of zero. 49Otherwise, the named message queue will be unchanged by this function call, 50and the function returns a value of \-1 and sets the global variable 51.Va errno 52to indicate the error. 53.Sh ERRORS 54The 55.Fn mq_unlink 56function fails if: 57.Bl -tag -width Er 58.It Bq Er EACCES 59Permission is denied to unlink the named message queue. 60.It Bq Er ENAMETOOLONG 61The length of the name argument exceeds 62.Brq Dv PATH_MAX 63or a pathname 64component is longer than 65.Brq Dv NAME_MAX . 66.It Bq Er ENOENT 67The named message queue does not exist. 68.El 69.Sh SEE ALSO 70.Xr mq_close 2 , 71.Xr mq_getattr 2 , 72.Xr mq_notify 2 , 73.Xr mq_open 2 , 74.Xr mq_receive 2 , 75.Xr mq_send 2 , 76.Xr mq_setattr 2 77.Sh STANDARDS 78This function conforms to the 79.St -p1003.1-2001 80standard. 81.Sh HISTORY 82The 83.Fn mq_unlink 84function first appeared in 85.Dx 2.5 . 86.Sh COPYRIGHT 87Portions of this text are reprinted and reproduced in electronic form 88from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology 89-- Portable Operating System Interface (POSIX), The Open Group Base 90Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of 91Electrical and Electronics Engineers, Inc and The Open Group. 92In the 93event of any discrepancy between this version and the original IEEE and 94The Open Group Standard, the original IEEE and The Open Group Standard 95is the referee document. 96The original Standard can be obtained online at 97http://www.opengroup.org/unix/online.html . 98