Merge branch 'vendor/OPENSSL'
[dragonfly.git] / lib / librt / mq_setattr.2
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
22 The
23 .Fn mq_setattr
24 function sets attributes associated with the open message queue
25 description referenced by the message queue descriptor specified by
26 .Fa mqdes .
27 .Pp
28 The message queue attributes corresponding to the following members
29 defined in the
30 .Vt mq_attr
31 structure 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
35 The value of this member is the bitwise-logical OR of zero or more of
36 .Dv O_NONBLOCK
37 and any implementation-defined flags.
38 .El
39 .Pp
40 The values of the
41 .Va mq_maxmsg ,
42 .Va mq_msgsize ,
43 and
44 .Va mq_curmsgs
45 members of the
46 .Vt mq_attr
47 structure will be ignored by
48 .Fn mq_setattr .
49 .Pp
50 If
51 .Fa omqstat
52 is
53 .No non- Ns Dv NULL ,
54 the
55 .Fn mq_setattr
56 function will store, in the location referenced by
57 .Fa omqstat
58 the previous message queue attributes and the current queue status.
59 These values are the same as would be returned by a call to
60 .Xr mq_getattr 2
61 at that point.
62 .Sh RETURN VALUES
63 Upon successful completion, the
64 .Fn mq_setattr
65 function returns zero and the attributes of the message queue will
66 have been changed as specified.
67 Otherwise, the message queue attributes are unchanged,
68 and the function returns a value of
69 \-1 and sets the global variable
70 .Va errno
71 to indicate the error.
72 .Sh ERRORS
73 The
74 .Fn mq_setattr
75 function fails if:
76 .Bl -tag -width Er
77 .It Bq Er EBADF
78 The
79 .Fa mqdes
80 argument 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
91 This function conforms to the
92 .St -p1003.1-2001
93 standard.
94 .Sh HISTORY
95 This function first appeared in
96 .Dx 2.5 .
97 .Sh COPYRIGHT
98 Portions of this text are reprinted and reproduced in electronic form
99 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
100 -- Portable Operating System Interface (POSIX), The Open Group Base
101 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
102 Electrical and Electronics Engineers, Inc and The Open Group.
103 In the
104 event of any discrepancy between this version and the original IEEE and
105 The Open Group Standard, the original IEEE and The Open Group Standard
106 is the referee document.
107 The original Standard can be obtained online at
108 http://www.opengroup.org/unix/online.html .