[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]


5.2.9 Importing a System-Defined Error Status into the Program as an Exception

The pthread_exc_set_status_np() function can be used to create a status exception. The exception object must already have been initialized with EXCEPTION_INIT. Any system-specific status value may be used. All exception objects set to the same status value are considered equivalent by the exception facility.

An example of importing an error status into an exception is as follows:

void pthread_exc_set_status_np (EXCEPTION *exception,
       unsigned int code);

static EXCEPTION an_error;

EXCEPTION_INIT (an_error);
pthread_exc_set_status_np (&an_error, ENOMEM);

Note
On OpenVMS systems, DECthreads exception status values must always have a SEVERE severity level. The pthread_exc_set_status_np operation will modify (if necessary) the severity level of the status code.