asyncmsg_connect_attach()

Establish a connection to be used for asynchronous messages between a process and a channel

CAUTION:
Asynchronous messaging is an experimental feature; for information about the use of experimental software, see the Commercial Software License Agreement (CSLA) or Partner Software License Agreement (PSLA) in the Licensing area of our website, http://www.qnx.com/legal/licensing/.
Note: Asynchronous messaging support is in its own kernel module. In order to use it, you must add [module=async] to the procnto line of your mkifs buildfile.

Synopsis:

#include <sys/asyncmsg.h>

int asyncmsg_connect_attach (
       uint32_t nd,
       pid_t pid,
       int chid,
       unsigned index,
       unsigned flags, 
       const struct _asyncmsg_connection_attr * attr);

Arguments:

nd
The node descriptor of the node on which the process that owns the channel is running.
pid
The process ID of the owner of the channel.
chid
The channel ID, returned by asyncmsg_channel_create(), of the channel to connect to the process.
index
The lowest acceptable connection ID.
flags
Flags that specify the type and attributes of the connection:
_NTO_COF_NOSHARE
The calling application wants to use its own buffer; otherwise, the application gets the buffer from the asyncmsg_malloc() call, fills it in and sends it by calling the asyncmsg_put() function.
_NTO_COF_NONBLOCK
Don't block waiting if all the send headers are in use.
attr
A pointer to an _asyncmsg_connection_attr structure that specifies the connection attributes.

Library:

libasyncmsg

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

Description:

The asyncmsg_connect_attach() function establishes a connection between the calling process and a channel identified by the arguments nd, pid and chid. The system returns the first available connection ID starting at the value specified by the index argument.

Returns:

A connection ID, or -1 if an error occurred (errno is set).

Errors:

EAGAIN
All kernel channel objects are in use.
ESRCH
The node indicated by nd, the process indicated by pid or the channel indicated by chid does not exist.

Classification:

QNX Neutrino

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