Alfred Perlstein <[email protected]> writes: > Dag-Erling Smørgrav <[email protected]> writes: > > Usually, what you see is closer to this: > > > > if ((pid = fork()) == 0) { > > for (int fd = 3; fd < getdtablesize(); ++fd) > > (void)close(fd); > > execve(path, argv, envp); > > _exit(1); > > } > > I'm probably missing something, but couldn't you iterate > in the parent setting the close-on-exec flag then vfork?
This is an example, Alfred. Like most examples, it is greatly simplified. I invite you to peruse the source to find real-world instances of non-trivial fork() / execve() usage. DES -- Dag-Erling Smørgrav - [email protected] _______________________________________________ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[email protected]"

