> After fork(), I want to close all file descriptors, endpwent(), > closelog(), manage stdio/stderr/stdin etc. properly before doing the > exec(). Probably all these descriptors should have FD_CLOEXEC set so the right thing happens automatically at exec.