Re: Usage of _exit(0) closes fd's of parent process

2010-04-13 Thread gothrog
I'm just taking a wild stab at this, but maybe the fork isn't working like you think it should. I know that when I use pthreads you have to specify exactly how you expect it to split off and close. I've heard of this type of behavior before and it all came down to how that thread was spawned off

Re: Usage of _exit(0) closes fd's of parent process

2010-04-11 Thread tmhikaru
Thank you, those of you who have pointed out that _exit() is not supposed to be doing what I think it is. I will therefore assume this is either not a bug in my program or otherwise that it is complex enough that I can't figure it out myself. In either case, I'll be following the bug report

Re: Usage of _exit(0) closes fd's of parent process

2010-04-11 Thread Corinna Vinschen
On Apr 11 12:48, Dave Korn wrote: > On 11/04/2010 07:29, Christopher Faylor wrote: > > On Sun, Apr 11, 2010 at 01:48:51AM -0400, tmhik...@gmail wrote: > > >> establishes a tcp connection in the parent, > > > your conclusions about the problem. For instance, what does "stays > > connected" mean?

Re: Usage of _exit(0) closes fd's of parent process

2010-04-11 Thread Dave Korn
On 11/04/2010 07:29, Christopher Faylor wrote: > On Sun, Apr 11, 2010 at 01:48:51AM -0400, tmhik...@gmail wrote: >> establishes a tcp connection in the parent, > your conclusions about the problem. For instance, what does "stays > connected" mean? Are you using sockets, pipes, a file, shared m

Re: Usage of _exit(0) closes fd's of parent process

2010-04-10 Thread Christopher Faylor
On Sun, Apr 11, 2010 at 01:48:51AM -0400, tmhik...@gmail.com wrote: >Hi. I'm having an unusual problem in a program I'm trying to get >working in cygwin. My program fork()'s a child process to do a >hostname lookup, establishes a tcp connection in the parent, then has >the child _exit(0) itself.

Usage of _exit(0) closes fd's of parent process

2010-04-10 Thread tmhikaru
Hi. I'm having an unusual problem in a program I'm trying to get working in cygwin. My program fork()'s a child process to do a hostname lookup, establishes a tcp connection in the parent, then has the child _exit(0) itself. For some reason I don't understand, _exit is not just closing the