18269e767SBrooks Davis.\" Copyright (c) 2021 Fernando Apesteguia <fernape@FreeBSD.org> 28269e767SBrooks Davis.\" 38269e767SBrooks Davis.\" Redistribution and use in source and binary forms, with or without 48269e767SBrooks Davis.\" modification, are permitted provided that the following conditions 58269e767SBrooks Davis.\" are met: 68269e767SBrooks Davis.\" 1. Redistributions of source code must retain the above copyright 78269e767SBrooks Davis.\" notice(s), this list of conditions and the following disclaimer as 88269e767SBrooks Davis.\" the first lines of this file unmodified other than the possible 98269e767SBrooks Davis.\" addition of one or more copyright notices. 108269e767SBrooks Davis.\" 2. Redistributions in binary form must reproduce the above copyright 118269e767SBrooks Davis.\" notice(s), this list of conditions and the following disclaimer in 128269e767SBrooks Davis.\" the documentation and/or other materials provided with the 138269e767SBrooks Davis.\" distribution. 148269e767SBrooks Davis.\" 158269e767SBrooks Davis.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY 168269e767SBrooks Davis.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 178269e767SBrooks Davis.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 188269e767SBrooks Davis.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE 198269e767SBrooks Davis.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 208269e767SBrooks Davis.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 218269e767SBrooks Davis.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 228269e767SBrooks Davis.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 238269e767SBrooks Davis.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 248269e767SBrooks Davis.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 258269e767SBrooks Davis.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 268269e767SBrooks Davis.\" 278269e767SBrooks Davis.\" Portions of this text are reprinted and reproduced in electronic form 288269e767SBrooks Davis.\" from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- 298269e767SBrooks Davis.\" Portable Operating System Interface (POSIX), The Open Group Base 308269e767SBrooks Davis.\" Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of 318269e767SBrooks Davis.\" Electrical and Electronics Engineers, Inc and The Open Group. In the 328269e767SBrooks Davis.\" event of any discrepancy between this version and the original IEEE and 338269e767SBrooks Davis.\" The Open Group Standard, the original IEEE and The Open Group Standard is 348269e767SBrooks Davis.\" the referee document. The original Standard can be obtained online at 358269e767SBrooks Davis.\" http://www.opengroup.org/unix/online.html. 368269e767SBrooks Davis.\" 378269e767SBrooks Davis.Dd February 15, 2021 388269e767SBrooks Davis.Dt MQ_UNLINK 2 398269e767SBrooks Davis.Os 408269e767SBrooks Davis.Sh NAME 418269e767SBrooks Davis.Nm mq_unlink 428269e767SBrooks Davis.Nd "mq_unlink - remove a message queue (REALTIME)" 438269e767SBrooks Davis.Sh LIBRARY 448269e767SBrooks Davis.Lb librt 458269e767SBrooks Davis.Sh SYNOPSIS 468269e767SBrooks Davis.In mqueue.h 478269e767SBrooks Davis.Ft int 488269e767SBrooks Davis.Fn mq_unlink "const char *name" 498269e767SBrooks Davis.Sh DESCRIPTION 508269e767SBrooks DavisThe 518269e767SBrooks Davis.Fn mq_unlink 528269e767SBrooks Davisfunction removes the message queue named by the string 538269e767SBrooks Davis.Fa name . 548269e767SBrooks DavisIf one or more processes have the message queue open when 558269e767SBrooks Davis.Fn mq_unlink 568269e767SBrooks Davisis called, destruction of the message queue will be postponed 578269e767SBrooks Davisuntil all references to the message queue have been closed. 588269e767SBrooks DavisHowever, the 598269e767SBrooks Davis.Fn mq_unlink 608269e767SBrooks Daviscall need not block until all references have been closed; it may return 618269e767SBrooks Davisimmediately. 628269e767SBrooks Davis.Pp 638269e767SBrooks DavisAfter a successful call to 648269e767SBrooks Davis.Fn mq_unlink , 658269e767SBrooks Davisreuse of the name will subsequently cause 668269e767SBrooks Davis.Xr mq_open 2 678269e767SBrooks Davisto behave as if no message queue of this name exists. 688269e767SBrooks Davis.Sh RETURN VALUES 698269e767SBrooks Davis.Rv -std 708269e767SBrooks Davis.Sh ERRORS 718269e767SBrooks DavisThe 728269e767SBrooks Davis.Fn mq_unlink 738269e767SBrooks Davissystem call 748269e767SBrooks Daviswill fail if: 758269e767SBrooks Davis.Bl -tag -width Er 768269e767SBrooks Davis.It Bq Er EACCESS 778269e767SBrooks DavisPermission is denied to unlink the message queue represented by 788269e767SBrooks Davis.Fa name . 798269e767SBrooks Davis.It Bq Er EINVAL 808269e767SBrooks Davis.Fa name 818269e767SBrooks Davisis invalid. 828269e767SBrooks Davis.It Bq Er ENAMETOOLONG 838269e767SBrooks DavisThe length of the 848269e767SBrooks Davis.Fa name 858269e767SBrooks Davisargument exceeds 868269e767SBrooks Davis.Brq Dv PATH_MAX 878269e767SBrooks Davisor 888269e767SBrooks Davisa pathname component is longer than 898269e767SBrooks Davis.Brq Dv NAME_MAX . 908269e767SBrooks Davis.It Bq Er ENOENT 918269e767SBrooks DavisThe message queue does not exist. 928269e767SBrooks Davis.It Bq Er ENOSYS 93*1a720cbeSAlexander Ziaee.Xr mqueuefs 4 948269e767SBrooks Davismodule is neither loaded nor included in the kernel. 958269e767SBrooks Davis.El 968269e767SBrooks Davis.Sh SEE ALSO 978269e767SBrooks Davis.Xr mq_open 2 988269e767SBrooks Davis.Sh STANDARDS 998269e767SBrooks DavisThe 1008269e767SBrooks Davis.Fn mq_unlink 1018269e767SBrooks Davissystem call conforms to 1028269e767SBrooks Davis.St -p1003.1-2004 . 1038269e767SBrooks DavisThe 1048269e767SBrooks Davis.Bq Er EACCESS 1058269e767SBrooks Daviserror code is an extension to the standard. 1068269e767SBrooks Davis.Sh HISTORY 1078269e767SBrooks DavisSupport for POSIX message queues first appeared in 1088269e767SBrooks Davis.Fx 7.0 . 1098269e767SBrooks Davis.Sh COPYRIGHT 1108269e767SBrooks DavisPortions of this text are reprinted and reproduced in electronic form 1118269e767SBrooks Davisfrom IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- 1128269e767SBrooks DavisPortable Operating System Interface (POSIX), The Open Group Base 1138269e767SBrooks DavisSpecifications Issue 6, Copyright (C) 2001-2004 by the Institute of 1148269e767SBrooks DavisElectrical and Electronics Engineers, Inc and The Open Group. 1158269e767SBrooks DavisIn the event of any discrepancy between this version and the original IEEE and 1168269e767SBrooks DavisThe Open Group Standard, the original IEEE and The Open Group Standard is 1178269e767SBrooks Davisthe referee document. 1188269e767SBrooks DavisThe original Standard can be obtained online at 1198269e767SBrooks Davishttp://www.opengroup.org/unix/online.html. 120