Files
codezero/tasks/libposix/exit.c
Bahadir Balban 32b3dfe91d Fixed various faults with execve().
Added a new ordered task_insert_vma() function
2008-12-02 14:15:40 +02:00

28 lines
596 B
C

#include <l4lib/arch/syscalls.h>
#include <l4lib/arch/syslib.h>
#include <l4lib/ipcdefs.h>
#include <unistd.h>
#include <l4/macros.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(PAGER_TID, PAGER_TID, L4_IPC_TAG_EXIT);
/* This call should not fail or return */
printf("%s: L4 IPC returned: %d.\n", __FUNCTION__, ret);
BUG();
}
void __attribute__ ((noreturn)) _exit(int status)
{
printf("In %s.\n", __FUNCTION__);
l4_exit(status);
}