From 7aecb0b276462f84b4fa6ef94357b9bef74a6e21 Mon Sep 17 00:00:00 2001 From: Pawel Dziepak Date: Tue, 1 Oct 2013 15:51:07 +0200 Subject: [PATCH] kernel/util: Make exit() available in kernel mode Since we are using libraries originally intendent for user mode in kernel mode providing them with some userland functions is inevitable. This particular patch is to make zlib happy and able to call exit() when its debug assertions fails. --- src/system/kernel/util/kernel_cpp.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/system/kernel/util/kernel_cpp.cpp b/src/system/kernel/util/kernel_cpp.cpp index 1fdbb4d7f2..ca5e44e7e9 100644 --- a/src/system/kernel/util/kernel_cpp.cpp +++ b/src/system/kernel/util/kernel_cpp.cpp @@ -251,6 +251,15 @@ abort() panic("abort() called!"); } + +extern "C" +void +exit(int status) +{ + panic("exit() called with status code = %d!", status); +} + + extern "C" void debugger(const char *message)