mirror of https://git.musl-libc.org/git/musl
Browse Source
the _Fork interface is defined for future issue of POSIX as the outcome of Austin Group issue 62, which drops the AS-safety requirement for fork, and provides an AS-safe replacement that does not run the registered atfork handlers.master
3 changed files with 16 additions and 9 deletions
@ -0,0 +1,13 @@ |
|||
#include <unistd.h> |
|||
#include "libc.h" |
|||
|
|||
static void dummy(int x) { } |
|||
weak_alias(dummy, __fork_handler); |
|||
|
|||
pid_t fork(void) |
|||
{ |
|||
__fork_handler(-1); |
|||
pid_t ret = _Fork(); |
|||
__fork_handler(!ret); |
|||
return ret; |
|||
} |
|||
Loading…
Reference in new issue