summaryrefslogtreecommitdiffstats
path: root/sysif.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-02-06 06:37:35 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-02-06 06:37:35 -0800
commitb0d0ba0657ff67cdc29bee3b305c3c72f55725f7 (patch)
treecc24376e8562f90d305a0d0295fda29504c3c28e /sysif.c
parent3286f2ca94da081bca5ddeffdfcc6ec92adf237c (diff)
downloadtxr-b0d0ba0657ff67cdc29bee3b305c3c72f55725f7.tar.gz
txr-b0d0ba0657ff67cdc29bee3b305c3c72f55725f7.tar.bz2
txr-b0d0ba0657ff67cdc29bee3b305c3c72f55725f7.zip
* sysif.c (abort_wrap): New static function.
(sysif_init): Registered abort intrinsic. * txr.1: Documented abort. Changed Unix Programming heading to System Programming, since exit, abort and errno are not Unix-specific, but C-specific. * tl.vim, txr.vim: Updated.
Diffstat (limited to 'sysif.c')
-rw-r--r--sysif.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sysif.c b/sysif.c
index 322d93e2..c401b23a 100644
--- a/sysif.c
+++ b/sysif.c
@@ -93,6 +93,11 @@ static val exit_wrap(val status)
return nil;
}
+static val abort_wrap(void)
+{
+ abort();
+}
+
static val usleep_wrap(val usec)
{
val retval;
@@ -365,6 +370,7 @@ void sysif_init(void)
{
reg_fun(intern(lit("errno"), user_package), func_n1o(errno_wrap, 0));
reg_fun(intern(lit("exit"), user_package), func_n1(exit_wrap));
+ reg_fun(intern(lit("abort"), user_package), func_n0(abort_wrap));
reg_fun(intern(lit("usleep"), user_package), func_n1(usleep_wrap));
#if HAVE_UNISTD_H
reg_fun(intern(lit("getpid"), user_package), func_n0(getpid_wrap));