diff options
| author | millert <> | 2004-05-03 17:21:13 +0000 |
|---|---|---|
| committer | millert <> | 2004-05-03 17:21:13 +0000 |
| commit | ec47889776b306f56c691ad8120367908f17299e (patch) | |
| tree | 9c6d4f28de6cc1195e43c8c46792240d297c5c78 /src/lib/libc/stdlib/_Exit.c | |
| parent | c81aca6074576d87ed097daa64164db3977c2b8b (diff) | |
| download | openbsd-ec47889776b306f56c691ad8120367908f17299e.tar.gz openbsd-ec47889776b306f56c691ad8120367908f17299e.tar.bz2 openbsd-ec47889776b306f56c691ad8120367908f17299e.zip | |
Add _Exit(3) as per C99. Discussed with espie@ some time ago.
Diffstat (limited to 'src/lib/libc/stdlib/_Exit.c')
| -rw-r--r-- | src/lib/libc/stdlib/_Exit.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/libc/stdlib/_Exit.c b/src/lib/libc/stdlib/_Exit.c new file mode 100644 index 0000000000..784015a21d --- /dev/null +++ b/src/lib/libc/stdlib/_Exit.c | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | /* $OpenBSD: _Exit.c,v 1.1 2004/05/03 17:21:13 millert Exp $ */ | ||
| 2 | |||
| 3 | /* | ||
| 4 | * Placed in the public domain by Todd C. Miller on January 21, 2004. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #if defined(LIBC_SCCS) && !defined(lint) | ||
| 8 | static char *rcsid = "$OpenBSD: _Exit.c,v 1.1 2004/05/03 17:21:13 millert Exp $"; | ||
| 9 | #endif /* LIBC_SCCS and not lint */ | ||
| 10 | |||
| 11 | #include <stdlib.h> | ||
| 12 | #include <unistd.h> | ||
| 13 | |||
| 14 | /* | ||
| 15 | * _Exit() is the ISO/ANSI C99 equivalent of the POSIX _exit() function. | ||
| 16 | * No atexit() handlers are called and no signal handlers are run. | ||
| 17 | * Whether or not stdio buffers are flushed or temporary files are removed | ||
| 18 | * is implementation-dependent. As such it is safest to *not* flush | ||
| 19 | * stdio buffers or remove temporary files. This is also consistent | ||
| 20 | * with most other implementations. | ||
| 21 | */ | ||
| 22 | void | ||
| 23 | _Exit(int status) | ||
| 24 | { | ||
| 25 | _exit(status); | ||
| 26 | } | ||
