summaryrefslogtreecommitdiff
path: root/src/lib/libc/include/thread_private.h
diff options
context:
space:
mode:
authormarc <>2003-01-28 04:58:00 +0000
committermarc <>2003-01-28 04:58:00 +0000
commit547ebab319b228b064cf5dcb3ff0ae1bf23d24a2 (patch)
treef57454716593fb3b68672505c6dccab6438498f1 /src/lib/libc/include/thread_private.h
parent98a78d57b176408b5aca87705f9681c5b155b47c (diff)
downloadopenbsd-547ebab319b228b064cf5dcb3ff0ae1bf23d24a2.tar.gz
openbsd-547ebab319b228b064cf5dcb3ff0ae1bf23d24a2.tar.bz2
openbsd-547ebab319b228b064cf5dcb3ff0ae1bf23d24a2.zip
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@
Diffstat (limited to 'src/lib/libc/include/thread_private.h')
-rw-r--r--src/lib/libc/include/thread_private.h11
1 files changed, 10 insertions, 1 deletions
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 @@
1/* $OpenBSD: thread_private.h,v 1.14 2002/11/05 22:19:55 marc Exp $ */ 1/* $OpenBSD: thread_private.h,v 1.15 2003/01/28 04:58:00 marc Exp $ */
2 2
3#ifndef _THREAD_PRIVATE_H_ 3#ifndef _THREAD_PRIVATE_H_
4#define _THREAD_PRIVATE_H_ 4#define _THREAD_PRIVATE_H_
@@ -87,6 +87,15 @@ void * _libc_private_storage(volatile struct _thread_private_key_struct *,
87 &(storage), sizeof (storage), error) 87 &(storage), sizeof (storage), error)
88 88
89/* 89/*
90 * Keys used to access the per thread instances of resolver global data.
91 * These are not static as they are referenced in several places.
92 */
93extern volatile struct _thread_private_key_struct __THREAD_KEY_NAME(_res);
94#ifdef INET6
95extern volatile struct _thread_private_key_struct __THREAD_KEY_NAME(_res_ext);
96#endif
97
98/*
90 * File descriptor locking definitions. 99 * File descriptor locking definitions.
91 */ 100 */
92#define FD_READ 0x1 101#define FD_READ 0x1