Updated: April 19, 2023 |
Unblock a client and set its error code
#include <sys/neutrino.h> int MsgError( int rcvid, int error ); int MsgError_r( int rcvid, int error );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The MsgError() and MsgError_r() kernel calls usually unblock the client's MsgSend*() call and set the client's error code to error. No data is transferred.
These functions are identical except in the way they indicate errors. See the Returns section for details.
The error argument determines how the MsgError*() kernel call affects the client's REPLY-blocked MsgSend*() call:
When a server receives an unblock pulse, it typically can't determine why. When the server calls MsgError*() with an error of -1, it sets the client's error code to whatever error the kernel stored when the unblock pulse was sent.
When a thread that's REPLY-blocked on a channel attempts to unblock before its message is replied to, the kernel associates one of the following error codes with the thread:
Blocking states
None for the local case. In the network case:
Native networking
MsgError() has increased latency when you use it to communicate across a network—the server is now writing the error code to its local lsm-qnet.so, which may need to communicate with the client's lsm-qnet.so to actually transfer the error code.
The only difference between these functions is the way they indicate errors:
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |