Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man3c / mq_close.3c
blob5b67529e262297c1b44b2e087edc2c6d5bb074bf
1 '\" te
2 .\" Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved
3 .\" Copyright 1989 AT&T
4 .\" Portions Copyright (c) 1992, X/Open Company Limited  All Rights Reserved
5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
6 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
8 .\"  This notice shall appear on any product containing this material.
9 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
10 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
11 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
12 .TH MQ_CLOSE 3C "Feb 5, 2008"
13 .SH NAME
14 mq_close \- close a message queue
15 .SH SYNOPSIS
16 .LP
17 .nf
18 #include <mqueue.h>
20 \fBint\fR \fBmq_close\fR(\fBmqd_t\fR \fImqdes\fR);
21 .fi
23 .SH DESCRIPTION
24 .sp
25 .LP
26 The \fBmq_close()\fR function removes the association between the message queue
27 descriptor, \fImqdes\fR, and its message queue. The results of using this
28 message queue descriptor after successful return from this \fBmq_close()\fR,
29 and until the return of this message queue descriptor from a subsequent
30 \fBmq_open\fR(3C), are undefined.
31 .sp
32 .LP
33 If the process (or thread) has successfully attached a notification request to
34 the message queue via this \fImqdes\fR, this attachment is removed and the
35 message queue is available for another process to attach for notification.
36 .SH RETURN VALUES
37 .sp
38 .LP
39 Upon successful completion, \fBmq_close()\fR returns \fB0\fR; otherwise, the
40 function returns \fB\(mi1\fR and sets \fBerrno\fR to indicate the error
41 condition.
42 .SH ERRORS
43 .sp
44 .LP
45 The  \fBmq_close()\fR function will fail if:
46 .sp
47 .ne 2
48 .na
49 \fB\fBEBADF\fR \fR
50 .ad
51 .RS 11n
52 The \fImqdes\fR argument is an invalid message queue descriptor.
53 .RE
55 .sp
56 .ne 2
57 .na
58 \fB\fBENOSYS\fR \fR
59 .ad
60 .RS 11n
61 The \fBmq_open()\fR function is not supported by the system.
62 .RE
64 .SH ATTRIBUTES
65 .sp
66 .LP
67 See \fBattributes\fR(5) for descriptions of the following attributes:
68 .sp
70 .sp
71 .TS
72 box;
73 c | c
74 l | l .
75 ATTRIBUTE TYPE  ATTRIBUTE VALUE
77 Interface Stability     Committed
79 MT-Level        MT-Safe
81 Standard        See \fBstandards\fR(5).
82 .TE
84 .SH SEE ALSO
85 .sp
86 .LP
87 \fBmqueue.h\fR(3HEAD), \fBmq_notify\fR(3C), \fBmq_open\fR(3C),
88 \fBmq_unlink\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
89 .SH NOTES
90 .sp
91 .LP
92 Solaris 2.6 was the first release to support the Asynchronous Input and Output
93 option. Prior to this release, this function always returned \fB\(mi1\fR and
94 set \fBerrno\fR to \fBENOSYS\fR.