I'm working on a program that forks into several processes. The main process becomes a server, and the child processes become clients. The clients basically request line numbers to a file until a certain limit is reached, and the server then quits. My problem is that as soon as the server reaches it's limit, it exits and the child processes also exit without printing out what they accomplished. When I try using the wait function, the system just hangs.
I've tried using wait with the process ids as well. Am I missing something when I'm working with the wait function? Any ideas? Thanks.