summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/exit.c
diff options
context:
space:
mode:
authord <d@openbsd.org>1998-11-20 11:18:22 +0000
committerd <d@openbsd.org>1998-11-20 11:18:22 +0000
commit92efb7350713770eeac379dc990eaecbee107aa1 (patch)
tree9e7a54e9f5f807b6269323fc5be9480298ad6de5 /lib/libc/stdlib/exit.c
parentMove atomic_lock code from asm to C with inline asm; (diff)
downloadwireguard-openbsd-92efb7350713770eeac379dc990eaecbee107aa1.tar.xz
wireguard-openbsd-92efb7350713770eeac379dc990eaecbee107aa1.zip
Add thread-safety to libc, so that libc_r will build (on i386 at least).
All POSIX libc api now there (to P1003.1c/D10) (more md stuff is needed for other libc/arch/*) (setlogin is no longer a special syscall) Add -pthread option to gcc (that makes it use -lc_r and -D_POSIX_THREADS). Doc some re-entrant routines Add libc_r to intro(3) dig() uses some libc srcs and an extra -I was needed there. Add more md stuff to libc_r. Update includes for the pthreads api Update libc_r TODO
Diffstat (limited to 'lib/libc/stdlib/exit.c')
-rw-r--r--lib/libc/stdlib/exit.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/libc/stdlib/exit.c b/lib/libc/stdlib/exit.c
index e358c94fd66..bc7fd395ca3 100644
--- a/lib/libc/stdlib/exit.c
+++ b/lib/libc/stdlib/exit.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: exit.c,v 1.2 1996/08/19 08:33:30 tholo Exp $";
+static char *rcsid = "$OpenBSD: exit.c,v 1.3 1998/11/20 11:18:50 d Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdlib.h>
@@ -42,6 +42,15 @@ static char *rcsid = "$OpenBSD: exit.c,v 1.2 1996/08/19 08:33:30 tholo Exp $";
void (*__cleanup)();
/*
+ * This variable is zero until a process has created a thread.
+ * It is used to avoid calling locking functions in libc when they
+ * are not required. By default, libc is intended to be(come)
+ * thread-safe, but without a (significant) penalty to non-threaded
+ * processes.
+ */
+int __isthreaded = 0;
+
+/*
* Exit, flushing stdio buffers if necessary.
*/
void