aboutsummaryrefslogtreecommitdiff
path: root/lib/libk/stdlib.h
diff options
context:
space:
mode:
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);
+
+///@}
+///@}