1mq_getattr(3C) Standard C Library Functions mq_getattr(3C)
2
3
4
6 mq_getattr - get message queue attributes
7
9 #include <mqueue.h>
10
11 int mq_getattr(mqd_t mqdes, struct mq_attr *mqstat);
12
13
15 The mqdes argument specifies a message queue descriptor. The
16 mq_getattr() function is used to get status information and attributes
17 of the message queue and the open message queue description associated
18 with the message queue descriptor. The results are returned in the
19 mq_attr structure referenced by the mqstat argument.
20
21
22 Upon return, the following members will have the values associated with
23 the open message queue description as set when the message queue was
24 opened and as modified by subsequent mq_setattr(3C) calls:
25
26 mq_flags message queue flags
27
28
29
30 The following attributes of the message queue are returned as set at
31 message queue creation:
32
33 mq_maxmsg maximum number of messages
34
35
36 mq_msgsize maximum message size
37
38
39 mq_curmsgs number of messages currently on the queue.
40
41
43 Upon successful completion, the mq_getattr() function returns 0. Other‐
44 wise, the function returns −1 and sets errno to indicate the error.
45
47 The mq_getattr() function will fail if:
48
49 EBADF The mqdes argument is not a valid message queue descriptor.
50
51
52 ENOSYS The mq_getattr() function is not supported by the system.
53
54
56 See attributes(5) for descriptions of the following attributes:
57
58
59
60
61 ┌─────────────────────────────┬─────────────────────────────┐
62 │ATTRIBUTE TYPE │ATTRIBUTE VALUE │
63 ├─────────────────────────────┼─────────────────────────────┤
64 │Interface Stability │Committed │
65 ├─────────────────────────────┼─────────────────────────────┤
66 │MT-Level │MT-Safe │
67 ├─────────────────────────────┼─────────────────────────────┤
68 │Standard │See standards(5). │
69 └─────────────────────────────┴─────────────────────────────┘
70
72 msgctl(2), msgget(2), msgrcv(2), msgsnd(2), mqueue.h(3HEAD),
73 mq_open(3C), mq_send(3C), mq_setattr(3C), attributes(5), standards(5)
74
76 Solaris 2.6 was the first release to support the Asynchronous Input and
77 Output option. Prior to this release, this function always returned −1
78 and set errno to ENOSYS.
79
80
81
82SunOS 5.11 5 Feb 2008 mq_getattr(3C)