| Samsung Internal API reference 2.0

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

Macros | Typedefs | Functions
Message queue library API

## Macros
#define | MQ_MAX_NAME 1024

## Typedefs
typedef int | mqd_t

## Functions
mqd_t | mq_open (const char *pathname, int flags,...)
| Create new message queue or open an existing queue. More...
int | mq_unlink (const char *pathname)
| Remove specified message queue name. More...
int | mq_close (mqd_t fd)
| Close a message queue descriptor. More...
int | mq_send (mqd_t fd, const char *msg_ptr, size_t msg_len, unsigned msg_prio)
| Send a message to a message queue. More...
ssize_t | mq_receive (mqd_t fd, char *msg_ptr, size_t msg_len, unsigned *msg_prio)
| Receive a message from a message queue. More...

## Detailed Description

## Macro Definition Documentation

#define MQ_MAX_NAME 1024

`#include <mqueue.h>`

max length of the mq name

## Typedef Documentation

mqd_t

`#include <mqueue.h>`

type for message queue functions

## Function Documentation

int mq_close | ( | mqd_t | fd | ) |

`#include <mqueue.h>`

Close a message queue descriptor.

Parameters

  [in] | fd | message queue descriptor

Returns
  0 on success
  -1 with errno on error

mqd_t mq_open | ( | const char * | pathname,
|  | int | flags,
|  |  | ...
| ) |  |

`#include <mqueue.h>`

Create new message queue or open an existing queue.

Parameters

  [in] | pathname | mqueue identifier
  [in] | flags | control flags

Returns
  message queue descriptor on success
  -1 with errno on error

ssize_t mq_receive | ( | mqd_t | fd,
|  | char * | msg_ptr,
|  | size_t | msg_len,
|  | unsigned * | msg_prio
| ) |  |

`#include <mqueue.h>`

Receive a message from a message queue.

Parameters

  [in] | fd | message queue descriptor
  [in,out] | msg_ptr | message pointer
  [in] | msg_len | length of the message
  [in] | msg_prio | priority of the message

Returns
  number of bytes in the received message on success
  -1 with errno on error

int mq_send | ( | mqd_t | fd,
|  | const char * | msg_ptr,
|  | size_t | msg_len,
|  | unsigned | msg_prio
| ) |  |

`#include <mqueue.h>`

Send a message to a message queue.

Parameters

  [in] | fd | message queue descriptor
  [in,out] | msg_ptr | message pointer
  [in] | msg_len | length of the message
  [in] | msg_prio | priority of the message

Returns
  0 on success
  -1 with errno on error

int mq_unlink | ( | const char * | pathname | ) |

`#include <mqueue.h>`

Remove specified message queue name.

Parameters

  [in] | pathname | name of the path

Returns
  0 on success
  -1 with errno on error