From bb59107bd06a6a252b3743f17e55e3c17896db35 Mon Sep 17 00:00:00 2001 From: EmulatedSeasons <89668582+EmulatedSeasons@users.noreply.github.com> Date: Sun, 7 Jan 2024 03:19:28 -0500 Subject: moved kernel libc stuff to libs/libck/ --- libs/libck/memcmp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 libs/libck/memcmp.c (limited to 'libs/libck/memcmp.c') diff --git a/libs/libck/memcmp.c b/libs/libck/memcmp.c new file mode 100644 index 0000000..93141e1 --- /dev/null +++ b/libs/libck/memcmp.c @@ -0,0 +1,13 @@ +#include + +int memcmp(const void* aptr, const void* bptr, size_t size) { + const unsigned char* a = (const unsigned char*) aptr; + const unsigned char* b = (const unsigned char*) bptr; + for (size_t i = 0; i < size; i++) { + if (a[i] < b[i]) + return -1; + else if (b[i] < a[i]) + return 1; + } + return 0; +} \ No newline at end of file -- cgit v1.2.3-70-g09d2