Originally posted by: dickdunbar
One thing you might try is to get a compiler listing.
errno is a global value in a non-threaded program,
because there is normally only one system call which
manipulates it.
In a threaded program, where there can be multiple system calls
being executed from different threads, errno has to change.
It is the compiler that changes this. Compare test.lst
files created with these two commands:
xlc -qsource test.c # non-threaded
xlc_r -qsource test.c # threaded
The threaded listing will show what errno gets expanded to; eg.,
11 | if(errno) {
11 + if((*_Errno())) {
The source "errno" was converted (by the header file) to
a function call ... which retrieves the thread specific errno.
#AIX-Forum