oserror, setoserror, goserror - get/set system error
int setoserror(const int err);
Most system calls and many system library functions set a global error
value errno when they encounter an error. For single threaded
applications a global is sufficient. For multi-threaded applications a
global error value loses much of its meaning, since multiple threads may
be updating the same value at the same time. When a process turns
multi-threaded (by calling sproc(2)) a per-thread location to store the
error value is created. sproc(2) and intro(2) have more information on
These routines provide access to the error values. oserror returns the
value in the global error location for single threaded applications and
returns the value in the per-thread error location for multi-threaded
applications. This is equivalent to compiling the application with the
feature test macro _SGI_MP_SOURCE defined and simply referencing errno.
setoserror sets both the global error location and the per-thread error
location for the calling thread. This is primarily used by library
goserror always returns the value in the global error location.
Possible errors are listed in errno.h.
oserror, goserror, and setoserror return the current system error.
intro(2), sproc(2), perror(3C).
PPPPaaaaggggeeee 1111 [ Back ]