summaryrefslogtreecommitdiffstats
path: root/lib/libc-headless/string
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2025-08-10 15:46:33 -0400
committerJon Santmyer <jon@jonsantmyer.com>2025-08-10 15:46:33 -0400
commit65ba015d6c1f248d36ad01a653bc49637804b15b (patch)
treea77c3fb3ca7ecac8f65eb9638d152f1e90307d0a /lib/libc-headless/string
downloadjove-os-65ba015d6c1f248d36ad01a653bc49637804b15b.tar.gz
jove-os-65ba015d6c1f248d36ad01a653bc49637804b15b.tar.bz2
jove-os-65ba015d6c1f248d36ad01a653bc49637804b15b.zip
working usermode objdir iteration
Diffstat (limited to 'lib/libc-headless/string')
-rw-r--r--lib/libc-headless/string/memcpy.c10
-rw-r--r--lib/libc-headless/string/memset.c7
2 files changed, 17 insertions, 0 deletions
diff --git a/lib/libc-headless/string/memcpy.c b/lib/libc-headless/string/memcpy.c
new file mode 100644
index 0000000..f71444d
--- /dev/null
+++ b/lib/libc-headless/string/memcpy.c
@@ -0,0 +1,10 @@
+#include <stddef.h>
+
+void*
+memcpy(void *dest, const void *src, size_t n)
+{
+ const unsigned char *s = src;
+ for(unsigned char *d = dest; n; n--)
+ *(d++) = *(s++);
+ return dest;
+}
diff --git a/lib/libc-headless/string/memset.c b/lib/libc-headless/string/memset.c
new file mode 100644
index 0000000..f79a4b4
--- /dev/null
+++ b/lib/libc-headless/string/memset.c
@@ -0,0 +1,7 @@
+#include <stddef.h>
+
+void
+memset(void *s, int c, size_t n)
+{
+ for(unsigned char *sb = s; n; n--) *(sb++) = c;
+}