aboutsummaryrefslogtreecommitdiff
path: root/lib/libk/stdlib.h
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2023-02-18 10:12:24 +0200
committeraqua <aqua@iserlohn-fortress.net>2023-02-18 10:12:24 +0200
commit41ee6b43c89ce67808a684ba67f69e964b0636fa (patch)
treefadee7301456711d567df030793c568a745bb522 /lib/libk/stdlib.h
parentGenerate dependency files for source code (diff)
downloadkernel-41ee6b43c89ce67808a684ba67f69e964b0636fa.tar.xz
Move C stdlib to lib/libk
Diffstat (limited to 'lib/libk/stdlib.h')
-rw-r--r--lib/libk/stdlib.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/libk/stdlib.h b/lib/libk/stdlib.h
new file mode 100644
index 0000000..84d9b2d
--- /dev/null
+++ b/lib/libk/stdlib.h
@@ -0,0 +1,31 @@
+#pragma once
+
+#include <stddef.h>
+
+///@defgroup libk libk
+///@{
+///@defgroup stdlib stdlib
+///@{
+
+/**
+ * Allocate size bytes and return a pointer to the allocated memory
+ */
+void *malloc(size_t size);
+
+/**
+ * Free the memory space pointed to by ptr
+ */
+void free(void *ptr);
+
+/**
+ * Fill the first n bytes of the memory area pointed to by s with the constant byte c.
+ */
+void *memset(void *s, int c, long unsigned n);
+
+/**
+ * Copy n bytes from memory area src to memory area dest. The memory areas must not overlap.
+ */
+void *memcpy(void *restrict dest, const void *restrict src, long unsigned n);
+
+///@}
+///@}