diff options
Diffstat (limited to 'bsp/libwrap/sys/_exit.c')
-rw-r--r-- | bsp/libwrap/sys/_exit.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bsp/libwrap/sys/_exit.c b/bsp/libwrap/sys/_exit.c new file mode 100644 index 0000000..7261891 --- /dev/null +++ b/bsp/libwrap/sys/_exit.c @@ -0,0 +1,17 @@ +/* See LICENSE of license details. */ + +#include <unistd.h> +#include "platform.h" + +void __wrap__exit(int code) +{ +//volatile uint32_t* leds = (uint32_t*) (GPIO_BASE_ADDR + GPIO_OUT_OFFSET); + const char message[] = "\nProgam has exited with code:"; +//*leds = (~(code)); + + write(STDERR_FILENO, message, sizeof(message) - 1); + write_hex(STDERR_FILENO, code); + write(STDERR_FILENO, "\n", 1); + + for (;;); +} |