1.\" $NetBSD: mq_getattr.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_GETATTR 3 7.Os 8.Sh NAME 9.Nm mq_getattr 10.Nd get message queue attributes (REALTIME) 11.Sh LIBRARY 12.Lb librt 13.Sh SYNOPSIS 14.In mqueue.h 15.Ft int 16.Fn mq_getattr "mqd_t mqdes" "struct mq_attr *mqstat" 17.Sh DESCRIPTION 18The 19.Fn mq_getattr 20function will obtain status information and attributes of the 21message queue and the open message queue description associated 22with the message queue descriptor. 23.Pp 24The 25.Fa mqdes 26argument specifies a message queue descriptor. 27.Pp 28The results are returned in the 29.Vt mq_attr 30structure referenced by the 31.Va mqstat 32argument. 33.Pp 34Upon return, the following members have the values associated with 35the open message queue description as set when the message queue was 36opened and as modified by subsequent 37.Xr mq_setattr 3 38calls: 39.Va mq_flags . 40.Pp 41The following attributes of the message queue will be returned as set 42at message queue creation: 43.Va mq_maxmsg , 44.Va mq_msgsize . 45.Pp 46Upon return, the following members within the 47.Vt mq_attr 48structure referenced by the 49.Fa mqstat 50argument will be set to the current state of the message queue: 51.Bl -tag -width mq_curmsgs 52.It Va mq_curmsgs 53The number of messages currently on the queue. 54.El 55.Sh RETURN VALUES 56.Rv -std mq_getattr 57.Sh ERRORS 58The 59.Fn mq_getattr 60function may fail if: 61.Bl -tag -width Er 62.It Bq Er EBADF 63The mqdes argument is not a valid message queue descriptor. 64.El 65.Sh SEE ALSO 66.Xr mq 3 , 67.Xr mq_setattr 3 68.Sh STANDARDS 69This function conforms to the 70.St -p1003.1-2001 71standard. 72.Sh HISTORY 73This function first appeared in 74.Nx 5.0 . 75.Sh COPYRIGHT 76Portions of this text are reprinted and reproduced in electronic form 77from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology 78-- Portable Operating System Interface (POSIX), The Open Group Base 79Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of 80Electrical and Electronics Engineers, Inc and The Open Group. 81In the 82event of any discrepancy between this version and the original IEEE and 83The Open Group Standard, the original IEEE and The Open Group Standard 84is the referee document. 85The original Standard can be obtained online at 86.Lk http://www.opengroup.org/unix/online.html . 87