tpstrerror − Return the description for error
#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
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).
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)
*/
Function does not return any errors.
See atmitest/test003_basicconvers/atmisv3.c for sample code.
Report bugs to support@mavimax.com
tpcommit(3) tpstrerror(3) tpopen(3) tpsuspend(3) tpresume(3)
© Mavimax, Ltd