On Saturday 31 October 2009 21:52:37 Peter Steele wrote:
> >In UNIX it is not safe to perform arbitrary actions after forking a
> > multi-threaded process. You're basically expected to call exec soon
> > after the fork, although you can do certain other work if you are very
> > careful.
> >
> >The
On Sat, Oct 31, 2009 at 4:55 PM, Kris Kennaway wrote:
> Peter Steele wrote:
>
>> I have an application running a number of threads. I've had recent
>> instances where the code below is causing a core dump to occur:
>>
>> char fstatCmd[200];
>> char *fstatOut = "/tmp/fstat.out";
>> sprintf(fstatCm
>In UNIX it is not safe to perform arbitrary actions after forking a
>multi-threaded process. You're basically expected to call exec soon after the
>fork, although
>you can do certain other work if you are very careful.
>The reason for this is that after the fork, only one thread will be runnin
Peter Steele wrote:
I have an application running a number of threads. I've had recent instances
where the code below is causing a core dump to occur:
char fstatCmd[200];
char *fstatOut = "/tmp/fstat.out";
sprintf(fstatCmd, "fstat | grep -v USER | wc -l >%s", fstatOut);
rc = system(fstatCmd);