#include <mqueue.h>
#include <stddef.h>
Go to the source code of this file.
◆ MQ_MAX_MESSAGES
| #define MQ_MAX_MESSAGES 10 |
Maximum number of messages in the queue.
◆ MQ_MAX_MSG_SIZE
| #define MQ_MAX_MSG_SIZE 2048 |
Maximum size of each message in bytes.
◆ MQ_MSG_BUFFER_SIZE
Buffer size for messages including additional space.
◆ MQ_PERMISSIONS
| #define MQ_PERMISSIONS 0660 |
Default permissions for message queues.
◆ MSG_PRIO_DEFAULT
| #define MSG_PRIO_DEFAULT 10 |
Default priority for messages.
◆ NvPSFMsgQueBlockingMode
| Enumerator |
|---|
| BLOCKING | Blocking mode for operations
|
| NON_BLOCKING | Non-blocking mode for operations
|
NvPSFMsgQueBlockingMode
Definition: posix_msg_que.h:75
@ NON_BLOCKING
Definition: posix_msg_que.h:77
@ BLOCKING
Definition: posix_msg_que.h:76
◆ NvPSFMsgQueEndpointType
| Enumerator |
|---|
| MSG_QUE_RECEIVER | Message queue receiver endpoint
|
| MSG_QUE_SENDER | Message queue sender endpoint
|
| MSG_QUE_BIDIRECTIONAL | |
NvPSFMsgQueEndpointType
Definition: posix_msg_que.h:63
@ MSG_QUE_SENDER
Definition: posix_msg_que.h:65
@ MSG_QUE_RECEIVER
Definition: posix_msg_que.h:64
@ MSG_QUE_BIDIRECTIONAL
Definition: posix_msg_que.h:66
◆ NvPSFMsgQueErr
| Enumerator |
|---|
| NvPSFMSGQ_SUCCESS | Operation was successful
|
| NvPSFMSGQ_FAIL | Operation failed
|
NvPSFMsgQueErr
Definition: posix_msg_que.h:84
@ NvPSFMSGQ_FAIL
Definition: posix_msg_que.h:86
@ NvPSFMSGQ_SUCCESS
Definition: posix_msg_que.h:85
◆ NvPSFMsgQueClose()
Close a message queue.
This function closes the specified message queue descriptor.
- Parameters
-
| mqdes | The message queue descriptor to close. |
- Returns
- A status structure indicating success or failure.
◆ NvPSFMsgQueCreate()
Create a message queue.
This function creates a new POSIX message queue with the specified name and attributes.
- Parameters
-
| name | The name of the message queue (must start with '/'). |
| endpointType | Type of endpoint (sender or receiver). |
| blockingMode | Blocking mode for the queue operations. |
- Returns
- A status structure indicating success or failure.
◆ NvPSFMsgQueReceive()
| NvPSFMsgQueStatus NvPSFMsgQueReceive |
( |
mqd_t |
mqdes, |
|
|
char * |
buffer, |
|
|
size_t |
bufferLen, |
|
|
unsigned int * |
priority |
|
) |
| |
Receive a message from the message queue.
This function receives a message from the specified message queue and stores it in the provided buffer.
- Parameters
-
| mqdes | The message queue descriptor to receive from. |
| buffer | Pointer to the buffer where the received message will be stored. |
| bufferLen | Size of the buffer in bytes. |
| priority | Pointer to an unsigned integer where the priority of the received message will be stored (can be NULL). |
- Returns
- A status structure indicating success or failure and number of bytes received on success.
◆ NvPSFMsgQueSend()
| NvPSFMsgQueStatus NvPSFMsgQueSend |
( |
mqd_t |
mqdes, |
|
|
const char * |
msg, |
|
|
size_t |
msgLen, |
|
|
unsigned int |
priority |
|
) |
| |
Send a message over the message queue.
This function sends a message to the specified message queue with a given priority.
- Parameters
-
| mqdes | The message queue descriptor to send the message to. |
| msg | Pointer to the message to send. |
| msgLen | Length of the message in bytes. |
| priority | Priority of the message (higher values indicate higher priority). |
- Returns
- A status structure indicating success or failure.
◆ NvPSFMsgQueUnlink()
Unlink (delete) a message queue.
This function removes the specified message queue. The queue will be deleted once all processes have closed it.
- Parameters
-
| name | The name of the message queue to unlink (must start with '/'). |
- Returns
- A status structure indicating success or failure.