asyncmsg_channel_create()

Create an asynchronous message channel

Synopsis:

#include <errno.h>
#include <stdlib.h> 
#include <sys/neutrino.h>
#include <sys/asyncmsg.h>

int asyncmsg_channel_create;
            (unsigned flags, mode_t mode, size_t buffer_size,
            unsigned max_num_buffer, const struct sigevent *ev

int (*recvbuf_callback) (size_t bufsize, unsigned num_bufs,
     void *bufs[], int flags));   

Arguments:

flags
Flags that specify the type and attributes of the channel:

mode
Access the permission of the channel. This is the same as the permission of a file.
buffer_size
The size of each buffer used to store messages.
max_num_buffer
The maximum number of buffers to be allocated. A size of 0 means there's no buffer.
ev
The event to be sent for notification. When the ev argument is not NULL, a sigevent ev delivers a message when available, for a queue that was previously empty.
recvbuf_callback
A callback function used by the library to allocate the buffer for incoming messages, or free buffers, if the channel is destroyed. If the callback is NULL, the library will use malloc() and free() instead.

Library:

libasyncmsg

Use the -l asyncmsg option to qcc to link against this library.

Description:

The asyncmsg_channel_create() function creates an asynchronous message channel.

Returns:

The channel ID of the newly created channel, or -1 if an error has occurred (errno is set).

Errors:

EAGAIN
All kernel channel objects are in use.
EINVAL
Attach to a synchronous message channel.

Classification:

QNX Neutrino

Safety:
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes

See also:

asyncmsg_channel_destroy(), asyncmsg_connect_attach(), asyncmsg_connect_attr(), asyncmsg_connect_detach(), asyncmsg_flush(), asyncmsg_free(), asyncmsg_get(), asyncmsg_malloc(), asyncmsg_put(), asyncmsg_putv()

ChannelCreate()

Asynchronous Messaging Technote