Compare commits
3 Commits
684fa1c4b0
...
cbe835a2c8
| Author | SHA1 | Date |
|---|---|---|
|
|
cbe835a2c8 | |
|
|
6a77754adf | |
|
|
7d7d5ba734 |
|
|
@ -43,6 +43,7 @@ set(LIBC_SOURCES
|
||||||
strings.cpp
|
strings.cpp
|
||||||
sys/banan-os.cpp
|
sys/banan-os.cpp
|
||||||
sys/epoll.cpp
|
sys/epoll.cpp
|
||||||
|
sys/eventfd.cpp
|
||||||
sys/file.cpp
|
sys/file.cpp
|
||||||
sys/futex.cpp
|
sys/futex.cpp
|
||||||
sys/ioctl.cpp
|
sys/ioctl.cpp
|
||||||
|
|
@ -99,8 +100,8 @@ banan_install_headers(objlibc)
|
||||||
add_library(libc-static STATIC $<TARGET_OBJECTS:objlibc>)
|
add_library(libc-static STATIC $<TARGET_OBJECTS:objlibc>)
|
||||||
add_library(libc-shared SHARED $<TARGET_OBJECTS:objlibc>)
|
add_library(libc-shared SHARED $<TARGET_OBJECTS:objlibc>)
|
||||||
|
|
||||||
target_link_options(libc-static PRIVATE -nolibc)
|
target_link_options(libc-static PRIVATE -nolibc -nostdlib++)
|
||||||
target_link_options(libc-shared PRIVATE -nolibc)
|
target_link_options(libc-shared PRIVATE -nolibc -nostdlib++)
|
||||||
|
|
||||||
install(TARGETS libc-static OPTIONAL)
|
install(TARGETS libc-static OPTIONAL)
|
||||||
install(TARGETS libc-shared OPTIONAL)
|
install(TARGETS libc-shared OPTIONAL)
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,14 @@ static const char* errno_to_string(int error);
|
||||||
__builtin_unreachable();
|
__builtin_unreachable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t strlen(const char* s)
|
||||||
|
{
|
||||||
|
size_t len = 0;
|
||||||
|
while (*s++)
|
||||||
|
len++;
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
int strcmp(const char* s1, const char* s2)
|
int strcmp(const char* s1, const char* s2)
|
||||||
{
|
{
|
||||||
const unsigned char* u1 = reinterpret_cast<const unsigned char*>(s1);
|
const unsigned char* u1 = reinterpret_cast<const unsigned char*>(s1);
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,8 @@ inline void print_uint(int fd, T val, uint8_t base = 10)
|
||||||
print(fd, ptr);
|
print(fd, ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t strlen(const char* s);
|
||||||
|
|
||||||
int strcmp(const char* s1, const char* s2);
|
int strcmp(const char* s1, const char* s2);
|
||||||
char* strcpy(char* __restrict s1, const char* __restrict s2);
|
char* strcpy(char* __restrict s1, const char* __restrict s2);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue