1MQ_CLOSE(3) Linux Programmer's Manual MQ_CLOSE(3)
2
3
4
6 mq_close - close a message queue descriptor
7
9 #include <mqueue.h>
10
11 int mq_close(mqd_t mqdes);
12
13 Link with -lrt.
14
16 mq_close() closes the message queue descriptor mqdes.
17
18 If the calling process has attached a notification request (see
19 (mq_notify(3)) to this message queue via mqdes, then this request is
20 removed, and another process can now attach a notification request.
21
23 On success mq_close() returns 0; on error, -1 is returned, with errno
24 set to indicate the error.
25
27 EBADF The message queue descriptor specified in mqdes is invalid.
28
30 For an explanation of the terms used in this section, see
31 attributes(7).
32
33 ┌───────────┬───────────────┬─────────┐
34 │Interface │ Attribute │ Value │
35 ├───────────┼───────────────┼─────────┤
36 │mq_close() │ Thread safety │ MT-Safe │
37 └───────────┴───────────────┴─────────┘
39 POSIX.1-2001, POSIX.1-2008.
40
42 All open message queues are automatically closed on process termina‐
43 tion, or upon execve(2).
44
46 mq_getattr(3), mq_notify(3), mq_open(3), mq_receive(3), mq_send(3),
47 mq_unlink(3), mq_overview(7)
48
50 This page is part of release 4.16 of the Linux man-pages project. A
51 description of the project, information about reporting bugs, and the
52 latest version of this page, can be found at
53 https://www.kernel.org/doc/man-pages/.
54
55
56
57Linux 2017-09-15 MQ_CLOSE(3)