musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/malloc/memalign.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/malloc/memalign.c')
-rw-r--r--src/malloc/memalign.c 13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/malloc/memalign.c b/src/malloc/memalign.c
new file mode 100644
index 00000000..61f456e4
--- /dev/null
+++ b/src/malloc/memalign.c
@@ -0,0 +1,13 @@
+#include <stdlib.h>
+#include <errno.h>
+
+void *memalign(size_t align, size_t len)
+{
+ void *mem;
+ int ret;
+ if ((ret = posix_memalign(&mem, align, len))) {
+ errno = ret;
+ return 0;
+ }
+ return mem;
+}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月10日 01:07:38 +0000

AltStyle によって変換されたページ (->オリジナル) /