diff options
author | David Leonard <d@cvs.openbsd.org> | 2000-01-06 07:27:34 +0000 |
---|---|---|
committer | David Leonard <d@cvs.openbsd.org> | 2000-01-06 07:27:34 +0000 |
commit | 32b1f5b70cfb93b1a14901253314bc9b92c8b750 (patch) | |
tree | a7d380df564fc0050e3b70e59a769c3dea8f25dd /lib/libc/thread | |
parent | 58ca2ba3d7b23e0a7d454dcbad7fcf720b1880cb (diff) |
thread specific storage and fd locking for single-threaded libc (ie, no-ops)
Diffstat (limited to 'lib/libc/thread')
-rw-r--r-- | lib/libc/thread/Makefile.inc | 6 | ||||
-rw-r--r-- | lib/libc/thread/thread_fd.c | 52 | ||||
-rw-r--r-- | lib/libc/thread/thread_storage.c | 40 |
3 files changed, 98 insertions, 0 deletions
diff --git a/lib/libc/thread/Makefile.inc b/lib/libc/thread/Makefile.inc new file mode 100644 index 00000000000..08610fe77cd --- /dev/null +++ b/lib/libc/thread/Makefile.inc @@ -0,0 +1,6 @@ +# $OpenBSD: Makefile.inc,v 1.1 2000/01/06 07:27:33 d Exp $ + +.PATH: ${LIBCSRCDIR}/thread + +SRCS+= thread_fd.c thread_storage.c + diff --git a/lib/libc/thread/thread_fd.c b/lib/libc/thread/thread_fd.c new file mode 100644 index 00000000000..b0b52378f1b --- /dev/null +++ b/lib/libc/thread/thread_fd.c @@ -0,0 +1,52 @@ +/* $OpenBSD: thread_fd.c,v 1.1 2000/01/06 07:27:33 d Exp $ */ + +#include <sys/time.h> +#include <pthread.h> +#include "thread_private.h" + +WEAK_PROTOTYPE(_thread_fd_lock); +WEAK_PROTOTYPE(_thread_fd_lock_debug); +WEAK_PROTOTYPE(_thread_fd_unlock); +WEAK_PROTOTYPE(_thread_fd_unlock_debug); + +WEAK_ALIAS(_thread_fd_lock); +WEAK_ALIAS(_thread_fd_lock_debug); +WEAK_ALIAS(_thread_fd_unlock); +WEAK_ALIAS(_thread_fd_unlock_debug); + +int +WEAK_NAME(_thread_fd_lock)(fd, lock_type, timeout) + int fd; + int lock_type; + struct timespec *timeout; +{ + return 0; +} + +int +WEAK_NAME(_thread_fd_lock_debug)(fd, lock_type, timeout, fname, lineno) + int fd; + int lock_type; + struct timespec *timeout; + const char *fname; + int lineno; +{ + return 0; +} + +void +WEAK_NAME(_thread_fd_unlock)(fd, lock_type) + int fd; + int lock_type; +{ +} + +void +WEAK_NAME(_thread_fd_unlock_debug)(fd, lock_type, fname, lineno) + int fd; + int lock_type; + const char *fname; + int lineno; +{ +} + diff --git a/lib/libc/thread/thread_storage.c b/lib/libc/thread/thread_storage.c new file mode 100644 index 00000000000..cd810627a11 --- /dev/null +++ b/lib/libc/thread/thread_storage.c @@ -0,0 +1,40 @@ +/* $OpenBSD: thread_storage.c,v 1.1 2000/01/06 07:27:33 d Exp $ */ +/* + * + */ +/* unthreaded storage allocation helper functions */ + +#include <sys/cdefs.h> +#include <pthread.h> +#include "thread_private.h" + +WEAK_PROTOTYPE(_libc_private_storage_lock); +WEAK_PROTOTYPE(_libc_private_storage_unlock); +WEAK_PROTOTYPE(_libc_private_storage); + +WEAK_ALIAS(_libc_private_storage_lock); +WEAK_ALIAS(_libc_private_storage_unlock); +WEAK_ALIAS(_libc_private_storage); + +void +WEAK_NAME(_libc_private_storage_lock)(mutex) + pthread_mutex_t *mutex; +{ +} + +void +WEAK_NAME(_libc_private_storage_unlock)(mutex) + pthread_mutex_t *mutex; +{ +} + +void * +WEAK_NAME(_libc_private_storage)(key, init, initsz, error) + volatile struct _thread_private_key_struct * key; + void *init; + size_t initsz; + void *error; +{ + + return init; +} |