3 ms·
vfork is specified by POSIX that you cannot even do so much as close an fd or call setenv between fork and exec, both of which are very common things to want to
by Jasper_ 10y ago
vfork is specified by POSIX that you cannot even do so much as close an fd or call setenv between fork and exec, both of which are very common things to want to do to set up an environment before something is run.
I disagree with the author too about overcommit, but vfork isn't a realistic solution.
- quotemstr 10y agoIn your vfork, you can exec another process that does all these things in a fresh environment. Realistically, you'll want a posix_spawn interface that uses vfork internally.