OT: linux clone() and errno

Andrew Haley aph at redhat.com
Tue Sep 7 13:43:15 UTC 2010


On 09/07/2010 02:33 PM, T. Horsnell wrote:
> Apologies for the OT query - if you know a better place to ask, please tell me.
> 
> If I use clone() to create a new thread in a process, the child thread has
> the same errno as the parent. Is there any way round this, or do I have to
> move to pthreads?

You just have to provide your own definition of errno.  It's not
terribly hard, and there's source in libpthread.  But If I were
you I'd just use pthreads, and thereby get compatibility with
existing libraries.

Andrew.


More information about the users mailing list