diff --git a/arch/generic.h b/arch/generic.h index 96f6478..3369616 100644 --- a/arch/generic.h +++ b/arch/generic.h @@ -17,6 +17,15 @@ void *memset(void* s, int c, unsigned long n) { } #endif // !MEMSET_DEFINED +#ifndef _STRLEN_DEFINED +#define _STRLEN_DEFINED +int strlen(char* s) { + int len = 0; + for(;s[len] != 0; ++len); + return len; +} +#endif // !_STRLEN_DEFINED + #ifndef _START_DEFINED #define _START_DEFINED // Generic _start implementation. Can't access any args diff --git a/sys.h b/sys.h index af6e18d..791acbf 100644 --- a/sys.h +++ b/sys.h @@ -143,5 +143,6 @@ int clock_nanosleep(clockid_t clockid, int flags, const struct timespec *t, stru uint32_t fork(); void *memset(void* s, int c, unsigned long n); +int strlen(char* s); #endif // !MINIMALSYS_H