![]() |
|
||||
POSIX 1.c Migration Guide |
Error Reporting
Pthread Function Errors
As noted in "Overview of Major Changes", virtually all pthreads functions defined by POSIX.1c return the error number as the return value of the function instead of setting errno as in POSIX.4a, except where required by existing practice. This requires that error detection and handling for these functions be modified in a manner similar to the following code fragments:
POSIX.4a Code
Equivalent POSIX.1c Code
Because such POSIX.1c functions do not set errno, the application cannot use the C Standard function perror() to print the corresponding system error message. An alternative, but non-portable, method of printing the system error message corresponding to the function return value on LynxOS 4 is to use the ERRMSG macro defined in errno.h to access the error message table:
Elimination of EINTR Return Code
POSIX.4a allowed blocking pthreads functions to return an EINTR error if interrupted by a signal handler in a manner consistent with many blocking POSIX.1 or POSIX.1b interfaces. LynxOS versions prior to 3.1.0 exhibited this behavior, requiring the application to handle these situations.
POSIX.1c disallows this behavior, requiring all blocking pthreads functions to restart or complete after the execution of a signal handler transparently to the application. POSIX.1 or POSIX.1b blocking function behavior is unchanged.
![]() LynuxWorks, Inc. 855 Branham Lane East San Jose, CA 95138 http://www.lynuxworks.com 1.800.255.5969 |
![]() |
![]() |
![]() |
![]() |