1MQ_CLOSE(3P) POSIX Programmer's Manual MQ_CLOSE(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_close — close a message queue (REALTIME)
13
15 #include <mqueue.h>
16
17 int mq_close(mqd_t mqdes);
18
20 The mq_close() function shall remove the association between the mes‐
21 sage queue descriptor, mqdes, and its message queue. The results of
22 using this message queue descriptor after successful return from this
23 mq_close(), and until the return of this message queue descriptor from
24 a subsequent mq_open(), are undefined.
25
26 If the process has successfully attached a notification request to the
27 message queue via this mqdes, this attachment shall be removed, and the
28 message queue is available for another process to attach for notifica‐
29 tion.
30
32 Upon successful completion, the mq_close() function shall return a
33 value of zero; otherwise, the function shall return a value of -1 and
34 set errno to indicate the error.
35
37 The mq_close() function shall fail if:
38
39 EBADF The mqdes argument is not a valid message queue descriptor.
40
41 The following sections are informative.
42
44 None.
45
47 None.
48
50 None.
51
53 None.
54
56 mq_open(), mq_unlink(), msgctl(), msgget(), msgrcv(), msgsnd()
57
58 The Base Definitions volume of POSIX.1‐2017, <mqueue.h>
59
61 Portions of this text are reprinted and reproduced in electronic form
62 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
63 table Operating System Interface (POSIX), The Open Group Base Specifi‐
64 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
65 Electrical and Electronics Engineers, Inc and The Open Group. In the
66 event of any discrepancy between this version and the original IEEE and
67 The Open Group Standard, the original IEEE and The Open Group Standard
68 is the referee document. The original Standard can be obtained online
69 at http://www.opengroup.org/unix/online.html .
70
71 Any typographical or formatting errors that appear in this page are
72 most likely to have been introduced during the conversion of the source
73 files to man page format. To report such errors, see https://www.ker‐
74 nel.org/doc/man-pages/reporting_bugs.html .
75
76
77
78IEEE/The Open Group 2017 MQ_CLOSE(3P)