Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/m/msgerror.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/m/msgerror.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/m/msgerror.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/m/msgerror.html on line 8

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 );

Arguments:

rcvid
The receive ID that MsgReceive*() returned.
error
The error code that you want to set for the client.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The MsgError() and MsgError_r() kernel calls unblock the client's MsgSend*() call and set the client's errno to error. No data is transferred.

If error is EOK, the MsgSend*() call returns EOK; if error is any other value, the MsgSend*() call returns -1.

These functions are identical except in the way they indicate errors. See the Returns section for details.


Note: An error number of ERESTART causes the sender to immediately call MsgSend*() again. Since send and reply buffers passed to MsgSend() may overlap, you shouldn't use ERESTART after a call to MsgWrite().

Blocking states

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

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.

Returns:

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

MsgError()
If an error occurs, the function returns -1 and and sets errno. Any other value returned indicates success.
MsgError_r()
Returns EOK on success. This function does NOT set errno. If an error occurs, the function returns one of the values listed in the Errors section.

Errors:

ESRCH
The thread indicated by rcvid doesn't exist.

Classification:

QNX Neutrino

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

See also:

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

Message Passing chapter of Getting Started with QNX Neutrino


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/m/msgerror.html on line 203

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/m/msgerror.html on line 203