1.\" $NetBSD: mq_setattr.3,v 1.3 2012/03/15 19:04:47 njoly Exp $ 2.\" 3.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved 4.\" 5.Dd June 7, 2010 6.Dt MQ_SETATTR 3 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 3 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 3 , 84.Xr mq_getattr 3 85.Sh STANDARDS 86This function conforms to the 87.St -p1003.1-2001 88standard. 89.Sh HISTORY 90This function first appeared in 91.Nx 5.0 . 92.Sh COPYRIGHT 93Portions of this text are reprinted and reproduced in electronic form 94from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology 95-- Portable Operating System Interface (POSIX), The Open Group Base 96Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of 97Electrical and Electronics Engineers, Inc and The Open Group. 98In the 99event of any discrepancy between this version and the original IEEE and 100The Open Group Standard, the original IEEE and The Open Group Standard 101is the referee document. 102The original Standard can be obtained online at 103.Lk http://www.opengroup.org/unix/online.html . 104