diff options
Diffstat (limited to 'lib/lib.h')
-rw-r--r-- | lib/lib.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -246,5 +246,17 @@ void mode_to_string(mode_t mode, char *buf); char *basename_r(char *name); void names_to_pid(char **names, int (*callback)(pid_t pid, char *name)); +// Returning from a function can modify a potentially shared stack, +// so this has to always inline. + +static inline pid_t xvfork(void) +{ + pid_t p = vfork(); + + if (p == -1) perror_exit("vfork"); + + return p; +} + // Functions in need of further review/cleanup #include "lib/pending.h" |