1MQ_UNLINK(3P) POSIX Programmer's Manual MQ_UNLINK(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 mq_unlink — remove a message queue (REALTIME)
13
15 #include <mqueue.h>
16
17 int mq_unlink(const char *name);
18
20 The mq_unlink() function shall remove the message queue named by the
21 string name. If one or more processes have the message queue open when
22 mq_unlink() is called, destruction of the message queue shall be post‐
23 poned until all references to the message queue have been closed. How‐
24 ever, the mq_unlink() call need not block until all references have
25 been closed; it may return immediately.
26
27 After a successful call to mq_unlink(), reuse of the name shall subse‐
28 quently cause mq_open() to behave as if no message queue of this name
29 exists (that is, mq_open() will fail if O_CREAT is not set, or will
30 create a new message queue if O_CREAT is set).
31
33 Upon successful completion, the function shall return a value of zero.
34 Otherwise, the named message queue shall be unchanged by this function
35 call, and the function shall return a value of -1 and set errno to
36 indicate the error.
37
39 The mq_unlink() function shall fail if:
40
41 EACCES Permission is denied to unlink the named message queue.
42
43 EINTR The call to mq_unlink() blocked waiting for all references to
44 the named message queue to be closed and a signal interrupted
45 the call.
46
47 ENOENT The named message queue does not exist.
48
49 The mq_unlink() function may fail if:
50
51 ENAMETOOLONG
52 The length of the name argument exceeds {_POSIX_PATH_MAX} on
53 systems that do not support the XSI option or exceeds
54 {_XOPEN_PATH_MAX} on XSI systems, or has a pathname component
55 that is longer than {_POSIX_NAME_MAX} on systems that do not
56 support the XSI option or longer than {_XOPEN_NAME_MAX} on XSI
57 systems. A call to mq_unlink() with a name argument that con‐
58 tains the same message queue name as was previously used in a
59 successful mq_open() call shall not give an [ENAMETOOLONG]
60 error.
61
62 The following sections are informative.
63
65 None.
66
68 None.
69
71 None.
72
74 A future version might require the mq_open() and mq_unlink() functions
75 to have semantics similar to normal file system operations.
76
78 mq_close(), mq_open(), msgctl(), msgget(), msgrcv(), msgsnd()
79
80 The Base Definitions volume of POSIX.1‐2017, <mqueue.h>
81
83 Portions of this text are reprinted and reproduced in electronic form
84 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
85 table Operating System Interface (POSIX), The Open Group Base Specifi‐
86 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
87 Electrical and Electronics Engineers, Inc and The Open Group. In the
88 event of any discrepancy between this version and the original IEEE and
89 The Open Group Standard, the original IEEE and The Open Group Standard
90 is the referee document. The original Standard can be obtained online
91 at http://www.opengroup.org/unix/online.html .
92
93 Any typographical or formatting errors that appear in this page are
94 most likely to have been introduced during the conversion of the source
95 files to man page format. To report such errors, see https://www.ker‐
96 nel.org/doc/man-pages/reporting_bugs.html .
97
98
99
100IEEE/The Open Group 2017 MQ_UNLINK(3P)