diff options
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; +} |