tzfile.5, tzselect.8: sync from tzdb upstream
[man-pages.git] / man3 / mq_close.3
blob76358c53bfd8584809dfecca83221ab64e8b509e
1 '\" t
2 .\" Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH mq_close 3 (date) "Linux man-pages (unreleased)"
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 .PP
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 .PP
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 .ad l
45 .nh
46 .TS
47 allbox;
48 lbx lb lb
49 l l l.
50 Interface       Attribute       Value
52 .BR mq_close ()
53 T}      Thread safety   MT-Safe
54 .TE
55 .hy
56 .ad
57 .sp 1
58 .SH STANDARDS
59 POSIX.1-2001, POSIX.1-2008.
60 .SH NOTES
61 All open message queues are automatically closed on process termination,
62 or upon
63 .BR execve (2).
64 .SH SEE ALSO
65 .BR mq_getattr (3),
66 .BR mq_notify (3),
67 .BR mq_open (3),
68 .BR mq_receive (3),
69 .BR mq_send (3),
70 .BR mq_unlink (3),
71 .BR mq_overview (7)