From b9535e1b089f14f7123d0865a06b985d2285dabf Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 30 Jul 2017 15:36:45 +0200 Subject: Initial commit, blink working --- base.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 base.c (limited to 'base.c') diff --git a/base.c b/base.c new file mode 100644 index 0000000..8c9de6f --- /dev/null +++ b/base.c @@ -0,0 +1,20 @@ + +#include + +int __errno = 0; +void *_impure_ptr = NULL; + +void __sinit(void) { +} + +void memset(void *s, int c, size_t n) { + char *end = (char *)s + n; + for (char *p = (char *)s; p < end; p++) + *p = (char)c; +} + +size_t strlen(const char *s) { + const char *start = s; + while (*s++); + return s - start - 1; +} -- cgit