RT_TBX_INIT(8)

NAME
rt_tbx_init - initializes a typed mailbox

SYNOPSIS
#include <rtai_sched.h>

int rt_tbx_init(TBX *tbx, int size, int flags);

DESCRIPTION
rt_tbx_init initializes a typed mailbox of size size. tbx has to point to a statically allocated structure. flags it must be set to PRIO_Q for priority order or FIFO_Q for FIFO order.

Typed mailboxes are a more powerful (but also heavier) alternative to standard mailboxes MBX. Typed mailboxes permits message broadcasting with rt_tbx_broadcast and urgent messages delivering with rt_tbx_urgent Moreover it is possible to specify the desired queuing order when creating them. While entering TBX sizes please take in count that, when a message is written in a TBX, a 1-byte type field is appended to it.

RETURN VALUES
On success 0 is returned. On failure a negative value is returned as described below.

ERRORS
-EINVAL Space could not be allocated for the mailbox buffer.

SEE ALSO
rt_mbx_init