Debian Codegraph @

upstream/debian-trixie/man3/mq_close.3

raw
1 '\" t
2 .\" Copyright (C) 2006 Michael Kerrisk <[email protected]>
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH mq_close 3 2024-05-02 "Linux man-pages 6.9.1"
7 .SH NAME
8 mq_close \- close a message queue descriptor
9 .SH LIBRARY
10 Real-time library
11 .RI ( librt ", " \-lrt )
12 .SH SYNOPSIS
13 .nf
14 .B #include <mqueue.h>
15 .P
16 .BI "int mq_close(mqd_t " mqdes );
17 .fi
18 .SH DESCRIPTION
19 .BR mq_close ()
20 closes the message queue descriptor
21 .IR mqdes .
22 .P
23 If the calling process has attached a notification request (see
24 .BR mq_notify (3))
25 to this message queue via
26 .IR mqdes ,
27 then this request is removed,
28 and another process can now attach a notification request.
29 .SH RETURN VALUE
30 On success
31 .BR mq_close ()
32 returns 0; on error, \-1 is returned, with
33 .I errno
34 set to indicate the error.
35 .SH ERRORS
36 .TP
37 .B EBADF
38 The message queue descriptor specified in
39 .I mqdes
40 is invalid.
41 .SH ATTRIBUTES
42 For an explanation of the terms used in this section, see
43 .BR attributes (7).
44 .TS
45 allbox;
46 lbx lb lb
47 l l l.
48 Interface Attribute Value
49 T{
50 .na
51 .nh
52 .BR mq_close ()
53 T} Thread safety MT-Safe
54 .TE
55 .SH STANDARDS
56 POSIX.1-2008.
57 .SH HISTORY
58 POSIX.1-2001.
59 .SH NOTES
60 All open message queues are automatically closed on process termination,
61 or upon
62 .BR execve (2).
63 .SH SEE ALSO
64 .BR mq_getattr (3),
65 .BR mq_notify (3),
66 .BR mq_open (3),
67 .BR mq_receive (3),
68 .BR mq_send (3),
69 .BR mq_unlink (3),
70 .BR mq_overview (7)