summaryrefslogtreecommitdiff
path: root/lib/atexit.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-05-06 14:33:22 +0000
committerJim Meyering <jim@meyering.net>2000-05-06 14:33:22 +0000
commit6507fa63cee634efb90511d5acbf21a6bf86e609 (patch)
tree01f8674bcf6b8cadb75d15def2fee24b8aa4618d /lib/atexit.c
parente074cde09b281e7bfcedbd1998a2dbf6f09a8943 (diff)
downloadcoreutils-6507fa63cee634efb90511d5acbf21a6bf86e609.tar.xz
New file, from libiberty.
Diffstat (limited to 'lib/atexit.c')
-rw-r--r--lib/atexit.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/atexit.c b/lib/atexit.c
new file mode 100644
index 000000000..137d985e4
--- /dev/null
+++ b/lib/atexit.c
@@ -0,0 +1,18 @@
+/* Wrapper to implement ANSI C's atexit using SunOS's on_exit. */
+/* This function is in the public domain. --Mike Stump. */
+
+#include "config.h"
+
+#ifdef HAVE_ON_EXIT
+
+int
+atexit(f)
+ void (*f)();
+{
+ /* If the system doesn't provide a definition for atexit, use on_exit
+ if the system provides that. */
+ on_exit (f, 0);
+ return 0;
+}
+
+#endif