home *** CD-ROM | disk | FTP | other *** search
- Submitted-by: willcox@urbana.mcd.mot.com (David A Willcox)
-
- karish@mindcraft.com (Chuck Karish) writes:
- >Note that the rules will be different for systems that support
- >multi-threaded processes, because errno may have to be a
- >function instead of an integral type.
-
- No, not really. POSIX.4a (pthreads) has the same requirement for
- errno as ANSI C, relaxing a bit the requirement that's in POSIX.1.
- POSIX.1 says that errno must be specifically "extern int errno;"
- POSIX.4a and ANSI C only require errno to be "a modifiable lvalue that
- has type int." The following both satisfy POSIX.4a and ANSI C, and are
- just fine for threads:
-
- #define errno (*__errno)
- extern int *__errno;
-
- #define errno (*__errno())
- extern int (*__errno())
-
- The following is NOT fine; it would violate ANSI C:
-
- #define errno __errno()
-
- David A. Willcox "Just say 'NO' to universal drug testing"
- Motorola MCG - Urbana UUCP: ...!uiucuxc!udc!willcox
- 1101 E. University Ave. INET: willcox@urbana.mcd.mot.com
- Urbana, IL 61801 FONE: 217-384-8534
-
-
- Volume-Number: Volume 31, Number 97
-
-