1178effabfd5fafcec5ad270c606f9f7319ae728
[dragonfly.git] / lib / librt / mq_getattr.2
1 .\"     $NetBSD: mq_getattr.3,v 1.1 2009/01/05 21:19:49 rmind Exp $
2 .\"
3 .\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved
4 .\"
5 .Dd August 19, 2009
6 .Dt MQ_GETATTR 2
7 .Os
8 .Sh NAME
9 .Nm mq_getattr
10 .Nd get message queue attributes (REALTIME)
11 .Sh LIBRARY
12 .Lb librt
13 .Sh SYNOPSIS
14 .In mqueue.h
15 .Ft int
16 .Fn mq_getattr "mqd_t mqdes" "struct mq_attr *mqstat"
17 .Sh DESCRIPTION
18 The
19 .Fn mq_getattr
20 function will obtain status information and attributes of the
21 message queue and the open message queue description associated
22 with the message queue descriptor.
23 .Pp
24 The
25 .Fa mqdes
26 argument specifies a message queue descriptor.
27 .Pp
28 The results are returned in the
29 .Vt mq_attr
30 structure referenced by the
31 .Va mqstat
32 argument.
33 .Pp
34 Upon return, the following members have the values associated with
35 the open message queue description as set when the message queue was
36 opened and as modified by subsequent
37 .Xr mq_setattr 3
38 calls:
39 .Va mq_flags .
40 .Pp
41 The following attributes of the message queue will be returned as set
42 at message queue creation:
43 .Va mq_maxmsg ,
44 .Va mq_msgsize .
45 .Pp
46 Upon return, the following members within the
47 .Vt mq_attr
48 structure referenced by the
49 .Fa mqstat
50 argument will be set to the current state of the message queue:
51 .Bl -tag -width mq_curmsgs
52 .It Va mq_curmsgs
53 The number of messages currently on the queue.
54 .El
55 .Sh RETURN VALUES
56 .Rv -std mq_getattr
57 .Sh ERRORS
58 The
59 .Fn mq_getattr
60 function may fail if:
61 .Bl -tag -width Er
62 .It Bq Er EBADF
63 The mqdes argument is not a valid message queue descriptor.
64 .El
65 .Sh SEE ALSO
66 .Xr mq_close 3 ,
67 .Xr mq_notify 3 ,
68 .Xr mq_open 3 ,
69 .Xr mq_receive 3 ,
70 .Xr mq_send 3 ,
71 .Xr mq_setattr 3 ,
72 .Xr mq_unlink 3
73 .Sh STANDARDS
74 This function conforms to the
75 .St -p1003.1-2001
76 standard.
77 .Sh HISTORY
78 This function first appeared in
79 .Nx 5.0 .
80 .Sh COPYRIGHT
81 Portions of this text are reprinted and reproduced in electronic form
82 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
83 -- Portable Operating System Interface (POSIX), The Open Group Base
84 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
85 Electrical and Electronics Engineers, Inc and The Open Group.
86 In the
87 event of any discrepancy between this version and the original IEEE and
88 The Open Group Standard, the original IEEE and The Open Group Standard
89 is the referee document.
90 The original Standard can be obtained online at
91 http://www.opengroup.org/unix/online.html .