SYNOPSIS
#include <mqueue.h>
#include <time.h>
int mq_timedsend(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned msg_prio, const struct timespec *abs_timeout);
DESCRIPTION
The
When the specified message queue is not full,
If the message queue specified by mqdes is not full
and the queue has the O_NONBLOCK flag set in its
message queue description,
The
The timeout expires when the absolute time specified by
abs_timeout passes, as measured by the clock on
which timeouts are based (that is, when the value of that clock equals
or exceeds abs_timeout), or if abs_timeout
has already been passed when
The resolution of the timeout is the resolution of the clock on which it is based. The <time.h> header defines timespec data type.
This operation never fails with a timeout if there is insufficient room to add the message to the queue immediately. When there is sufficient room in the queue to add the message, the validity of the abs_timeout argument is not checked.
PARAMETERS
- abs_timeout
-
Specifies the maximum wait for sufficient room to become available to add the message to the specified message queue.
- mqdes
-
Specifies the message queue descriptor associated with the message queue to which the message is to be added.
- msg_len
-
Specifies the length, in bytes, of the message to be added to the message queue.
- msg_prio
-
Specifies the priority of the message to be added to the message queue.
- msg_ptr
-
Points to the message to be added to the message queue.
RETURN VALUES
On success, the
- EAGAIN
-
The O_NONBLOCK flag is set in the message queue description associated with mqdes, and the specified message queue is full.
- EBADF
-
mqdes is not a valid message queue descriptor open for writing.
- EINTR
-
A signal interrupted the
mq_send() mq_timedsend() call. - EINVAL
-
The value of msg_prio was outside the valid range.
- EINVAL
-
The process or thread would have blocked, and the abs_timeout argument specified an invalid value.
- EMSGSIZE
-
The value of msg_len exceeds the message size attribute of the message queue.
- ETIMEDOUT
-
The O_NONBLOCK flag was not set when the message queue was opened, but the timeout expired before the message could be added to the queue.
CONFORMANCE
UNIX 03.
MULTITHREAD SAFETY LEVEL
MT-Safe.
PORTING ISSUES
On the NuTCRACKER Platform, the Windows
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_receive() ,mq_setattr() ,mq_timedreceive() ,time()
PTC MKS Toolkit 10.4 Documentation Build 39.