3 ms·
> IIRC[1], errno is thread-local, not necessarily race-safe. i.e. it's visible to interrupts, which could change it) On AIX, errno is not thread-local by defau
by skissane 4y ago
> IIRC[1], errno is thread-local, not necessarily race-safe. i.e. it's visible to interrupts, which could change it)
On AIX, errno is not thread-local by default, it is a global variable shared by all threads. Only if you set one of those two defines, does it become a thread-local variable. On every other platform I’ve ever written code for, errno is thread-local by default and no special define is needed to make it so. Hence, when you port to AIX, if you don’t know about those defines, you can get all these weird race condition bugs related to error handling, because suddenly errno isn’t thread-local any more