diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2015-01-05 01:06:54 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2015-01-05 01:06:54 +0000 |
commit | 1a744fefc24b8332997c97cdd4c7c93b62b3b4db (patch) | |
tree | ae1060e14ffc1f7203b630e4e1e7624871ab2ce0 | |
parent | fd520b6e21a0d582bc57a0c3e6c62abe645f8980 (diff) |
Notes
-rw-r--r-- | lib/libc/include/libc_private.h | 4 | ||||
-rw-r--r-- | lib/libc/sys/Symbol.map | 3 | ||||
-rw-r--r-- | lib/libc/sys/__error.c | 14 | ||||
-rw-r--r-- | lib/libthr/thread/thr_private.h | 2 | ||||
-rw-r--r-- | lib/libthr/thread/thr_syscalls.c | 2 |
5 files changed, 16 insertions, 9 deletions
diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index adf342de4e85b..ea1a97b6dd478 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -173,13 +173,13 @@ typedef pthread_func_t pthread_func_entry_t[2]; extern pthread_func_entry_t __thr_jtable[]; -extern int *(*__error_selector)(void); +void __set_error_selector(int *(*arg)(void)); int _pthread_mutex_init_calloc_cb_stub(pthread_mutex_t *mutex, void *(calloc_cb)(__size_t, __size_t)); typedef int (*interpos_func_t)(void); interpos_func_t *__libc_interposing_slot(int interposno); -extern interpos_func_t __libc_interposing[]; +extern interpos_func_t __libc_interposing[] __hidden; enum { INTERPOS_accept, diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map index 7d823614816a0..f1f57ba9fb794 100644 --- a/lib/libc/sys/Symbol.map +++ b/lib/libc/sys/Symbol.map @@ -1045,8 +1045,7 @@ FBSDprivate_1.0 { __sys_write; _writev; __sys_writev; - __error_unthreaded; - __error_selector; + __set_error_selector; nlm_syscall; gssd_syscall; __libc_interposing_slot; diff --git a/lib/libc/sys/__error.c b/lib/libc/sys/__error.c index 329d124a16db8..28cc31dde1775 100644 --- a/lib/libc/sys/__error.c +++ b/lib/libc/sys/__error.c @@ -32,13 +32,21 @@ __FBSDID("$FreeBSD$"); extern int errno; -int * +static int * __error_unthreaded(void) { - return(&errno); + + return (&errno); } -int *(*__error_selector)(void) = __error_unthreaded; +static int *(*__error_selector)(void) = __error_unthreaded; + +void +__set_error_selector(int *(*arg)(void)) +{ + + __error_selector = arg; +} int * __error(void) diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h index e8edbe104c927..0c16b2a63dfb5 100644 --- a/lib/libthr/thread/thr_private.h +++ b/lib/libthr/thread/thr_private.h @@ -914,7 +914,7 @@ void _thr_tsd_unload(struct dl_phdr_info *phdr_info) __hidden; void _thr_sigact_unload(struct dl_phdr_info *phdr_info) __hidden; void _thr_stack_fix_protection(struct pthread *thrd); -int *__error_threaded(void); +int *__error_threaded(void) __hidden; void __thr_interpose_libc(void) __hidden; pid_t __thr_fork(void); int __thr_pause(void) __hidden; diff --git a/lib/libthr/thread/thr_syscalls.c b/lib/libthr/thread/thr_syscalls.c index 60427d8fdfe1e..a4fe7e87e211a 100644 --- a/lib/libthr/thread/thr_syscalls.c +++ b/lib/libthr/thread/thr_syscalls.c @@ -692,7 +692,7 @@ void __thr_interpose_libc(void) { - __error_selector = __error_threaded; + __set_error_selector(__error_threaded); #define SLOT(name) \ *(__libc_interposing_slot(INTERPOS_##name)) = \ (interpos_func_t)__thr_##name; |