1MQ_CLOSE(3)                Linux Programmer's Manual               MQ_CLOSE(3)
2
3
4

NAME

6       mq_close - close a message queue descriptor
7

SYNOPSIS

9       #include <mqueue.h>
10
11       int mq_close(mqd_t mqdes);
12
13       Link with -lrt.
14

DESCRIPTION

16       mq_close() closes the message queue descriptor mqdes.
17
18       If the calling process has attached a notification request (see (mq_no‐
19       tify(3)) to this message queue via mqdes, then this request is removed,
20       and another process can now attach a notification request.
21

RETURN VALUE

23       On  success  mq_close() returns 0; on error, -1 is returned, with errno
24       set to indicate the error.
25

ERRORS

27       EBADF  The message queue descriptor specified in mqdes is invalid.
28

ATTRIBUTES

30       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
31       tributes(7).
32
33       ┌────────────────────────────────────────────┬───────────────┬─────────┐
34Interface                                   Attribute     Value   
35       ├────────────────────────────────────────────┼───────────────┼─────────┤
36mq_close()                                  │ Thread safety │ MT-Safe │
37       └────────────────────────────────────────────┴───────────────┴─────────┘
38

CONFORMING TO

40       POSIX.1-2001, POSIX.1-2008.
41

NOTES

43       All  open  message  queues are automatically closed on process termina‐
44       tion, or upon execve(2).
45

SEE ALSO

47       mq_getattr(3),  mq_notify(3),  mq_open(3),  mq_receive(3),  mq_send(3),
48       mq_unlink(3), mq_overview(7)
49

COLOPHON

51       This  page  is  part of release 5.13 of the Linux man-pages project.  A
52       description of the project, information about reporting bugs,  and  the
53       latest     version     of     this    page,    can    be    found    at
54       https://www.kernel.org/doc/man-pages/.
55
56
57
58Linux                             2021-03-22                       MQ_CLOSE(3)
Impressum