libexplain
1.4.D001
|
#include <libexplain/ac/errno.h>
#include <libexplain/ac/sys/types.h>
#include <libexplain/ac/unistd.h>
#include <libexplain/vfork.h>
#include <libexplain/output.h>
Go to the source code of this file.
Functions | |
pid_t | explain_vfork_on_error (void) |
pid_t explain_vfork_on_error | ( | void | ) |
The explain_vfork_on_error 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.
pid_t result = explain_vfork_on_error(); if (result < 0) { ...cope with error ...no need to print error message }
“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 28 of file vfork_on_error.c.