mq_setattr()

set message queue attributes 

Realtime Function


SYNOPSIS

#include <mqueue.h>

int mq_setattr(mqd_t mqdes, const struct mq_attr *restrict mqstat, struct mq_attr *restrict omqstat);


DESCRIPTION

The mq_setattr() function sets the attributes associated with the open message queue description associated with specified the message queue descriptor, mqdes.

When mq_open() completes successfully, the mq_flags member of the mq_attr structure is the bitwise-logical OR of zero or more of the O_NONBLOCK, O_RDWR, O_RDONLY, and O_WRONLY flags.

The values of the mq_maxmsg, mq_msgsize, and mq_curmsgs members of the mq_attr structure are ignored by mq_setattr().

mq_setattr() function stores, in the location pointed to by the omqstat argument, the previous message queue attributes and the current queue status. These values are the same values that would be returned by a mq_getattr() call. If omqstat is NULL, no attributes or status are stored.


PARAMETERS

mqdes 

Specifies a message queue descriptor.

mqstat 

Points to a message queue attributes object.

omqstat 

Points to the message queue attributes object where the previous message queue attributes and the current queue status are stored.


RETURN VALUES

On success, mq_setattr() returns 0 and the attributes of the message queue are changed as specified.

On failure, the message queue attributes are unchanged and mq_setattr() returns -1 and sets errno to one of the following:

EBADF 

mqdes is not a valid message queue descriptor.


CONFORMANCE

UNIX 03.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
mq_open(), mq_send(), mq_timedsend(), msgctl(), msgget(), msgrcv(), msgsnd()


PTC MKS Toolkit 10.3 Documentation Build 39.