Signed-off-by: Alejandro Colomar <[email protected]>
---
man/man3/memalign.3 | 76 ++++++++++++++++++++++++++++++++++++++-
man/man3/posix_memalign.3 | 46 ++----------------------
2 files changed, 78 insertions(+), 44 deletions(-)
diff --git a/man/man3/memalign.3 b/man/man3/memalign.3
index 791d4c801..cc341be7b 100644
--- a/man/man3/memalign.3
+++ b/man/man3/memalign.3
@@ -1 +1,75 @@
-.so man3/posix_memalign.3
+'\" t
+.\" Copyright, the authors of the Linux man-pages project
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.TH memalign 3 (date) "Linux man-pages (unreleased)"
+.SH NAME
+memalign
+\-
+allocate aligned memory
+.SH LIBRARY
+Standard C library
+.RI ( libc ,\~ \-lc )
+.SH SYNOPSIS
+.nf
+.B #include <malloc.h>
+.P
+.BI "[[deprecated]] void *memalign(size_t " alignment ", size_t " size );
+.fi
+.SH DESCRIPTION
+.BR memalign ()
+is the same as
+.BR aligned_alloc (3).
+.\" The behavior of memalign() for size==0 is as for posix_memalign()
+.\" but no standards govern this.
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lbx lb lb
+l l l.
+Interface Attribute Value
+T{
+.na
+.nh
+.BR memalign ()
+T} Thread safety MT-Safe
+.TE
+.SH VERSIONS
+On some systems
+.BR memalign ()
+is declared in
+.I <stdlib.h>
+instead of
+.IR <malloc.h> .
+.SH STANDARDS
+None.
+.SH HISTORY
+glibc 2.0.
+SunOS 4.1.3.
+.SH CAVEATS
+.BR memalign ()
+may not check that the
+.I alignment
+argument is correct.
+.P
+Some systems provide no way to reclaim memory allocated with
+.BR memalign ()
+(because one can pass to
+.BR free (3)
+only a pointer obtained from
+.BR malloc (3),
+while, for example,
+.BR memalign ()
+would call
+.BR malloc (3)
+and then align the obtained value).
+The glibc implementation
+allows memory obtained from
+.BR memalign ()
+to be reclaimed with
+.BR free (3).
+.SH SEE ALSO
+.BR aligned_alloc (3)
diff --git a/man/man3/posix_memalign.3 b/man/man3/posix_memalign.3
index ecbbd3e7a..3271292b7 100644
--- a/man/man3/posix_memalign.3
+++ b/man/man3/posix_memalign.3
@@ -5,7 +5,7 @@
.\"
.TH posix_memalign 3 (date) "Linux man-pages (unreleased)"
.SH NAME
-posix_memalign, aligned_alloc, memalign, valloc, pvalloc \-
+posix_memalign, aligned_alloc, valloc, pvalloc \-
allocate aligned memory
.SH LIBRARY
Standard C library
@@ -20,7 +20,6 @@ .SH SYNOPSIS
.P
.B #include <malloc.h>
.P
-.BI "[[deprecated]] void *memalign(size_t " alignment ", size_t " size );
.BI "[[deprecated]] void *pvalloc(size_t " size );
.fi
.P
@@ -77,13 +76,6 @@ .SH DESCRIPTION
The memory address will be a multiple of
.IR alignment ,
which must be a power of two.
-.\" The behavior of memalign() for size==0 is as for posix_memalign()
-.\" but no standards govern this.
-.P
-The obsolete function
-.BR memalign ()
-is the same as
-.BR aligned_alloc ().
.P
The obsolete function
.BR valloc ()
@@ -104,7 +96,6 @@ .SH DESCRIPTION
For all of these functions, the memory is not zeroed.
.SH RETURN VALUE
.BR aligned_alloc (),
-.BR memalign (),
.BR valloc (),
and
.BR pvalloc ()
@@ -149,7 +140,6 @@ .SH ATTRIBUTES
.na
.nh
.BR aligned_alloc (),
-.BR memalign (),
.BR posix_memalign ()
T} Thread safety MT-Safe
T{
@@ -168,8 +158,6 @@ .SH STANDARDS
.BR posix_memalign ()
POSIX.1-2024.
.TP
-.BR memalign ()
-.TQ
.BR valloc ()
None.
.TP
@@ -186,10 +174,6 @@ .SH HISTORY
glibc 2.1.91.
POSIX.1d, POSIX.1-2001.
.TP
-.BR memalign ()
-glibc 2.0.
-SunOS 4.1.3.
-.TP
.BR valloc ()
glibc 2.0.
3.0BSD.
@@ -205,13 +189,6 @@ .SS Headers
is declared in
.IR <stdlib.h> .
.P
-On some systems
-.BR memalign ()
-is declared in
-.I <stdlib.h>
-instead of
-.IR <malloc.h> .
-.P
According to SUSv2,
.BR valloc ()
is declared in
@@ -236,38 +213,21 @@ .SH NOTES
verifies that
.I alignment
matches the requirements detailed above.
-.BR memalign ()
-may not check that the
-.I alignment
-argument is correct.
.P
POSIX requires that memory obtained from
.BR posix_memalign ()
can be freed using
.BR free (3).
Some systems provide no way to reclaim memory allocated with
-.BR memalign ()
-or
.BR valloc ()
-(because one can pass to
-.BR free (3)
-only a pointer obtained from
-.BR malloc (3),
-while, for example,
-.BR memalign ()
-would call
-.BR malloc (3)
-and then align the obtained value).
+(see
+.BR memalign (3)).
.\" Other systems allow passing the result of
.\" .IR valloc ()
.\" to
.\" .IR free (3),
.\" but not to
.\" .IR realloc (3).
-The glibc implementation
-allows memory obtained from any of these functions to be
-reclaimed with
-.BR free (3).
.P
The glibc
.BR malloc (3)
--
2.51.0