Files
codezero/conts/posix/libposix/exit.c
Bahadir Balban 7ba7a2e796 Added a simplified ascii_to_int() implementation.
Removed dependency on hard-coded pager id. Pager id is now passed
as an environment string `pagerid' to tasks. Alternatively, this
could take space in the utcb of each task.
2009-10-17 18:48:30 +03:00

28 lines
582 B
C

#include <l4lib/arch/syscalls.h>
#include <l4lib/arch/syslib.h>
#include <l4lib/ipcdefs.h>
#include <unistd.h>
#include <l4/macros.h>
#include <libposix.h>
static inline void __attribute__ ((noreturn)) l4_exit(int status)
{
int ret;
write_mr(L4SYS_ARG0, status);
/* Call pager with exit() request and block on its receive phase */
ret = l4_sendrecv(pagerid, pagerid, L4_IPC_TAG_EXIT);
/* This call should not fail or return */
print_err("%s: L4 IPC returned: %d.\n", __FUNCTION__, ret);
BUG();
}
void __attribute__ ((noreturn)) _exit(int status)
{
l4_exit(status);
}