summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/_Exit.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-05-03 17:21:14 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-05-03 17:21:14 +0000
commitcb06773fd66aeb958d8723bdc65b3bc82ea4f1d1 (patch)
tree4dd0c45dcdc596b2898ce1423b07ac2be794af12 /lib/libc/stdlib/_Exit.c
parentcfe49fe7c49490fd81d472fbca32e752e1ea1347 (diff)
Add _Exit(3) as per C99. Discussed with espie@ some time ago.
Diffstat (limited to 'lib/libc/stdlib/_Exit.c')
-rw-r--r--lib/libc/stdlib/_Exit.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/libc/stdlib/_Exit.c b/lib/libc/stdlib/_Exit.c
new file mode 100644
index 00000000000..784015a21d6
--- /dev/null
+++ b/lib/libc/stdlib/_Exit.c
@@ -0,0 +1,26 @@
+/* $OpenBSD: _Exit.c,v 1.1 2004/05/03 17:21:13 millert Exp $ */
+
+/*
+ * Placed in the public domain by Todd C. Miller on January 21, 2004.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char *rcsid = "$OpenBSD: _Exit.c,v 1.1 2004/05/03 17:21:13 millert Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include <stdlib.h>
+#include <unistd.h>
+
+/*
+ * _Exit() is the ISO/ANSI C99 equivalent of the POSIX _exit() function.
+ * No atexit() handlers are called and no signal handlers are run.
+ * Whether or not stdio buffers are flushed or temporary files are removed
+ * is implementation-dependent. As such it is safest to *not* flush
+ * stdio buffers or remove temporary files. This is also consistent
+ * with most other implementations.
+ */
+void
+_Exit(int status)
+{
+ _exit(status);
+}