Firmwares/hello-world/bsp/libwrap/sys/_exit.c

18 lines
361 B
C
Raw Permalink Normal View History

2018-09-25 18:31:29 +02:00
/* See LICENSE of license details. */
#include <unistd.h>
#include "platform.h"
2018-09-26 08:07:48 +02:00
#include "weak_under_alias.h"
2018-09-25 18:31:29 +02:00
2018-09-26 08:07:48 +02:00
void __wrap_exit(int code)
2018-09-25 18:31:29 +02:00
{
const char message[] = "\nProgam has exited with code:";
write(STDERR_FILENO, message, sizeof(message) - 1);
write_hex(STDERR_FILENO, code);
write(STDERR_FILENO, "\n", 1);
for (;;);
}
2018-09-26 08:07:48 +02:00
weak_under_alias(exit);