Remove _THREAD_SAFE depenendancies. Create weakly associated stubs for
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 31 Jan 2005 22:29:48 +0000 (22:29 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 31 Jan 2005 22:29:48 +0000 (22:29 +0000)
commit17ea22213f86a5c5966c1e6bf8e95f022ebb92b9
treeacc8991d9bd4a864578300fcb469c5d3a907783b
parentb91ea1187fa7c4ca9390ef4122f3e359eead75ea
Remove _THREAD_SAFE depenendancies.  Create weakly associated stubs for
posix threading calls used by libc and weak associations for procedures that
a threading library would otherwise have to override.  This allows a program
to be linked with libc, or linked with libc + a threading library.  libc_r
will be deprecated over time.

Traditionally libc_r had to be linked against a threading library rather then
libc.  Linux, FreeBSD, and other UNIXes have moved either t oa thread-safe
libc or a thread-capable libc.  The threading capability is accomplished by
making the appropriate thread locking calls and providing weakly referenced
dummy stub functions for the case where a threading library is not linked in.
Certain third party software, namely XFree/XOrg, also assume threading
stubs in libc.

This is precursor work to a port of David Xu's 1:1 threading library and is
also intended as a basis to allow DragonFly to support multiple threading
libraries.

Ported-by: David Rhodus <sdrhodus@gmail.com>
Primarily-ported-from: FreeBSD
Testing and bug fixes by David Xu and Matt Dillon
160 files changed:
include/dirent.h
include/stdio.h
lib/libc/Makefile
lib/libc/Makefile.inc
lib/libc/compat-43/creat.c
lib/libc/compat-43/sigcompat.c
lib/libc/db/btree/bt_close.c
lib/libc/db/btree/bt_open.c
lib/libc/db/hash/hash.c
lib/libc/db/hash/hash_page.c
lib/libc/db/mpool/mpool.c
lib/libc/db/recno/rec_close.c
lib/libc/db/recno/rec_open.c
lib/libc/gen/Makefile.inc
lib/libc/gen/_pthread_stubs.c [new file with mode: 0644]
lib/libc/gen/_spinlock_stub.c
lib/libc/gen/_thread_init.c [new file with mode: 0644]
lib/libc/gen/arc4random.c
lib/libc/gen/closedir.c
lib/libc/gen/daemon.c
lib/libc/gen/devname.c
lib/libc/gen/exec.c
lib/libc/gen/fstab.c
lib/libc/gen/fts.c
lib/libc/gen/getcap.c
lib/libc/gen/getcwd.c
lib/libc/gen/getlogin.c
lib/libc/gen/getpwent.c
lib/libc/gen/isatty.c
lib/libc/gen/lockf.c
lib/libc/gen/nlist.c
lib/libc/gen/opendir.c
lib/libc/gen/pause.c
lib/libc/gen/popen.c
lib/libc/gen/posixshm.c
lib/libc/gen/psignal.c
lib/libc/gen/readdir.c
lib/libc/gen/scandir.c
lib/libc/gen/seekdir.c
lib/libc/gen/setjmperr.c
lib/libc/gen/setmode.c
lib/libc/gen/siginterrupt.c
lib/libc/gen/signal.c
lib/libc/gen/sleep.c
lib/libc/gen/syslog.c
lib/libc/gen/telldir.c
lib/libc/gen/termios.c
lib/libc/gen/ttyname.c
lib/libc/gen/usleep.c
lib/libc/gen/wait.c
lib/libc/gen/wait3.c
lib/libc/gen/waitpid.c
lib/libc/gmon/gmon.c
lib/libc/i386/SYS.h
lib/libc/i386/gen/_setjmp.S
lib/libc/i386/gen/setjmp.S
lib/libc/i386/gen/sigsetjmp.S
lib/libc/i386/sys/setlogin.S
lib/libc/include/libc_private.h
lib/libc/include/namespace.h [new file with mode: 0644]
lib/libc/include/spinlock.h
lib/libc/include/un-namespace.h [new file with mode: 0644]
lib/libc/locale/collate.c
lib/libc/locale/rune.c
lib/libc/net/getaddrinfo.c
lib/libc/net/gethostbyht.c
lib/libc/net/gethostnamadr.c
lib/libc/net/getifaddrs.c
lib/libc/net/herror.c
lib/libc/net/name6.c
lib/libc/net/rcmd.c
lib/libc/net/recv.c
lib/libc/net/res_send.c
lib/libc/net/send.c
lib/libc/nls/msgcat.c
lib/libc/rpc/auth_time.c
lib/libc/rpc/bindresvport.c
lib/libc/rpc/clnt_generic.c
lib/libc/rpc/clnt_simple.c
lib/libc/rpc/clnt_tcp.c
lib/libc/rpc/clnt_udp.c
lib/libc/rpc/clnt_unix.c
lib/libc/rpc/get_myaddress.c
lib/libc/rpc/key_call.c
lib/libc/rpc/pmap_clnt.c
lib/libc/rpc/pmap_getmaps.c
lib/libc/rpc/pmap_getport.c
lib/libc/rpc/pmap_rmt.c
lib/libc/rpc/rpc_dtablesize.c
lib/libc/rpc/rtime.c
lib/libc/rpc/svc_auth_des.c
lib/libc/rpc/svc_run.c
lib/libc/rpc/svc_tcp.c
lib/libc/rpc/svc_udp.c
lib/libc/rpc/svc_unix.c
lib/libc/stdio/_flock_stub.c
lib/libc/stdio/clrerr.c
lib/libc/stdio/fclose.c
lib/libc/stdio/fdopen.c
lib/libc/stdio/fflush.c
lib/libc/stdio/fgetc.c
lib/libc/stdio/fgetpos.c
lib/libc/stdio/fgets.c
lib/libc/stdio/findfp.c
lib/libc/stdio/flags.c
lib/libc/stdio/fopen.c
lib/libc/stdio/fpurge.c
lib/libc/stdio/fputc.c
lib/libc/stdio/fputs.c
lib/libc/stdio/fread.c
lib/libc/stdio/freopen.c
lib/libc/stdio/fscanf.c
lib/libc/stdio/fseek.c
lib/libc/stdio/ftell.c
lib/libc/stdio/fvwrite.c
lib/libc/stdio/fwalk.c
lib/libc/stdio/fwrite.c
lib/libc/stdio/getc.c
lib/libc/stdio/getchar.c
lib/libc/stdio/gets.c
lib/libc/stdio/glue.h
lib/libc/stdio/local.h
lib/libc/stdio/makebuf.c
lib/libc/stdio/mktemp.c
lib/libc/stdio/perror.c
lib/libc/stdio/putc.c
lib/libc/stdio/putchar.c
lib/libc/stdio/puts.c
lib/libc/stdio/putw.c
lib/libc/stdio/refill.c
lib/libc/stdio/rewind.c
lib/libc/stdio/scanf.c
lib/libc/stdio/setvbuf.c
lib/libc/stdio/stdio.c
lib/libc/stdio/tmpfile.c
lib/libc/stdio/ungetc.c
lib/libc/stdio/vasprintf.c
lib/libc/stdio/vfprintf.c
lib/libc/stdio/vfscanf.c
lib/libc/stdio/vscanf.c
lib/libc/stdio/vsnprintf.c
lib/libc/stdio/vsprintf.c
lib/libc/stdio/wbuf.c
lib/libc/stdlib/abort.c
lib/libc/stdlib/exit.c
lib/libc/stdlib/malloc.c
lib/libc/stdlib/random.c
lib/libc/stdlib/realpath.c
lib/libc/stdlib/system.c
lib/libc/stdtime/asctime.c
lib/libc/stdtime/difftime.c
lib/libc/stdtime/localtime.c
lib/libc/stdtime/strftime.c
lib/libc/stdtime/strptime.c
lib/libc/stdtime/timelocal.c
lib/libc/sys/ftruncate.c
lib/libc/sys/lseek.c
lib/libc/sys/stack_protector.c
lib/libc/yp/yplib.c
lib/libc_r/uthread/uthread_spinlock.c