mq_timedsend - Send a message to a message queue, with a timeout.
mq_timedsend is a function used to send a message to a message queue, with a timeout specified. It has the following arguments: a message queue descriptor, a message pointer, the message length, the priority of the message, and a pointer to a timespec struct containing the timeout. Upon a successful call the message is added to the queue, in the order of priority.
The mq_timedsend call is more efficient than mq_send when the timeout is specified as the latter has to check the queue everytime to see if its gotten full, while the former only has to check the timout. However, if no timeout is specified mq_send should be used instead as it's more efficient.
Additionally, if the message queue descriptor is invalid, mq_timedsend will return an error.
mqd_t[K] - File descriptor of the message queue.
const char*[K] - Pointer to the message to be sent.
size_t[K] - Length of the message.
unsigned int[K] - Priority of the message.
const struct timespec*[K] - Pointer to a timespec struct containing the timeout information.
- K - Originated from kernel-space.
Hook the start of mq_timedsend to measure time and latency of this syscall.
Hook the return of mq_timedsend to measure time and latency of this syscall.
Example Use Case¶
An example use case of this syscall would be when there is an application that needs to send a message with a certain priority, and there is a time limit on when the message needs to be sent.
mq_timedsend is only available for Linux 2.6.7 or later.
This document was automatically generated by OpenAI and needs review. It might not be accurate and might contain errors. The authors of Tracee recommend that the user reads the "events.go" source file to understand the events and their arguments better.