diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2021-08-02 09:50:32 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2021-08-03 18:19:32 +0000 |
commit | 49ad342cc10cba14b3a40ba26cf8bb2150e2925a (patch) | |
tree | ee305bcb48c170ceddd7d3167b6831f11f10241a /include/unistd.h | |
parent | 2d319ebe5c08f3454c4e76564b88fb921f008185 (diff) | |
download | src-49ad342cc10cba14b3a40ba26cf8bb2150e2925a.tar.gz src-49ad342cc10cba14b3a40ba26cf8bb2150e2925a.zip |
Add _Fork()
Current POSIX standard requires fork() to be async-signal safe. Neither
our implementation, nor implementations in other operating systems are,
and practically it is impossible to make fork() async-signal safe without
too much efforts. Also, that would put undue requirement that all atfork
handlers should be async-signal safe as well, which contradicts its main
use.
As result, Austin Group dropped the requirement, and added a new function
_Fork() that should be async-signal safe, but it does not call atfork
handlers. Basically, _Fork() can be implemented as a raw syscall.
Release of glibc 2.34 added _Fork(), do the same for FreeBSD.
Clarify threading behavior for fork() in the manpage.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D31378
Diffstat (limited to 'include/unistd.h')
-rw-r--r-- | include/unistd.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/unistd.h b/include/unistd.h index 9fa9bebbc4c0..5f358ad72d9a 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -586,6 +586,7 @@ int undelete(const char *); int unwhiteout(const char *); void *valloc(size_t); /* obsoleted by malloc() */ int funlinkat(int, const char *, int, int); +pid_t _Fork(void); #ifndef _OPTRESET_DECLARED #define _OPTRESET_DECLARED |