1mq_close(3)                Library Functions Manual                mq_close(3)
2
3
4

NAME

6       mq_close - close a message queue descriptor
7

LIBRARY

9       Real-time library (librt, -lrt)
10

SYNOPSIS

12       #include <mqueue.h>
13
14       int mq_close(mqd_t mqdes);
15

DESCRIPTION

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

RETURN VALUE

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

ERRORS

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

ATTRIBUTES

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

STANDARDS

41       POSIX.1-2008.
42

HISTORY

44       POSIX.1-2001.
45

NOTES

47       All  open  message  queues are automatically closed on process termina‐
48       tion, or upon execve(2).
49

SEE ALSO

51       mq_getattr(3),  mq_notify(3),  mq_open(3),  mq_receive(3),  mq_send(3),
52       mq_unlink(3), mq_overview(7)
53
54
55
56Linux man-pages 6.04              2023-03-30                       mq_close(3)
Impressum