![]() |
![]() |
![]() |
Send a message to a channel
#include <sys/neutrino.h> int MsgSendsv( int coid, const void* smsg, int sbytes, const iov_t* riov, int rparts ); int MsgSendsv_r( int coid, const void* smsg, int sbytes, const iov_t* riov, int rparts );
libc
The MsgSendsv() and MsgSendsv_r() functions are identical except in the way they indicate errors. See the Returns section for details.
These kernel calls send a message to a process's channel identified by coid. The connection coid is established by calling ConnectAttach(). The send data is taken from the buffer pointed to by smsg. The reply is placed in the array of buffers pointed to by riov. The number of bytes sent is given by sbytes, while the number of elements in the reply array is given by rparts.
The number of bytes transferred is the minimum of that specified by both the sender and the receiver. The send data isn't allowed to overflow the receive buffer area provided by the receiver. The reply data isn't allowed to overflow the reply buffer area provided.
The sending thread becomes blocked waiting for a reply. If the receiving process has a thread which is RECEIVE-blocked on the channel, the transfer of data into its address space occurs immediately and the receiving thread is unblocked and made ready to run. The sending thread becomes REPLY-blocked. If there's no waiting threads on the channel, the sending thread becomes SEND-blocked and placed in a queue (perhaps with other threads). In this case the actual transfer of data doesn't occur until a receiving thread receives on the channel. At this point, the sending thread becomes REPLY-blocked.
MsgSendsv() is a cancellation point for the ThreadCancel() kernel call; MsgSendsvnc() isn't.
The only difference between the MsgSendsv() and MsgSendsv_r() functions is the way they indicate errors:
Safety: | |
---|---|
Cancellation point | Yes |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
ConnectAttach(),
MsgReceive(),
MsgReceivev(),
TimerTimeout(),
and all of the MsgSend*() functions
![]() |
![]() |
![]() |