xref: /dragonfly/lib/librt/mq_setattr.2 (revision 0ca59c34)
1.\"	$NetBSD: mq_setattr.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_SETATTR 2
7.Os
8.Sh NAME
9.Nm mq_setattr
10.Nd set message queue attributes (REALTIME)
11.Sh LIBRARY
12.Lb librt
13.Sh SYNOPSIS
14.In mqueue.h
15.Ft int
16.Fo mq_setattr
17.Fa "mqd_t mqdes"
18.Fa "const struct mq_attr *restrict mqstat"
19.Fa "struct mq_attr *restrict omqstat"
20.Fc
21.Sh DESCRIPTION
22The
23.Fn mq_setattr
24function sets attributes associated with the open message queue
25description referenced by the message queue descriptor specified by
26.Fa mqdes .
27.Pp
28The message queue attributes corresponding to the following members
29defined in the
30.Vt mq_attr
31structure will be set to the specified values upon successful completion of
32.Fn mq_setattr :
33.Bl -tag -width mq_flags
34.It Va mq_flags
35The value of this member is the bitwise-logical OR of zero or more of
36.Dv O_NONBLOCK
37and any implementation-defined flags.
38.El
39.Pp
40The values of the
41.Va mq_maxmsg ,
42.Va mq_msgsize ,
43and
44.Va mq_curmsgs
45members of the
46.Vt mq_attr
47structure will be ignored by
48.Fn mq_setattr .
49.Pp
50If
51.Fa omqstat
52is
53.No non- Ns Dv NULL ,
54the
55.Fn mq_setattr
56function will store, in the location referenced by
57.Fa omqstat
58the previous message queue attributes and the current queue status.
59These values are the same as would be returned by a call to
60.Xr mq_getattr 2
61at that point.
62.Sh RETURN VALUES
63Upon successful completion, the
64.Fn mq_setattr
65function returns zero and the attributes of the message queue will
66have been changed as specified.
67Otherwise, the message queue attributes are unchanged,
68and the function returns a value of
69\-1 and sets the global variable
70.Va errno
71to indicate the error.
72.Sh ERRORS
73The
74.Fn mq_setattr
75function fails if:
76.Bl -tag -width Er
77.It Bq Er EBADF
78The
79.Fa mqdes
80argument is not a valid message queue descriptor.
81.El
82.Sh SEE ALSO
83.Xr mq_close 2 ,
84.Xr mq_getattr 2 ,
85.Xr mq_notify 2 ,
86.Xr mq_open 2 ,
87.Xr mq_receive 2 ,
88.Xr mq_send 2 ,
89.Xr mq_unlink 2
90.Sh STANDARDS
91This function conforms to the
92.St -p1003.1-2001
93standard.
94.Sh HISTORY
95This function first appeared in
96.Dx 2.5 .
97.Sh COPYRIGHT
98Portions of this text are reprinted and reproduced in electronic form
99from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
100-- Portable Operating System Interface (POSIX), The Open Group Base
101Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
102Electrical and Electronics Engineers, Inc and The Open Group.
103In the
104event of any discrepancy between this version and the original IEEE and
105The Open Group Standard, the original IEEE and The Open Group Standard
106is the referee document.
107The original Standard can be obtained online at
108http://www.opengroup.org/unix/online.html .
109