aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2012-03-23 05:39:19 +1300
committerMichael Kerrisk <mtk.manpages@gmail.com>2012-03-23 05:39:19 +1300
commit59b0228748a8e3a95964ea606235dca333840483 (patch)
treef46bf36923addc908765d077b105247e8083faa7
parentc36b993251e4ded5e5e9289341aa3cdc7247c91a (diff)
downloadman-pages-59b0228748a8e3a95964ea606235dca333840483.tar.gz
posix_memalign.3: Document pvalloc(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
-rw-r--r--man3/posix_memalign.332
1 files changed, 23 insertions, 9 deletions
diff --git a/man3/posix_memalign.3 b/man3/posix_memalign.3
index 6cec9f9d4f..78b49bace9 100644
--- a/man3/posix_memalign.3
+++ b/man3/posix_memalign.3
@@ -25,7 +25,7 @@
.\" 2001-10-11, 2003-08-22, aeb, added some details
.TH POSIX_MEMALIGN 3 2012-03-23 "GNU" "Linux Programmer's Manual"
.SH NAME
-posix_memalign, memalign, valloc \- Allocate aligned memory
+posix_memalign, memalign, valloc, pvalloc \- Allocate aligned memory
.SH SYNOPSIS
.nf
.B #include <stdlib.h>
@@ -36,6 +36,7 @@ posix_memalign, memalign, valloc \- Allocate aligned memory
.B #include <malloc.h>
.sp
.BI "void *memalign(size_t " boundary ", size_t " size );
+.BI "void *pvalloc(size_t " size );
.fi
.sp
.in -4n
@@ -113,12 +114,20 @@ The memory address will be a multiple of the page size.
It is equivalent to
.IR "memalign(sysconf(_SC_PAGESIZE),size)" .
-For all three routines, the memory is not zeroed.
+The obsolete function
+.BR pvalloc ()
+is similar to
+.BR valloc (),
+but rounds the size of the allocation up to
+the next multiple of the system page size.
+
+For all of these functions, the memory is not zeroed.
.SH "RETURN VALUE"
-.BR memalign ()
+.BR memalign (),
+.BR valloc (),
and
-.BR valloc ()
-return the pointer to the allocated memory, or NULL if the request fails.
+.BR pvalloc ()
+return a pointer to the allocated memory, or NULL if the request fails.
.BR posix_memalign ()
returns zero on success, or one of the error values listed in the
@@ -138,9 +147,10 @@ argument was not a power of two, or was not a multiple of
There was insufficient memory to fulfill the allocation request.
.SH VERSIONS
The functions
-.BR memalign ()
+.BR memalign (),
+.BR valloc (),
and
-.BR valloc ()
+.BR pvalloc ()
have been available in all Linux libc libraries.
The function
.BR posix_memalign ()
@@ -154,6 +164,10 @@ and as legacy in SUSv2.
It does not appear in POSIX.1-2001.
The function
+.BR pvalloc ()
+is a GNU extension.
+
+The function
.BR memalign ()
appears in SunOS 4.1.3 but not in 4.4BSD.
@@ -218,13 +232,13 @@ and then align the obtained value).
.\" but not to
.\" .IR realloc (3).
The glibc implementation
-allows memory obtained from any of these three routines to be
+allows memory obtained from any of these these functions to be
reclaimed with
.BR free (3).
The glibc
.BR malloc (3)
-always returns 8-byte aligned memory addresses, so these routines are only
+always returns 8-byte aligned memory addresses, so these functions are only
needed if you require larger alignment values.
.SH "SEE ALSO"
.BR brk (2),