Unlock the malloc() locks in the child process after fork(). This gives

us working malloc in the fork child of the multithreaded process.

Although POSIX requires that only async-signal safe functions shall be
operable after fork in multithreaded process, not having malloc lower
the quality of our implementation.

Tested by:	rink
Discussed with:	kan, davidxu
Reviewed by:	kan
MFC after:	1 month
This commit is contained in:
Konstantin Belousov 2008-11-29 21:46:28 +00:00
parent 39bd58723a
commit e711c6f0d1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=185456

View File

@ -172,6 +172,7 @@ _fork(void)
if (unlock_malloc) {
_rtld_atfork_post(rtld_locks);
_malloc_postfork();
}
/* Run down atfork child handlers. */