1951 leaking a vdev when removing an l2cache device
[unleashed.git] / usr / src / man / man3c / mq_getattr.3c
blob3f72cf15c6d05e343bbb59238b99ab767a7ea251
1 '\" te
2 .\" Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved.
3 .\" Portions Copyright (c) 1992, X/Open Company Limited  All Rights Reserved.
4 .\" 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
5 .\" http://www.opengroup.org/bookstore/.
6 .\" 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.
7 .\"  This notice shall appear on any product containing this material.
8 .\" 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.
9 .\" 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.
10 .\" 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]
11 .TH MQ_GETATTR 3C "Feb 5, 2008"
12 .SH NAME
13 mq_getattr \- get message queue attributes
14 .SH SYNOPSIS
15 .LP
16 .nf
17 #include <mqueue.h>
19 \fBint\fR \fBmq_getattr\fR(\fBmqd_t\fR \fImqdes\fR, \fBstruct mq_attr *\fR\fImqstat\fR);
20 .fi
22 .SH DESCRIPTION
23 .sp
24 .LP
25 The \fImqdes\fR argument specifies a message queue descriptor. The
26 \fBmq_getattr()\fR function is used to get status information and attributes of
27 the message queue and the open message queue description associated with the
28 message queue descriptor. The results are returned in the \fImq_attr\fR
29 structure referenced by the \fImqstat\fR argument.
30 .sp
31 .LP
32 Upon return, the following members will have the values associated with the
33 open message queue description as set when the message queue was opened and as
34 modified by subsequent \fBmq_setattr\fR(3C) calls:
35 .sp
36 .ne 2
37 .na
38 \fB\fBmq_flags\fR\fR
39 .ad
40 .RS 12n
41 message queue flags
42 .RE
44 .sp
45 .LP
46 The following attributes of the message queue are returned as set at message
47 queue creation:
48 .sp
49 .ne 2
50 .na
51 \fB\fBmq_maxmsg\fR\fR
52 .ad
53 .RS 14n
54 maximum number of messages
55 .RE
57 .sp
58 .ne 2
59 .na
60 \fB\fBmq_msgsize\fR\fR
61 .ad
62 .RS 14n
63 maximum message size
64 .RE
66 .sp
67 .ne 2
68 .na
69 \fB\fBmq_curmsgs\fR\fR
70 .ad
71 .RS 14n
72 number of messages currently on the queue.
73 .RE
75 .SH RETURN VALUES
76 .sp
77 .LP
78 Upon successful completion, the \fBmq_getattr()\fR function returns \fB0\fR.
79 Otherwise, the function returns \fB\(mi1\fR and sets \fBerrno\fR to indicate
80 the error.
81 .SH ERRORS
82 .sp
83 .LP
84 The  \fBmq_getattr()\fR function will fail if:
85 .sp
86 .ne 2
87 .na
88 \fB\fBEBADF\fR\fR
89 .ad
90 .RS 10n
91 The \fImqdes\fR argument is not a valid message queue descriptor.
92 .RE
94 .sp
95 .ne 2
96 .na
97 \fB\fBENOSYS\fR\fR
98 .ad
99 .RS 10n
100 The \fBmq_getattr()\fR function is not supported by the system.
103 .SH ATTRIBUTES
106 See \fBattributes\fR(5) for descriptions of the following attributes:
111 box;
112 c | c
113 l | l .
114 ATTRIBUTE TYPE  ATTRIBUTE VALUE
116 Interface Stability     Committed
118 MT-Level        MT-Safe
120 Standard        See \fBstandards\fR(5).
123 .SH SEE ALSO
126 \fBmsgctl\fR(2), \fBmsgget\fR(2), \fBmsgrcv\fR(2), \fBmsgsnd\fR(2),
127 \fBmqueue.h\fR(3HEAD), \fBmq_open\fR(3C), \fBmq_send\fR(3C),
128 \fBmq_setattr\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
129 .SH NOTES
132 Solaris 2.6 was the first release to support the Asynchronous Input and Output
133 option. Prior to this release, this function always returned \fB\(mi1\fR and
134 set \fBerrno\fR to \fBENOSYS\fR.