lasterror(3C)
_________________________________________________________________
lasterror function
Return the code for the most recent error.
_________________________________________________________________
Calling Sequence
int lasterror(), err;
err = lasterror();
Description
Use the lasterror function to determine the most recent error
code that was returned. The last error is also stored in the
external integer variable errno; however, if you use
multitasking, another task could overwrite errno before you have
a chance to inspect it. The lasterror function returns the last
error on a task-specific basis.
Returns
The lasterror function returns the error code for the last error.
Related Functions
See also the perror function.
Example
/* Program test for the lasterror() function */
#include <stdio.h>
int err, lasterror();
main(argc, argv)
int argc;
char *argv[];
{
printf("Last error = %d.\n", err = lasterror());
}
A call to the program test generates the output
Last error = 0.
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)