Properly reaping children from a fork()

2003-02-24 Thread G-der
I wasn't sure which group to send this too but -hackers seemed more appropriate than -questions. I've started to play with sockets under FreeBSD and have created a very simple server. All it does is listens (on port 2525 by default) and when it receives a connection fork()s. The only

Re: Properly reaping children from a fork()

2003-02-24 Thread Jan Grant
On Mon, 24 Feb 2003, G-der wrote: I've attached the code for your enjoyment...I'm sure someone will be able to point out my mistake pretty quickly. Also I've found a couple of web pages that kind of explain socket handling but am looking for other resources that I can consult. You never

Re: Properly reaping children from a fork()

2003-02-24 Thread G-der
Thank you everyone for your replies. The bug was a pretty silly one and one that I should have caught just stepping through the code. The call to signal() to install the handler was beging made after the fork(). So the children had a handler installed but not the parent. I moved the

Re: Properly reaping children from a fork()

2003-02-24 Thread Terry Lambert
G-der wrote: This is a first attempt for me but I seem to have problems when it comes to ensuring that all the children exit like they should. What happens is that each child process remains in a zombied state (as seen through ps). Also if you check sockstat you can see that each zombied