summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-07-13 20:16:12 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-07-13 20:16:12 +0200
commitc61f1ce5b9268d3b107f03d03d66e830eaa98891 (patch)
tree9a8a44fea389537d4687507eddb97c18b71bf453
parent7d356b1ddab0150b7347a5952e3bff2a04704fd4 (diff)
downloadabaos-c61f1ce5b9268d3b107f03d03d66e830eaa98891.tar.gz
abaos-c61f1ce5b9268d3b107f03d03d66e830eaa98891.tar.bz2
removed som kernel_panics in libc
-rw-r--r--BUGS5
-rw-r--r--src/libc/stdlib.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/BUGS b/BUGS
index 8e5ebbe..4801a61 100644
--- a/BUGS
+++ b/BUGS
@@ -22,4 +22,7 @@
to implement a stub module for instance using some host functions
like standard io of the host C library
- memorymanagement should be a library of the libc or even a standalone
- library, not part of the kernel directory
+ library, not part of the kernel directory, get rid of kernel_panic
+ there (this requires the kernel_stub.c kernel_panic to exist in
+ libc tests)
+
diff --git a/src/libc/stdlib.c b/src/libc/stdlib.c
index b4c2d84..07eabd4 100644
--- a/src/libc/stdlib.c
+++ b/src/libc/stdlib.c
@@ -67,7 +67,14 @@ void __attribute__( ( noreturn ) ) abort( void )
{
// TODO: this should be done on process level, terminating
// the process (by signalling SIGABRT for instance)
+#ifdef OS_ABAOS
kernel_panic( "aborted" );
+#endif
+#ifdef OS_LINUX
+ // TODO: this clearly wrong, but for now we exit with a 255 exit code
+ // on abort..
+ syscall1( __NR_exit, 255 );
+#endif
// make gcc happy ("error: ‘noreturn’ function does return")
for( ;; );