projects
/
oweals
/
musl.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
implement hcreate_r, hdestroy_r and hsearch_r
[oweals/musl.git]
/
src
/
malloc
/
posix_memalign.c
1
#include <stdlib.h>
2
#include <errno.h>
3
4
void *__memalign(size_t, size_t);
5
6
int posix_memalign(void **res, size_t align, size_t len)
7
{
8
if (align < sizeof(void *)) return EINVAL;
9
void *mem = __memalign(align, len);
10
if (!mem) return errno;
11
*res = mem;
12
return 0;
13
}