If you fork() after a vfork() do _both_ children have to exec/exit before the parent resumes? #dontcrossthestreams
-
-
Formally, the answer to all of the above is that it's UB to do anything but execve or _exit in the child after vfork. The (very good) reason it's UB is that there are all kinds of corner cases that don't admit any reasonable specification for what they should do...
-
...and where what happens is just going to be a highly implementation-specific function of implementation internals.
-
Oh sure. It's a bad idea. Just curious. (And you need to be able to open/close/dup between, it's not _nothing_ that's ok to do...)
-
The old POSIX spec (before vfork was removed) didn't allow that, and the Linux man page doesn't explicitly do so either. http://man7.org/linux/man-pages/man2/vfork.2.html … Really programs needing this should use posix_spawn, which has most of the advantages and none of the disadvantages of vfork.
-
posix_spawn() is so uninteresting my ubuntu 16.04 system hasn't even got a man page for it.
-
The Linux man pages project documents it; your Ubuntu is just badly outdated. http://man7.org/linux/man-pages/man3/posix_spawn.3.html …
-
I'm aware it's online and in posix. I don't care, but I'm aware of it. And 16.04 at work is newer than the one on my netbook. :)
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.