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?
Cheers, Terry
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.
On Tue, 07 Sep 2010 14:33:51 +0100 T. Horsnell wrote:
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?
Well, you could write some code as insanely complex as pthreads to provide the same functionality, or you could use pthreads :-).