math: move x87-family fabs functions to C with inline asm
[musl] / src / malloc / posix_memalign.c
1 #include <stdlib.h>
2 #include <errno.h>
3 #include "malloc_impl.h"
4
5 int posix_memalign(void **res, size_t align, size_t len)
6 {
7         if (align < sizeof(void *)) return EINVAL;
8         void *mem = __memalign(align, len);
9         if (!mem) return errno;
10         *res = mem;
11         return 0;
12 }