Subj : Re: How to deal with errno in a multipthread program To : comp.programming.threads From : Paul Pluzhnikov Date : Sat Apr 16 2005 08:28 am Eric Sosman writes: > However, you do not need to worry. The thread > implementation itself arranges to have a unique `errno' > for each thread: Minor correction: the thread implementation will do so *provided* you compile your program correctly for MT execution. On Solaris, that means adding '-mt' flag if using WorkShop compilers or '-pthreads' if using gcc. On Linux, errno is thread-safe without any flags at all, but '-pthread' ([1]) is recommended anyway. On AIX, -D_THREADS is required (IIRC). The OP should read his compiler documentation and/or system headers to figure out what (if anything) is needed on his platform. Cheers, [1] Yes, this is not a typo: the Solaris and Linux gcc options differ: '-pthreads' vs. '-pthread'. There might be a good reason for this, but I do not know it. If you do, please let me know. -- In order to understand recursion you must first understand recursion. Remove /-nsp/ for email. .