User Tools

Site Tools


Sidebar

Table Of Contents

endurox:v7.5.x:api:xatmi:tpstrerror.3

tpstrerror

Name

tpstrerror — Return the description for error

Synopsis

#include <atmi.h>

char * tpstrerror (int err);

For XATMI client link with -latmiclt -latmi -lubf -lnstd -lpthread -lrt -lm

For XATMI server link with -latmisrv|-latmisrvnomain|-latmisrvinteg -latmi -lubf -lnstd -lpthread -lrt -lm

DESCRIPTION

Function returns string description of given error code. Enduro/X also loggs additional information for last error state, and that information is returned in string format together with description of err. Typically when error occurs, then programmer calls tpstrerror(tperrno), thus function will closely describe what was happened. However if programmer calls tpstrerror() with other error code, then message will contain the description of err plus last XATMI call’s logged error info. Then message and tperrno infos are stored in thread local storage (TLS).

RETURN VALUE

String containing formatted error code description plus last call’s error logged info. For example:

...
    /* call the service now! */
    if (SUCCEED!=tpcall("NONEXISTSVC", (char *)p_ub, 0L, (char **)&p_ub_ret, &rsp_len, 0L))
    {
        ret=FAIL;

        /* print the result */
        fprintf(stderr, "%s\n", tpstrerror(tperrno));
    }
...

/* Will result with this on stderr putput
6:TPENOENT (last error 6: _tpacall: Service is not available NONEXISTSVC by shm)
*/

ERRORS

Function does not return any errors.

EXAMPLE

See atmitest/test003_basicconvers/atmisv3.c for sample code.

BUGS

Report bugs to support@mavimax.com

COPYING

© Mavimax, Ltd