MLINKS+=insque.3 remque.3
MLINKS+=lsearch.3 lfind.3
MLINKS+=malloc.3 calloc.3 malloc.3 free.3 malloc.3 realloc.3 malloc.3 reallocf.3
+MLINKS+=posix_memalign.3 aligned_alloc.3
MLINKS+=ptsname.3 grantpt.3 ptsname.3 unlockpt.3
MLINKS+=qsort.3 heapsort.3 qsort.3 mergesort.3 qsort.3 qsort_r.3
MLINKS+=radixsort.3 sradixsort.3
.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd May 2, 2009
+.Dd August 9, 2012
.Dt POSIX_MEMALIGN 3
.Os
.Sh NAME
-.Nm posix_memalign
+.Nm posix_memalign ,
+.Nm aligned_alloc
.Nd aligned memory allocation
.Sh LIBRARY
.Lb libc
.In stdlib.h
.Ft int
.Fn posix_memalign "void **ptr" "size_t alignment" "size_t size"
+.Ft void *
+.Fn aligned_alloc "size_t alignment" "size_t size"
.Sh DESCRIPTION
The
.Fn posix_memalign
.Xr reallocf 3 ,
and
.Xr free 3 .
+.Pp
+The
+.Fn aligned_alloc
+function is the same as
+.Fn posix_memalign ,
+but it takes just
+.Fa alignment
+and
+.Fa size
+and the allocation pointer is returned.
.Sh IMPLEMENTATION NOTES
The
.Fn posix_memalign
The
.Fn posix_memalign
function returns the value 0 if successful; otherwise it returns an error value.
+The
+.Fn aligned_alloc
+returns a pointer to the allocated memory if successful; otherwise a
+.Dv NULL
+pointer is returned and
+.Va errno
+is set.
.Sh ERRORS
The
.Fn posix_memalign
-function will fail if:
+and
+.Fn aligned_alloc
+functions will fail if:
.Bl -tag -width Er
.It Bq Er EINVAL
The
.Fn posix_memalign
function conforms to
.St -p1003.1-2008 .
+.\"The
+.\".Fn aligned_alloc
+.\"function conforms to
+.\".St -isoC-2011 .