Since you are writing your own server, I think you can pretty much do anything you want as far as architecture goes.

I have never done this, but I suspect you'll want to use functions like dup() and/or dup2(), since you will need to set up stdin and stdout and stderr just as they were set up for you when the operating system kicked your server process off.

Not sure what op/sys you are running, but try this site: http://www.unixwiz.net/techtips/remap-pipe-fds.html