Sun Java System Messaging Server 6 2005Q4 MTA Developer's Reference


Obtain the last returned error status for the calling thread.


int mtaErrno(void);




When an MTA SDK routine is called by a processing thread and returns an error status code, the SDK saves that status code in thread-specific data. The same processing thread can obtain the most recently saved status code for its own thread of execution by calling mtaErrno().

For convenience purposes, the mtasdk.h header file also defines mta_errno as a macro that calls mtaErrno(). Specifically:

#define mta_errno mtaErrno()

Return Values

The last error return status code returned by an MTA SDK routine called by this processing thread.

For a description of the MTA SDK error status codes, see Chapter 9, Error Status Codes Summary


The following code fragment demonstrates how to obtain the most recent error status code for its own thread.

if (!mtaEnqueueStart(&nq, from_adr, 0, 0))
    printf("Error returned: %d\n", mtaErrno());