1mq_setattr(3C) Standard C Library Functions mq_setattr(3C)
2
3
4
6 mq_setattr - set/get message queue attributes
7
9 #include <mqueue.h>
10
11 int mq_setattr(mqd_t mqdes, const struct mq_attr *mqstat,
12 struct mq_attr *omqstat);
13
14
16 The mq_setattr() function is used to set attributes associated with the
17 open message queue description referenced by the message queue descrip‐
18 tor specified by mqdes.
19
20
21 The message queue attributes corresponding to the following members
22 defined in the mq_attr structure are set to the specified values upon
23 successful completion of mq_setattr():
24
25 mq_flags The value of this member is either 0 or O_NONBLOCK.
26
27
28
29 The values of mq_maxmsg, mq_msgsize, and mq_curmsgs are ignored by
30 mq_setattr().
31
32
33 If omqstat is non-NULL, mq_setattr() stores, in the location referenced
34 by omqstat, the previous message queue attributes and the current queue
35 status. These values are the same as would be returned by a call to
36 mq_getattr() at that point.
37
39 Upon successful completion, mq_setattr() returns 0 and the attributes
40 of the message queue will have been changed as specified. Otherwise,
41 the message queue attributes are unchanged, and the function returns −1
42 and sets errno to indicate the error.
43
45 The mq_setattr() function will fail if:
46
47 EBADF The mqdes argument is not a valid message queue descriptor.
48
49
50 ENOSYS The mq_setattr() function is not supported by the system.
51
52
54 See attributes(5) for descriptions of the following attributes:
55
56
57
58
59 ┌─────────────────────────────┬─────────────────────────────┐
60 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
61 ├─────────────────────────────┼─────────────────────────────┤
62 │Interface Stability │Committed │
63 ├─────────────────────────────┼─────────────────────────────┤
64 │MT-Level │MT-Safe │
65 ├─────────────────────────────┼─────────────────────────────┤
66 │Standard │See standards(5). │
67 └─────────────────────────────┴─────────────────────────────┘
68
70 msgctl(2), msgget(2), msgrcv(2), msgsnd(2), mq_getattr(3C),
71 mq_open(3C), mq_receive(3C), mq_send(3C), mqueue.h(3HEAD),
72 attributes(5), standards(5)
73
75 Solaris 2.6 was the first release to support the Asynchronous Input and
76 Output option. Prior to this release, this function always returned −1
77 and set errno to ENOSYS.
78
79
80
81SunOS 5.11 5 Feb 2008 mq_setattr(3C)