From 547ebab319b228b064cf5dcb3ff0ae1bf23d24a2 Mon Sep 17 00:00:00 2001 From: marc <> Date: Tue, 28 Jan 2003 04:58:00 +0000 Subject: thread safer libc (note: safer, not safe) Access to the global _res structure replaced by pointers to a per thread instance. If unthreaded the pointer is to the global structure. Also replaced a 64k stack array with malloc-ed memory so threaded aps (with a default 64k stack) have a chance at working. ok deraadt@ --- src/lib/libc/include/thread_private.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/lib/libc/include') diff --git a/src/lib/libc/include/thread_private.h b/src/lib/libc/include/thread_private.h index 0b0be6cb38..4212e7dcb2 100644 --- a/src/lib/libc/include/thread_private.h +++ b/src/lib/libc/include/thread_private.h @@ -1,4 +1,4 @@ -/* $OpenBSD: thread_private.h,v 1.14 2002/11/05 22:19:55 marc Exp $ */ +/* $OpenBSD: thread_private.h,v 1.15 2003/01/28 04:58:00 marc Exp $ */ #ifndef _THREAD_PRIVATE_H_ #define _THREAD_PRIVATE_H_ @@ -86,6 +86,15 @@ void * _libc_private_storage(volatile struct _thread_private_key_struct *, _libc_private_storage(&__THREAD_KEY_NAME(keyname), \ &(storage), sizeof (storage), error) +/* + * Keys used to access the per thread instances of resolver global data. + * These are not static as they are referenced in several places. + */ +extern volatile struct _thread_private_key_struct __THREAD_KEY_NAME(_res); +#ifdef INET6 +extern volatile struct _thread_private_key_struct __THREAD_KEY_NAME(_res_ext); +#endif + /* * File descriptor locking definitions. */ -- cgit v1.2.3-55-g6feb