delorie.com/archives/browse.cgi | search |
2009/11/23 Corinna Vinschen <corinna-cygwin AT cygwin DOT com>: > On Nov 22 09:33, Huang Bambo wrote: >> And there's another quesiton: >> The handle of chile process( created by fork ) seems never been closed >> bye parent process. Is it need to be closed? > > I don't understand the question. =A0There's one dangling socket handle le= ft > and I know where and why it happens. =A0Other than that, I don't see any > other socket handling which is left open accidentally. > While run my last test code, every time comes one connection, there are 3 handle leak( I monited it by Process Explorer( from www.sysinternals.com)), one is the chile process's handle, one is of "Section \BaseNamedObjects\cygwin1S5-9770bb4ddbd85dca\cygpid.xxxx", the other one is of \Device\Afd. I mean is there any other leak with those handles. Simple code like the following will not leak anything: #include <unistd.h> #include <stdio.h> int main(void) { pid_t pid =3D fork(); while(1) { if ( pid =3D=3D 0 ) { sleep(5); printf("Child: %d ended\n", getpid()); return 0; } else if ( pid > 0 ) { printf("New process forked.\n"); sleep(10); } } } -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |