From 0446478ce47b84ac2151e486c6932194c20274f3 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Tue, 14 Jun 2022 20:01:39 +0300 Subject: [PATCH] Main: libc/include/stdlib.h> Implement stubs for "exit" and "abort" --- Makefile.am | 1 + libc/src/stdlib.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/Makefile.am b/Makefile.am index c41c2738..37ac52c1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,6 +6,7 @@ EXTRA_DIST = autogen.sh CONTRIBUTING.md sha256sums.txt SUBDIRS = include if WITH_LIBC +# FIXME: after "make clean" libc is not rebuiling SUBDIRS += libc endif diff --git a/libc/src/stdlib.c b/libc/src/stdlib.c index c97ee6be..19590316 100644 --- a/libc/src/stdlib.c +++ b/libc/src/stdlib.c @@ -6,6 +6,18 @@ #include #include +// TODO: stub +void exit(const int status __attribute__((unused))) +{ + for (;;); +} + +// TODO: stub +void abort() +{ + exit(EXIT_FAILURE); +} + int atoi(const char *str) { while (isspace(*str)) ++str;