Operating systems, development tools, and professional services
for connected embedded systems
for connected embedded systems
![]() |
![]() |
![]() |
![]() |
asyncmsg_connect_attach()
Establish a connection between a process and a channel
Synopsis:
#include <sys/neutrino.h>
#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.
- 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 value of the connection ID.
- flags
- Flags that specify the type and attributes of the connection:
- _NTO_COF_NOSHARE
- User wants to use its own buffer; otherwise the user 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
- The connection attributes. If call_back is not NULL, this function will be called when an error occurs during send (after asyncmsg_put() returns) with an error number in err and the faulted buffer in buff. If the user uses its own buffer, this function will also be called when a buffer is empty, with err being EOK.
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 on success; 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:
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | No |
| Thread | Yes |
See also:
asyncmsg_channel_create(), asyncmsg_channel_destroy(), asyncmsg_connect_attr(), asyncmsg_connect_detach(), asyncmsg_flush(), asyncmsg_free(), asyncmsg_get(), asyncmsg_malloc(), asyncmsg_put(), asyncmsg_putv()
Asynchronous Messaging Technote
![]() |
![]() |
![]() |
![]() |

![[Previous]](../prev.gif)
![[Contents]](../contents.gif)
![[Index]](../keyword_index.gif)
![[Next]](../next.gif)