OSDN Git Service

e8f0d1d8e6a0ccaf70cabc4281661c711a322aa9
[linuxjm/LDP_man-pages.git] / original / man3 / mq_close.3
1 '\" t
2 .\" Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" %%%LICENSE_END
25 .\"
26 .TH MQ_CLOSE 3 2010-08-29 "Linux" "Linux Programmer's Manual"
27 .SH NAME
28 mq_close \- close a message queue descriptor
29 .SH SYNOPSIS
30 .nf
31 .B #include <mqueue.h>
32 .sp
33 .BI "int mq_close(mqd_t " mqdes );
34 .fi
35 .sp
36 Link with \fI\-lrt\fP.
37 .SH DESCRIPTION
38 .BR mq_close ()
39 closes the message queue descriptor
40 .IR mqdes .
41
42 If the calling process has attached a notification request
43 to this message queue via
44 .IR mqdes ,
45 then this request is removed,
46 and another process can now attach a notification request.
47 .SH RETURN VALUE
48 On success
49 .BR mq_close ()
50 returns 0; on error, \-1 is returned, with
51 .I errno
52 set to indicate the error.
53 .SH ERRORS
54 .TP
55 .B EBADF
56 The descriptor specified in
57 .I mqdes
58 is invalid.
59 .SH CONFORMING TO
60 POSIX.1-2001.
61 .SH NOTES
62 All open message queues are automatically closed on process termination,
63 or upon
64 .BR execve (2).
65 .SH SEE ALSO
66 .BR mq_getattr (3),
67 .BR mq_notify (3),
68 .BR mq_open (3),
69 .BR mq_receive (3),
70 .BR mq_send (3),
71 .BR mq_unlink (3),
72 .BR mq_overview (7)
73 .SH COLOPHON
74 This page is part of release 3.64 of the Linux
75 .I man-pages
76 project.
77 A description of the project,
78 and information about reporting bugs,
79 can be found at
80 \%http://www.kernel.org/doc/man\-pages/.