2 .\" Hey Emacs! This file is -*- nroff -*- source.
4 .\" Copyright (C) 2006 Michael Kerrisk <mtk-manpages@gmx.net>
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date. The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein.
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .TH MQ_GETATTR 3 2006-02-25 "Linux 2.6.16" "Linux Programmer's Manual"
25 mq_getattr, mq_setattr \- get/set message queue attributes
28 .B #include <mqueue.h>
30 .BI "mqd_t mq_getattr(mqd_t " mqdes ", struct mq_attr *" attr );
31 .BI "mqd_t mq_setattr(mqd_t " mqdes ", struct mq_attr *" newattr ","
32 .BI " struct mq_attr *" oldattr );
38 respectively retrieve and modify attributes of the message queue
39 referred to by the descriptor
45 structure in the buffer pointed by
47 This structure is defined as:
52 long mq_flags; /* Flags: 0 or O_NONBLOCK */
53 long mq_maxmsg; /* Max. # of messages on queue */
54 long mq_msgsize; /* Max. message size (bytes) */
55 long mq_curmsgs; /* # of messages currently in queue */
62 field contains flags associated with the open message queue description.
63 This field is initialised when the queue is created by
65 The only flag that can appear in this field is
72 fields are set when the message queue is created by
76 field is an upper limit on the number of messages
77 that may be placed on the queue using
81 field is an upper limit on the size of messages
82 that may be placed on the queue.
83 Both of these fields must have a value greater than zero.
86 files that place ceilings on the values for these fields are described in
91 field returns the number of messages currently held in the queue.
94 sets message queue attributes using information supplied in the
96 structure pointed to by
98 The only attribute that can be modified is the setting of the
108 then the buffer that it points to is used to return an
110 structure that contains the same information that is returned by
117 return 0; on error, \-1 is returned, with
119 set to indicate the error.
123 The descriptor specified in
129 contained set bits other than