xref: /freebsd/lib/libsys/mq_setattr.2 (revision 8269e7673cf033aba67dab8264fe719920c70f87)
1*8269e767SBrooks Davis.\" Copyright (c) 2005 David Xu <davidxu@FreeBSD.org>
2*8269e767SBrooks Davis.\" All rights reserved.
3*8269e767SBrooks Davis.\"
4*8269e767SBrooks Davis.\" Redistribution and use in source and binary forms, with or without
5*8269e767SBrooks Davis.\" modification, are permitted provided that the following conditions
6*8269e767SBrooks Davis.\" are met:
7*8269e767SBrooks Davis.\" 1. Redistributions of source code must retain the above copyright
8*8269e767SBrooks Davis.\"    notice(s), this list of conditions and the following disclaimer as
9*8269e767SBrooks Davis.\"    the first lines of this file unmodified other than the possible
10*8269e767SBrooks Davis.\"    addition of one or more copyright notices.
11*8269e767SBrooks Davis.\" 2. Redistributions in binary form must reproduce the above copyright
12*8269e767SBrooks Davis.\"    notice(s), this list of conditions and the following disclaimer in
13*8269e767SBrooks Davis.\"    the documentation and/or other materials provided with the
14*8269e767SBrooks Davis.\"    distribution.
15*8269e767SBrooks Davis.\"
16*8269e767SBrooks Davis.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
17*8269e767SBrooks Davis.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18*8269e767SBrooks Davis.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19*8269e767SBrooks Davis.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
20*8269e767SBrooks Davis.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21*8269e767SBrooks Davis.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22*8269e767SBrooks Davis.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23*8269e767SBrooks Davis.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24*8269e767SBrooks Davis.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25*8269e767SBrooks Davis.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26*8269e767SBrooks Davis.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27*8269e767SBrooks Davis.\"
28*8269e767SBrooks Davis.\" Portions of this text are reprinted and reproduced in electronic form
29*8269e767SBrooks Davis.\" from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology --
30*8269e767SBrooks Davis.\" Portable Operating System Interface (POSIX), The Open Group Base
31*8269e767SBrooks Davis.\" Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of
32*8269e767SBrooks Davis.\" Electrical and Electronics Engineers, Inc and The Open Group.  In the
33*8269e767SBrooks Davis.\" event of any discrepancy between this version and the original IEEE and
34*8269e767SBrooks Davis.\" The Open Group Standard, the original IEEE and The Open Group Standard is
35*8269e767SBrooks Davis.\" the referee document.  The original Standard can be obtained online at
36*8269e767SBrooks Davis.\"	http://www.opengroup.org/unix/online.html.
37*8269e767SBrooks Davis.\"
38*8269e767SBrooks Davis.Dd May 17, 2011
39*8269e767SBrooks Davis.Dt MQ_SETATTR 2
40*8269e767SBrooks Davis.Os
41*8269e767SBrooks Davis.Sh NAME
42*8269e767SBrooks Davis.Nm mq_setattr
43*8269e767SBrooks Davis.Nd "set message queue attributes (REALTIME)"
44*8269e767SBrooks Davis.Sh LIBRARY
45*8269e767SBrooks Davis.Lb librt
46*8269e767SBrooks Davis.Sh SYNOPSIS
47*8269e767SBrooks Davis.In mqueue.h
48*8269e767SBrooks Davis.Ft int
49*8269e767SBrooks Davis.Fo mq_setattr
50*8269e767SBrooks Davis.Fa "mqd_t mqdes"
51*8269e767SBrooks Davis.Fa "const struct mq_attr *restrict mqstat"
52*8269e767SBrooks Davis.Fa "struct mq_attr *restrict omqstat"
53*8269e767SBrooks Davis.Fc
54*8269e767SBrooks Davis.Sh DESCRIPTION
55*8269e767SBrooks DavisThe
56*8269e767SBrooks Davis.Fn mq_setattr
57*8269e767SBrooks Davissystem call sets attributes associated with the open message queue description
58*8269e767SBrooks Davisreferenced by the message queue descriptor specified by
59*8269e767SBrooks Davis.Fa mqdes .
60*8269e767SBrooks DavisThe message queue attributes corresponding to the following members defined
61*8269e767SBrooks Davisin the
62*8269e767SBrooks Davis.Vt mq_attr
63*8269e767SBrooks Davisstructure will be set to the specified values upon successful completion of
64*8269e767SBrooks Davis.Fn mq_setattr :
65*8269e767SBrooks Davis.Bl -tag -width ".Va mq_flags"
66*8269e767SBrooks Davis.It Va mq_flags
67*8269e767SBrooks DavisThe value of this member is zero or
68*8269e767SBrooks Davis.Dv O_NONBLOCK .
69*8269e767SBrooks Davis.El
70*8269e767SBrooks Davis.Pp
71*8269e767SBrooks DavisThe values of the
72*8269e767SBrooks Davis.Va mq_maxmsg , mq_msgsize ,
73*8269e767SBrooks Davisand
74*8269e767SBrooks Davis.Va mq_curmsgs
75*8269e767SBrooks Davismembers of the
76*8269e767SBrooks Davis.Vt mq_attr
77*8269e767SBrooks Davisstructure are ignored by
78*8269e767SBrooks Davis.Fn mq_setattr .
79*8269e767SBrooks Davis.Sh RETURN VALUES
80*8269e767SBrooks DavisUpon successful completion, the function returns a value of zero and the
81*8269e767SBrooks Davisattributes of the message queue will have been changed as specified.
82*8269e767SBrooks Davis.Pp
83*8269e767SBrooks DavisOtherwise, the message queue attributes are unchanged, and the function
84*8269e767SBrooks Davisreturns a value of \-1 and sets the global variable
85*8269e767SBrooks Davis.Va errno
86*8269e767SBrooks Davisto indicate the error.
87*8269e767SBrooks Davis.Sh ERRORS
88*8269e767SBrooks DavisThe
89*8269e767SBrooks Davis.Fn mq_setattr
90*8269e767SBrooks Davissystem call
91*8269e767SBrooks Daviswill fail if:
92*8269e767SBrooks Davis.Bl -tag -width Er
93*8269e767SBrooks Davis.It Bq Er EBADF
94*8269e767SBrooks DavisThe
95*8269e767SBrooks Davis.Fa mqdes
96*8269e767SBrooks Davisargument is not a valid message queue descriptor.
97*8269e767SBrooks Davis.El
98*8269e767SBrooks Davis.Sh SEE ALSO
99*8269e767SBrooks Davis.Xr mq_open 2 ,
100*8269e767SBrooks Davis.Xr mq_send 2 ,
101*8269e767SBrooks Davis.Xr mq_timedsend 2
102*8269e767SBrooks Davis.Sh STANDARDS
103*8269e767SBrooks DavisThe
104*8269e767SBrooks Davis.Fn mq_setattr
105*8269e767SBrooks Davissystem call conforms to
106*8269e767SBrooks Davis.St -p1003.1-2004 .
107*8269e767SBrooks Davis.Sh HISTORY
108*8269e767SBrooks DavisSupport for
109*8269e767SBrooks Davis.Tn POSIX
110*8269e767SBrooks Davismessage queues first appeared in
111*8269e767SBrooks Davis.Fx 7.0 .
112*8269e767SBrooks Davis.Sh COPYRIGHT
113*8269e767SBrooks DavisPortions of this text are reprinted and reproduced in electronic form
114*8269e767SBrooks Davisfrom IEEE Std 1003.1, 2004 Edition, Standard for Information Technology --
115*8269e767SBrooks DavisPortable Operating System Interface (POSIX), The Open Group Base
116*8269e767SBrooks DavisSpecifications Issue 6, Copyright (C) 2001-2004 by the Institute of
117*8269e767SBrooks DavisElectrical and Electronics Engineers, Inc and The Open Group.  In the
118*8269e767SBrooks Davisevent of any discrepancy between this version and the original IEEE and
119*8269e767SBrooks DavisThe Open Group Standard, the original IEEE and The Open Group Standard is
120*8269e767SBrooks Davisthe referee document.  The original Standard can be obtained online at
121*8269e767SBrooks Davishttp://www.opengroup.org/unix/online.html.
122