summaryrefslogtreecommitdiff
path: root/libguile/simpos.c
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2006-06-17 23:15:59 +0000
committerKevin Ryde <user42@zip.com.au>2006-06-17 23:15:59 +0000
commit23f2b9a3de013f093c5913aa381219f09353c676 (patch)
tree3a3315e24402e90d9c4094f18ac7ab6c2047f31f /libguile/simpos.c
parenta4f1c77ddb2057ca630b8bed9be437bdbc5dc552 (diff)
downloadguile-23f2b9a3de013f093c5913aa381219f09353c676.tar.gz
merge from 1.8 branch
Diffstat (limited to 'libguile/simpos.c')
-rw-r--r--libguile/simpos.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/libguile/simpos.c b/libguile/simpos.c
index 3d5d0feb7..79b9f3e3a 100644
--- a/libguile/simpos.c
+++ b/libguile/simpos.c
@@ -195,9 +195,9 @@ SCM_DEFINE (scm_getenv, "getenv", 1, 0, 0,
/* simple exit, without unwinding the scheme stack or flushing ports. */
SCM_DEFINE (scm_primitive_exit, "primitive-exit", 0, 1, 0,
(SCM status),
- "Terminate the current process without unwinding the Scheme stack.\n"
- "This is would typically be useful after a fork. The exit status\n"
- "is @var{status} if supplied, otherwise zero.")
+ "Terminate the current process without unwinding the Scheme\n"
+ "stack. The exit status is @var{status} if supplied, otherwise\n"
+ "zero.")
#define FUNC_NAME s_scm_primitive_exit
{
int cstatus = 0;
@@ -207,6 +207,25 @@ SCM_DEFINE (scm_primitive_exit, "primitive-exit", 0, 1, 0,
}
#undef FUNC_NAME
+SCM_DEFINE (scm_primitive__exit, "primitive-_exit", 0, 1, 0,
+ (SCM status),
+ "Terminate the current process using the _exit() system call and\n"
+ "without unwinding the Scheme stack. The exit status is\n"
+ "@var{status} if supplied, otherwise zero.\n"
+ "\n"
+ "This function is typically useful after a fork, to ensure no\n"
+ "Scheme cleanups or @code{atexit} handlers are run (those\n"
+ "usually belonging in the parent rather than the child).")
+#define FUNC_NAME s_scm_primitive__exit
+{
+ int cstatus = 0;
+ if (!SCM_UNBNDP (status))
+ cstatus = scm_to_int (status);
+ _exit (cstatus);
+}
+#undef FUNC_NAME
+
+
void
scm_init_simpos ()