Obtain the last returned error status for the calling thread.
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()
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());