2011-12-22 16:19:25 +01:00
|
|
|
/*
|
|
|
|
* \brief C-library back end
|
|
|
|
* \author Norman Feske
|
|
|
|
* \date 2008-11-11
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2012-01-03 15:35:05 +01:00
|
|
|
* Copyright (C) 2008-2012 Genode Labs GmbH
|
2011-12-22 16:19:25 +01:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
|
|
* under the terms of the GNU General Public License version 2.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <base/env.h>
|
|
|
|
#include <base/sleep.h>
|
2012-06-06 10:19:48 +02:00
|
|
|
#include <base/printf.h>
|
2011-12-22 16:19:25 +01:00
|
|
|
|
|
|
|
extern "C" void _exit(int status)
|
|
|
|
{
|
|
|
|
Genode::env()->parent()->exit(status);
|
|
|
|
Genode::sleep_forever();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
|
|
|
|
/* as provided by the original stdlib/exit.c */
|
|
|
|
int __isthreaded = 0;
|
|
|
|
|
|
|
|
void (*__cleanup)(void);
|
|
|
|
|
|
|
|
void exit(int status)
|
|
|
|
{
|
2012-05-18 17:04:52 +02:00
|
|
|
if (status == 4) {
|
|
|
|
PDBG("PT: %p %p %p", __builtin_return_address(0), __builtin_return_address(1), __builtin_return_address(2));
|
|
|
|
}
|
2011-12-22 16:19:25 +01:00
|
|
|
if (__cleanup)
|
|
|
|
(*__cleanup)();
|
|
|
|
|
|
|
|
_exit(status);
|
|
|
|
}
|
|
|
|
}
|