diff options
author | d <> | 1998-11-20 11:18:51 +0000 |
---|---|---|
committer | d <> | 1998-11-20 11:18:51 +0000 |
commit | c1f295aa8666eb1c08a1edf944ac5617659a066c (patch) | |
tree | efe0a5dfb4f9767f96ab03ce9c00dc5bcc98074c /src/lib/libc/stdlib/exit.c | |
parent | 5a11336d3f08469f2747ebcf26ae777dba46fd22 (diff) | |
download | openbsd-c1f295aa8666eb1c08a1edf944ac5617659a066c.tar.gz openbsd-c1f295aa8666eb1c08a1edf944ac5617659a066c.tar.bz2 openbsd-c1f295aa8666eb1c08a1edf944ac5617659a066c.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 'src/lib/libc/stdlib/exit.c')
-rw-r--r-- | src/lib/libc/stdlib/exit.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/libc/stdlib/exit.c b/src/lib/libc/stdlib/exit.c index e358c94fd6..bc7fd395ca 100644 --- a/src/lib/libc/stdlib/exit.c +++ b/src/lib/libc/stdlib/exit.c | |||
@@ -32,7 +32,7 @@ | |||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #if defined(LIBC_SCCS) && !defined(lint) | 34 | #if defined(LIBC_SCCS) && !defined(lint) |
35 | static char *rcsid = "$OpenBSD: exit.c,v 1.2 1996/08/19 08:33:30 tholo Exp $"; | 35 | static char *rcsid = "$OpenBSD: exit.c,v 1.3 1998/11/20 11:18:50 d Exp $"; |
36 | #endif /* LIBC_SCCS and not lint */ | 36 | #endif /* LIBC_SCCS and not lint */ |
37 | 37 | ||
38 | #include <stdlib.h> | 38 | #include <stdlib.h> |
@@ -42,6 +42,15 @@ static char *rcsid = "$OpenBSD: exit.c,v 1.2 1996/08/19 08:33:30 tholo Exp $"; | |||
42 | void (*__cleanup)(); | 42 | void (*__cleanup)(); |
43 | 43 | ||
44 | /* | 44 | /* |
45 | * This variable is zero until a process has created a thread. | ||
46 | * It is used to avoid calling locking functions in libc when they | ||
47 | * are not required. By default, libc is intended to be(come) | ||
48 | * thread-safe, but without a (significant) penalty to non-threaded | ||
49 | * processes. | ||
50 | */ | ||
51 | int __isthreaded = 0; | ||
52 | |||
53 | /* | ||
45 | * Exit, flushing stdio buffers if necessary. | 54 | * Exit, flushing stdio buffers if necessary. |
46 | */ | 55 | */ |
47 | void | 56 | void |