If you fork() after a vfork() do _both_ children have to exec/exit before the parent resumes? #dontcrossthestreams
-
-
Replying to @landley
Better question is what happens if you double-vfork and kill -9 the middle generation from the grandchild.
1 reply 0 retweets 1 like -
Replying to @RichFelker @landley
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...
1 reply 0 retweets 1 like -
Replying to @RichFelker @landley
...and where what happens is just going to be a highly implementation-specific function of implementation internals.
1 reply 0 retweets 0 likes -
Replying to @RichFelker
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...)
1 reply 0 retweets 0 likes -
Replying to @landley
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.
2 replies 0 retweets 0 likes -
Replying to @RichFelker
posix_spawn() is so uninteresting my ubuntu 16.04 system hasn't even got a man page for it.
1 reply 0 retweets 0 likes -
Replying to @landley
The Linux man pages project documents it; your Ubuntu is just badly outdated. http://man7.org/linux/man-pages/man3/posix_spawn.3.html …
2 replies 0 retweets 0 likes
The man page is actually rather bad though; it documents some historical wrong implementation internals from glibc rather than documenting the abstract behavior applications should expect.
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.