[Previous] [Contents] [Next]

MsgError(), MsgError_r()

Unblock a client and set its errno

Synopsis:

#include <sys/neutrino.h>

int MsgError( int rcvid,
              int error );

int MsgError_r( int rcvid,
                int error );

Library:

libc

Description:

The MsgError() and MsgError_r() functions are identical except in the way they indicate errors. See the Returns section for details.

These kernel calls unblock the client's MsgSend*() with a -1 return value, and sets the client's errno to error.

No data is transferred when you call MsgError().

The rcvid argument is the return value from MsgReceive*().


Note:

The return error number, ERESTART, causes the sender to immediately call Msgsend*() again. Since the send buffers may overlap, ERESTART shouldn't be used after a MsgWrite().


Blocking states

None. In the network case, lower priority threads may run.

Native networking

The MsgError() function has increased latency when it's used to communicate across a network -- the server is now writing the error code to its local npm-qnet, which may need to communicate with the client's npm-qnet to actually transfer the error code.

Returns:

The only difference between these functions is the way they indicate errors:

MsgError()
If an error occurs, -1 is returned and errno is set. Any other value returned indicates success.
MsgError_r()
EOK is returned on success. This function does NOT set errno. If an error occurs, any value in the Errors section may be returned.

Errors:

ESRCH
The thread indicated by rcvid doesn't exist.

Classification:

QNX 6

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

See also:

ChannelCreate(), MsgRead(), MsgReadv(), MsgReceive(), MsgReceivev(), MsgSend(), MsgSendv()


[Previous] [Contents] [Next]