NetBSD/lib/librt/mq_getattr.3

87 lines
2.2 KiB
Groff

.\" $NetBSD: mq_getattr.3,v 1.3 2012/03/15 19:04:47 njoly Exp $
.\"
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved
.\"
.Dd June 7, 2010
.Dt MQ_GETATTR 3
.Os
.Sh NAME
.Nm mq_getattr
.Nd get message queue attributes (REALTIME)
.Sh LIBRARY
.Lb librt
.Sh SYNOPSIS
.In mqueue.h
.Ft int
.Fn mq_getattr "mqd_t mqdes" "struct mq_attr *mqstat"
.Sh DESCRIPTION
The
.Fn mq_getattr
function will obtain status information and attributes of the
message queue and the open message queue description associated
with the message queue descriptor.
.Pp
The
.Fa mqdes
argument specifies a message queue descriptor.
.Pp
The results are returned in the
.Vt mq_attr
structure referenced by the
.Va mqstat
argument.
.Pp
Upon return, the following members have the values associated with
the open message queue description as set when the message queue was
opened and as modified by subsequent
.Xr mq_setattr 3
calls:
.Va mq_flags .
.Pp
The following attributes of the message queue will be returned as set
at message queue creation:
.Va mq_maxmsg ,
.Va mq_msgsize .
.Pp
Upon return, the following members within the
.Vt mq_attr
structure referenced by the
.Fa mqstat
argument will be set to the current state of the message queue:
.Bl -tag -width mq_curmsgs
.It Va mq_curmsgs
The number of messages currently on the queue.
.El
.Sh RETURN VALUES
.Rv -std mq_getattr
.Sh ERRORS
The
.Fn mq_getattr
function may fail if:
.Bl -tag -width Er
.It Bq Er EBADF
The mqdes argument is not a valid message queue descriptor.
.El
.Sh SEE ALSO
.Xr mq 3 ,
.Xr mq_setattr 3
.Sh STANDARDS
This function conforms to the
.St -p1003.1-2001
standard.
.Sh HISTORY
This function first appeared in
.Nx 5.0 .
.Sh COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
-- Portable Operating System Interface (POSIX), The Open Group Base
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group.
In the
event of any discrepancy between this version and the original IEEE and
The Open Group Standard, the original IEEE and The Open Group Standard
is the referee document.
The original Standard can be obtained online at
.Lk http://www.opengroup.org/unix/online.html .