2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
5 POSIX.1-2008 function posix_memalign().
10 /*****************************************************************************
23 Allocate aligned memory.
26 memptr - Pointer to a place to store the pointer to allocated memory.
27 alignment - Alignment of allocated memory. The address of the
28 allocated memory will be a multiple of this value, which
29 must be a power of two and a multiple of sizeof(void *).
30 size - How much memory to allocate.
33 Returns zero on success.
34 Returns EINVAL if the alignment parameter was not a power of two, or
35 was not a multiple of sizeof(void *).
36 Returns ENOMEM if there was insufficient memory to fulfill the request.
39 Memory allocated by posix_memalign() should be freed with free(). If
40 not, it will be freed when the program terminates.
42 If an error occurs, errno will not be set.
49 stdc.library/malloc_align(), stdc.library/calloc(),
50 stdc.library/free(), stdc.library/malloc()
54 ******************************************************************************/
56 int ret
= 0, old_errno
;
60 *memptr
= malloc_align(size
, alignment
);