projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rework langinfo code for ABI compat and for use by time code
[musl]
/
src
/
malloc
/
posix_memalign.c
diff --git
a/src/malloc/posix_memalign.c
b/src/malloc/posix_memalign.c
index
42cf274
..
cf67db6
100644
(file)
--- a/
src/malloc/posix_memalign.c
+++ b/
src/malloc/posix_memalign.c
@@
-1,9
+1,12
@@
#include <stdlib.h>
#include <errno.h>
#include <stdlib.h>
#include <errno.h>
+void *__memalign(size_t, size_t);
+
int posix_memalign(void **res, size_t align, size_t len)
{
int posix_memalign(void **res, size_t align, size_t len)
{
- void *mem = aligned_alloc(align, len);
+ if (align < sizeof(void *)) return EINVAL;
+ void *mem = __memalign(align, len);
if (!mem) return errno;
*res = mem;
return 0;
if (!mem) return errno;
*res = mem;
return 0;