![]() |
![]() |
![]() |
Get additional information about a message
#include <sys/neutrino.h> int MsgInfo( int rcvid, struct _msg_info* info ); int MsgInfo_r( int rcvid, struct _msg_info* info );
libc
The MsgInfo() and MsgInfo_r() functions are identical except in the way they indicate errors. See the Returns section for details.
These kernel calls store additional information on a received message into info. The rcvid argument is the return value from MsgReceive*().
The parameters returned in the info have at least the following members:
Member | Description |
---|---|
uint32_t nd | The node descriptor of the client machine as viewed by the server. |
uint32_t srcnd | The node descriptor of the server as viewed by the client. |
pid_t pid | The process ID of the sending thread. |
int32_t tid | The thread ID of the sending thread. |
int32_t chid | The channel ID the message was received on. |
int32_t scoid | The server connection ID. |
int32_t coid | The client connection ID. |
int32_t msglen | The number of bytes received. |
int32_t srcmsglen | The length of the source message, in bytes, as sent by MsgSend*(). This may be greater than the value in msglen. This member is only valid if _NTO_CHF_SENDER_LEN was set in the flags argument to ChannelCreate() for the channel that transmitted the message. |
int16_t priority | The priority of the sending thread. |
int16_t flags | The client has an unblock pending _NTO_MI_UNBLOCK_REQ (i.e. a timeout on the send occurred or a signal was delivered and _NTO_CHF_UNBLOCK is set on the channel). |
![]() |
The info->msglen and info->srcmsglen members are valid only until the next MsgRead*() / MsgWrite*() call! |
If msglen is less than srcmsglen, and also less than the receive buffer size, it's a network transaction that requires more reading of data with MsgRead*().
This call doesn't block.
The node descriptor datatype is a magic cookie.
To: | Use this function: |
---|---|
Compare two nd objects | ND_NODE_CMP() |
Convert a nd to text | netmgr_ndtostr() |
Convert text to a nd | netmgr_strtond() |
The only difference between these functions is the way they indicate errors:
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
ChannelCreate(), MsgRead(), MsgReadv(), MsgReceive(), MsgReceivev(), MsgSend(), MsgSendv(), ND_NODE_CMP(), netmgr_ndtostr(), netmgr_remote_nd(), netmgr_strtond()
![]() |
![]() |
![]() |