2011-12-22 16:19:25 +01:00
|
|
|
/*
|
|
|
|
* \brief C-library back end
|
|
|
|
* \author Norman Feske
|
|
|
|
* \date 2008-11-11
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2017-02-20 13:23:52 +01:00
|
|
|
* Copyright (C) 2008-2017 Genode Labs GmbH
|
2011-12-22 16:19:25 +01:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
2017-02-20 13:23:52 +01:00
|
|
|
* under the terms of the GNU Affero General Public License version 3.
|
2011-12-22 16:19:25 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#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
|
|
|
|
2012-07-30 21:12:59 +02:00
|
|
|
extern void genode_exit(int status) __attribute__((noreturn));
|
|
|
|
|
2011-12-22 16:19:25 +01:00
|
|
|
extern "C" void _exit(int status)
|
|
|
|
{
|
2012-07-30 21:12:59 +02:00
|
|
|
genode_exit(status);
|
2011-12-22 16:19:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
|
|
|
|
/* as provided by the original stdlib/exit.c */
|
|
|
|
int __isthreaded = 0;
|
|
|
|
|
|
|
|
void (*__cleanup)(void);
|
|
|
|
|
|
|
|
void exit(int status)
|
|
|
|
{
|
|
|
|
if (__cleanup)
|
|
|
|
(*__cleanup)();
|
|
|
|
|
|
|
|
_exit(status);
|
|
|
|
}
|
|
|
|
}
|