libexplain
1.4.D001
|
#include <libexplain/ac/sys/types.h>
#include <libexplain/ac/unistd.h>
#include <libexplain/output.h>
#include <libexplain/vfork.h>
Go to the source code of this file.
Functions | |
pid_t | explain_vfork_or_die (void) |
pid_t explain_vfork_or_die | ( | void | ) |
The explain_vfork_or_die function is used to call the vfork(2) system call. On failure an explanation will be printed to stderr, obtained from the explain_vfork(3) function, and then the process terminates by calling exit(EXIT_FAILURE)
.
pid_t result = explain_vfork_or_die();
“The vfork() function has the same effect as fork(2), except that the behavior is undefined if the process created by vfork() either modifies any data other than a variable of type pid_t used to store the return value from vfork(), or returns from the function in which vfork() was called, or calls any other function before successfully calling _exit(2) or one of the exec(3) family of functions.”
Definition at line 27 of file vfork_or_die.c.