Manual Pages for Linux CentOS command on man mq_setattr
MyWebUniversity

Manual Pages for Linux CentOS command on man mq_setattr

MQGETATTR(3) Linux Programmer's Manual MQGETATTR(3)

NAME

mqgetattr, mqsetattr - get/set message queue attributes SYNOPSIS

#include int mqgetattr(mqdt mqdes, struct mqattr *attr); int mqsetattr(mqdt mqdes, struct mqattr *newattr, struct mqattr *oldattr);

Link with -lrt. DESCRIPTION mqgetattr() and mqsetattr() respectively retrieve and modify attributes of the message queue referred to by the descriptor mqdes. mqgetattr() returns an mqattr structure in the buffer pointed by attr. This structure is defined as: struct mqattr { long mqflags; /* Flags: 0 or ONONBLOCK */

long mqmaxmsg; /* Max. # of messages on queue */ long mqmsgsize; /* Max. message size (bytes) */

long mqcurmsgs; /* # of messages currently in queue */ }; The mqflags field contains flags associated with the open message queue description. This field is initialized when the queue is created by mqopen(3). The only flag that can appear in this field is ONON‐ BLOCK. The mqmaxmsg and mqmsgsize fields are set when the message queue is created by mqopen(3). The mqmaxmsg field is an upper limit on the number of messages that may be placed on the queue using mqsend(3). The mqmsgsize field is an upper limit on the size of messages that may be placed on the queue. Both of these fields must have a value greater than zero. Two /proc files that place ceilings on the values for these fields are described in mqopen(3). The mqcurmsgs field returns the number of messages currently held in the queue. mqsetattr() sets message queue attributes using information supplied in the mqattr structure pointed to by newattr. The only attribute that can be modified is the setting of the ONONBLOCK flag in mqflags. The other fields in newattr are ignored. If the oldattr field is not NULL, then the buffer that it points to is used to return an mqattr structure that contains the same information that is returned by mqgetattr(). RETURN VALUE

On success mqgetattr() and mqsetattr() return 0; on error, -1 is returned, with errno set to indicate the error. ERRORS EBADF The descriptor specified in mqdes is invalid.

EINVAL newattr->mqflags contained set bits other than ONONBLOCK. ATTRIBUTES For an explanation of the terms used in this section, see attributes(7). ┌───────────────────────────┬───────────────┬─────────┐ │Interface │ Attribute │ Value │ ├───────────────────────────┼───────────────┼─────────┤

│mqgetattr(), mqsetattr() │ Thread safety │ MT-Safe │ └───────────────────────────┴───────────────┴─────────┘ CONFORMING TO

POSIX.1-2001. NOTES On Linux, mqgetattr() and mqsetattr() are library functions layered on top of the mqgetsetattr(2) system call. SEE ALSO mqclose(3), mqnotify(3), mqopen(3), mqreceive(3), mqsend(3), mqunlink(3), mqoverview(7) COLOPHON

This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can

be found at http://www.kernel.org/doc/man-pages/.

Linux 2010-08-29 MQGETATTR(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™