diff options
author | kib <kib@FreeBSD.org> | 2008-11-27 11:27:59 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2008-11-27 11:27:59 +0000 |
commit | b683fcf69217f7195e73b2f05d608c952101f47a (patch) | |
tree | b42b5149fd6de96214266e5ed4d6e0b09734ce83 /lib/libc/gen/dlfcn.c | |
parent | 9ef49d8b6f56c91c360dacd78c3cab2300da33fb (diff) | |
download | FreeBSD-src-b683fcf69217f7195e73b2f05d608c952101f47a.zip FreeBSD-src-b683fcf69217f7195e73b2f05d608c952101f47a.tar.gz |
Add two rtld exported symbols, _rtld_atfork_pre and _rtld_atfork_post.
Threading library calls _pre before the fork, allowing the rtld to
lock itself to ensure that other threads of the process are out of
dynamic linker. _post releases the locks.
This allows the rtld to have consistent state in the child. Although
child may legitimately call only async-safe functions, the call may
need plt relocation resolution, and this requires working rtld.
Reported and debugging help by: rink
Reviewed by: kan, davidxu
MFC after: 1 month (anyway, not before 7.1 is out)
Diffstat (limited to 'lib/libc/gen/dlfcn.c')
-rw-r--r-- | lib/libc/gen/dlfcn.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/libc/gen/dlfcn.c b/lib/libc/gen/dlfcn.c index 39ba141..eac3f1a 100644 --- a/lib/libc/gen/dlfcn.c +++ b/lib/libc/gen/dlfcn.c @@ -137,3 +137,15 @@ dl_iterate_phdr(int (*callback)(struct dl_phdr_info *, size_t, void *), _rtld_error(sorry); return 0; } + +#pragma weak _rtld_atfork_pre +void +_rtld_atfork_pre(int *locks) +{ +} + +#pragma weak _rtld_atfork_post +void +_rtld_atfork_post(int *locks) +{ +} |