aboutsummaryrefslogtreecommitdiffstats
path: root/man
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2018-11-03 15:06:08 +0100
committerMattias Andrée <maandree@kth.se>2018-11-03 15:06:08 +0100
commit151588cc8dc00031576fd53351d6c7e076fc9ced (patch)
treee32fbea90f214ed0b228a5ba2797f16416b3ed7c /man
parentFix man pages (diff)
downloadlibsimple-151588cc8dc00031576fd53351d6c7e076fc9ced.tar.gz
libsimple-151588cc8dc00031576fd53351d6c7e076fc9ced.tar.bz2
libsimple-151588cc8dc00031576fd53351d6c7e076fc9ced.tar.xz
Add and fix man pages
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--man/libsimple_aligned_allocz.3186
-rw-r--r--man/libsimple_enaligned_alloc.3147
-rw-r--r--man/libsimple_memalign.3177
-rw-r--r--man/libsimple_memalignz.3180
-rw-r--r--man/libsimple_pvalloc.312
-rw-r--r--man/libsimple_pvallocz.34
-rw-r--r--man/libsimple_valigned_allocn.3235
-rw-r--r--man/libsimple_valigned_alloczn.3239
-rw-r--r--man/libsimple_valloc.311
-rw-r--r--man/libsimple_vallocz.34
-rw-r--r--man/libsimple_vmalloczn.316
-rw-r--r--man/libsimple_vmemalignn.3229
-rw-r--r--man/libsimple_vmemalignzn.3233
-rw-r--r--man/libsimple_vpvalloczn.316
-rw-r--r--man/libsimple_vvalloczn.316
15 files changed, 1665 insertions, 40 deletions
diff --git a/man/libsimple_aligned_allocz.3 b/man/libsimple_aligned_allocz.3
new file mode 100644
index 0000000..dc3bc44
--- /dev/null
+++ b/man/libsimple_aligned_allocz.3
@@ -0,0 +1,186 @@
+.TH LIBSIMPLE_ALIGNED_ALLOCZ 3 2018-11-03 libsimple
+.SH NAME
+libsimple_aligned_allocz \- allocate optionally initialised memory with custom alignment
+.SH SYNOPSIS
+.nf
+#include <libsimple.h>
+
+static inline void *libsimple_aligned_allocz(int \fIclear\fP, size_t \fIalignment\fP, size_t \fIn\fP);
+void *libsimple_enaligned_allocz(int \fIstatus\fP, int \fIclear\fP, size_t \fIalignment\fP, size_t \fIn\fP);
+static inline void *libsimple_ealigned_allocz(int \fIclear\fP, size_t \fIalignment\fP, size_t \fIn\fP);
+
+#ifndef aligned_allocz
+# define aligned_allocz libsimple_aligned_allocz
+#endif
+#ifndef enaligned_allocz
+# define enaligned_allocz libsimple_enaligned_allocz
+#endif
+#ifndef ealigned_allocz
+# define ealigned_allocz libsimple_ealigned_allocz
+#endif
+.fi
+.PP
+Link with
+.IR \-lsimple .
+.SH DESCRIPTION
+The
+.BR libsimple_aligned_allocz (),
+.BR libsimple_enaligned_allocz (),
+and
+.BR libsimple_ealigned_allocz ()
+functions allocate
+.I n
+bytes to the heap and return a pointer with an
+alignment of
+.I alignment
+bytes to the allocated memory. The memory will be
+initialised with zeroes if
+.I clear
+is a non-zero value. The function
+.BR free (3)
+shall be called with the returned pointer as
+input when the allocated memory is no longer needed.
+.PP
+The
+.BR libsimple_enaligned_allocz ()
+and
+.BR libsimple_ealigned_allocz ()
+functions will terminate the process if the memory
+cannot be allocated of if the user tries to allocate
+0 bytes, by calling the
+.BR libsimple_enprintf ()
+and
+.BR libsimple_eprintf ()
+functions, respectively.
+On failure, the process's exit value will be
+.I status
+if the
+.BR libsimple_enaligned_allocz ()
+function is used or
+.IR libsimple_default_failure_exit (3)
+if the
+.BR libsimple_ealigned_allocz ()
+function is used.
+.PP
+The
+.BR libsimple_enaligned_allocz ()
+and
+.BR libsimple_ealigned_allocz ()
+functions behaviour is unspecified if
+.I n
+is 0.
+.SH RETURN VALUE
+The
+.BR libsimple_aligned_allocz (),
+.BR libsimple_enaligned_allocz (),
+and
+.BR libsimple_ealigned_allocz ()
+functions return a pointer to the allocated memory
+upon success completion; otherwise the
+.BR libsimple_aligned_allocz ()
+function return
+.B NULL
+and set
+.I errno
+it indicate the error, and the
+.BR libsimple_enaligned_allocz ()
+and
+.BR libsimple_ealigned_allocz ()
+functions terminated the process.
+.SH ERRORS
+The
+.BR libsimple_aligned_allocz ()
+function will fail if:
+.TP
+.B EINVAL
+.I n
+is 0.
+.TP
+.B EINVAL
+.I n
+is not a multiple of
+.IR alignment .
+.TP
+.B EINVAL
+.I alignment
+is not a power of two.
+.TP
+.B ENOMEM
+Enough memory could not be allocated.
+.PP
+The
+.BR libsimple_enaligned_allocz ()
+and
+.BR libsimple_ealigned_allocz ()
+functions will terminate the process on failure.
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lb lb lb
+l l l.
+Interface Attribute Value
+T{
+.BR libsimple_aligned_allocz (),
+.br
+.BR libsimple_enaligned_allocz (),
+.br
+.BR libsimple_ealigned_allocz ()
+T} Thread safety MT-Safe
+T{
+.BR libsimple_aligned_allocz (),
+.br
+.BR libsimple_enaligned_allocz (),
+.br
+.BR libsimple_ealigned_allocz ()
+T} Async-signal safety AS-Safe
+T{
+.BR libsimple_aligned_allocz (),
+.br
+.BR libsimple_enaligned_allocz (),
+.br
+.BR libsimple_ealigned_allocz ()
+T} Async-cancel safety AC-Safe
+.TE
+.SH EXAMPLES
+None.
+.SH APPLICATION USAGE
+None.
+.SH RATIONALE
+None.
+.SH FUTURE DIRECTIONS
+None.
+.SH NOTES
+None.
+.SH BUGS
+None.
+.SH SEE ALSO
+.BR libsimple_enmalloc (3),
+.BR libsimple_mallocz (3),
+.BR libsimple_vmallocn (3),
+.BR libsimple_vmalloczn (3),
+.BR libsimple_encalloc (3),
+.BR libsimple_vcallocn (3),
+.BR libsimple_enrealloc (3),
+.BR libsimple_vreallocn (3),
+.BR libsimple_memalign (3),
+.BR libsimple_memalignz (3),
+.BR libsimple_vmemalignn (3),
+.BR libsimple_vmemalignzn (3),
+.BR libsimple_enposix_memalign (3),
+.BR libsimple_posix_memalignz (3),
+.BR libsimple_vposix_memalignn (3),
+.BR libsimple_vposix_memalignzn (3),
+.BR libsimple_enaligned_alloc (3),
+.BR libsimple_valigned_allocn (3),
+.BR libsimple_valigned_alloczn (3),
+.BR libsimple_pvalloc (3),
+.BR libsimple_pvallocz (3),
+.BR libsimple_vpvallocn (3),
+.BR libsimple_vpvalloczn (3),
+.BR libsimple_valloc (3),
+.BR libsimple_vallocz (3),
+.BR libsimple_vvallocn (3),
+.BR libsimple_vvalloczn (3),
+.BR aligned_alloc (3)
diff --git a/man/libsimple_enaligned_alloc.3 b/man/libsimple_enaligned_alloc.3
new file mode 100644
index 0000000..e21b438
--- /dev/null
+++ b/man/libsimple_enaligned_alloc.3
@@ -0,0 +1,147 @@
+.TH LIBSIMPLE_ENALIGNED_ALLOC 3 2018-11-03 libsimple
+.SH NAME
+libsimple_enaligned_alloc \- allocate memory with custom alignment or die
+.SH SYNOPSIS
+.nf
+#include <libsimple.h>
+
+static inline void *libsimple_enaligned_alloc(int \fIstatus\fP, size_t \fIalignment\fP, size_t \fIn\fP);
+static inline void *libsimple_ealigned_alloc(size_t \fIalignment\fP, size_t \fIn\fP);
+
+#ifndef enaligned_alloc
+# define enaligned_alloc libsimple_enaligned_alloc
+#endif
+#ifndef ealigned_alloc
+# define ealigned_alloc libsimple_ealigned_alloc
+#endif
+.fi
+.PP
+Link with
+.IR \-lsimple .
+.SH DESCRIPTION
+The
+.BR libsimple_enaligned_alloc ()
+and
+.BR libsimple_ealigned_alloc ()
+functions allocate
+.I n
+uninitialised bytes to the heap and return a
+pointer with an alignment of
+.I alignment
+bytes to the allocated memory. The function
+.BR free (3)
+shall be called with the returned pointer as
+input when the allocated memory is no longer needed.
+.PP
+The
+.BR libsimple_enaligned_alloc ()
+and
+.BR libsimple_ealigned_alloc ()
+functions will terminate the process if the memory
+cannot be allocated of if the user tries to allocate
+0 bytes, by calling the
+.BR libsimple_enprintf ()
+and
+.BR libsimple_eprintf ()
+functions, respectively.
+On failure, the process's exit value will be
+.I status
+if the
+.BR libsimple_enaligned_alloc ()
+function is used or
+.IR libsimple_default_failure_exit (3)
+if the
+.BR libsimple_ealigned_alloc ()
+function is used. Failure include,
+.I alignment
+not being a power of two, or
+.I n
+not being a multiple of
+.IR alignment .
+.PP
+The
+.BR libsimple_enaligned_alloc ()
+and
+.BR libsimple_ealigned_alloc ()
+functions behaviour is unspecified if
+.I n
+is 0.
+.SH RETURN VALUE
+The
+.BR libsimple_enaligned_alloc (),
+and
+.BR libsimple_ealigned_alloc ()
+functions return a pointer to the allocated memory
+upon success completion; otherwise the process is
+terminated.
+.SH ERRORS
+The
+.BR libsimple_enaligned_alloc ()
+and
+.BR libsimple_ealigned_alloc ()
+functions will terminate the process on failure.
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lb lb lb
+l l l.
+Interface Attribute Value
+T{
+.BR libsimple_enaligned_alloc (),
+.br
+.BR libsimple_ealigned_alloc ()
+T} Thread safety MT-Safe
+T{
+.BR libsimple_enaligned_alloc (),
+.br
+.BR libsimple_ealigned_alloc ()
+T} Async-signal safety AS-Safe
+T{
+.BR libsimple_enaligned_alloc (),
+.br
+.BR libsimple_ealigned_alloc ()
+T} Async-cancel safety AC-Safe
+.TE
+.SH EXAMPLES
+None.
+.SH APPLICATION USAGE
+None.
+.SH RATIONALE
+None.
+.SH FUTURE DIRECTIONS
+None.
+.SH NOTES
+None.
+.SH BUGS
+None.
+.SH SEE ALSO
+.BR libsimple_enmalloc (3),
+.BR libsimple_mallocz (3),
+.BR libsimple_vmallocn (3),
+.BR libsimple_vmalloczn (3),
+.BR libsimple_encalloc (3),
+.BR libsimple_vcallocn (3),
+.BR libsimple_enrealloc (3),
+.BR libsimple_vreallocn (3),
+.BR libsimple_memalign (3),
+.BR libsimple_memalignz (3),
+.BR libsimple_vmemalignn (3),
+.BR libsimple_vmemalignzn (3),
+.BR libsimple_enposix_memalign (3),
+.BR libsimple_posix_memalignz (3),
+.BR libsimple_vposix_memalignn (3),
+.BR libsimple_vposix_memalignzn (3),
+.BR libsimple_aligned_allocz (3),
+.BR libsimple_valigned_allocn (3),
+.BR libsimple_valigned_alloczn (3),
+.BR libsimple_pvalloc (3),
+.BR libsimple_pvallocz (3),
+.BR libsimple_vpvallocn (3),
+.BR libsimple_vpvalloczn (3),
+.BR libsimple_valloc (3),
+.BR libsimple_vallocz (3),
+.BR libsimple_vvallocn (3),
+.BR libsimple_vvalloczn (3),
+.BR aligned_alloc (3)
diff --git a/man/libsimple_memalign.3 b/man/libsimple_memalign.3
new file mode 100644
index 0000000..1cbb723
--- /dev/null
+++ b/man/libsimple_memalign.3
@@ -0,0 +1,177 @@
+.TH LIBSIMPLE_MEMALIGN 3 2018-11-03 libsimple
+.SH NAME
+libsimple_memalign \- allocate memory with custom alignment
+.SH SYNOPSIS
+.nf
+#include <libsimple.h>
+
+static inline void *libsimple_memalign(size_t \fIalignment\fP, size_t \fIn\fP);
+static inline void *libsimple_enmemalign(int \fIstatus\fP, size_t \fIalignment\fP, size_t \fIn\fP);
+static inline void *libsimple_ememalign(size_t \fIalignment\fP, size_t \fIn\fP);
+
+#ifndef memalign
+# define memalign libsimple_memalign
+#endif
+#ifndef enmemalign
+# define enmemalign libsimple_enmemalign
+#endif
+#ifndef ememalign
+# define ememalign libsimple_ememalign
+#endif
+.fi
+.PP
+Link with
+.IR \-lsimple .
+.SH DESCRIPTION
+The
+.BR libsimple_memalign (),
+.BR libsimple_enmemalign (),
+and
+.BR libsimple_ememalign ()
+functions allocate
+.I n
+uninitialised bytes to the heap and return a
+pointer with an alignment of
+.I alignment
+bytes to the allocated memory. The function
+.BR free (3)
+shall be called with the returned pointer as
+input when the allocated memory is no longer needed.
+.PP
+The
+.BR libsimple_enmemalign ()
+and
+.BR libsimple_ememalign ()
+functions will terminate the process if the memory
+cannot be allocated of if the user tries to allocate
+0 bytes, by calling the
+.BR libsimple_enprintf ()
+and
+.BR libsimple_eprintf ()
+functions, respectively.
+On failure, the process's exit value will be
+.I status
+if the
+.BR libsimple_enmemalign ()
+function is used or
+.IR libsimple_default_failure_exit (3)
+if the
+.BR libsimple_ememalign ()
+function is used.
+.PP
+The
+.BR libsimple_enmemalign ()
+and
+.BR libsimple_ememalign ()
+functions behaviour is unspecified if
+.I n
+is 0.
+.SH RETURN VALUE
+The
+.BR libsimple_memalign (),
+.BR libsimple_enmemalign (),
+and
+.BR libsimple_ememalign ()
+functions return a pointer to the allocated memory
+upon success completion; otherwise the
+.BR libsimple_memalign ()
+function return
+.B NULL
+and set
+.I errno
+it indicate the error, and the
+.BR libsimple_enmemalign ()
+and
+.BR libsimple_ememalign ()
+functions terminated the process.
+.SH ERRORS
+The
+.BR libsimple_memalign ()
+function will fail if:
+.TP
+.B EINVAL
+.I n
+is 0.
+.TP
+.B EINVAL
+.I alignment
+is not a power of two.
+.TP
+.B ENOMEM
+Enough memory could not be allocated.
+.PP
+The
+.BR libsimple_enmemalign ()
+and
+.BR libsimple_ememalign ()
+functions will terminate the process on failure.
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lb lb lb
+l l l.
+Interface Attribute Value
+T{
+.BR libsimple_memalign (),
+.br
+.BR libsimple_enmemalign (),
+.br
+.BR libsimple_ememalign ()
+T} Thread safety MT-Safe
+T{
+.BR libsimple_memalign (),
+.br
+.BR libsimple_enmemalign (),
+.br
+.BR libsimple_ememalign ()
+T} Async-signal safety AS-Safe
+T{
+.BR libsimple_memalign (),
+.br
+.BR libsimple_enmemalign (),
+.br
+.BR libsimple_ememalign ()
+T} Async-cancel safety AC-Safe
+.TE
+.SH EXAMPLES
+None.
+.SH APPLICATION USAGE
+None.
+.SH RATIONALE
+None.
+.SH FUTURE DIRECTIONS
+None.
+.SH NOTES
+None.
+.SH BUGS
+None.
+.SH SEE ALSO
+.BR libsimple_enmalloc (3),
+.BR libsimple_mallocz (3),
+.BR libsimple_vmallocn (3),
+.BR libsimple_vmalloczn (3),
+.BR libsimple_encalloc (3),
+.BR libsimple_vcallocn (3),
+.BR libsimple_enrealloc (3),
+.BR libsimple_vreallocn (3),
+.BR libsimple_memalignz (3),
+.BR libsimple_vmemalignn (3),
+.BR libsimple_vmemalignzn (3),
+.BR libsimple_enposix_memalign (3),
+.BR libsimple_posix_memalignz (3),
+.BR libsimple_vposix_memalignn (3),
+.BR libsimple_vposix_memalignzn (3),
+.BR libsimple_enaligned_alloc (3),
+.BR libsimple_aligned_allocz (3),
+.BR libsimple_valigned_allocn (3),
+.BR libsimple_valigned_alloczn (3),
+.BR libsimple_pvalloc (3),
+.BR libsimple_pvallocz (3),
+.BR libsimple_vpvallocn (3),
+.BR libsimple_vpvalloczn (3),
+.BR libsimple_valloc (3),
+.BR libsimple_vallocz (3),
+.BR libsimple_vvallocn (3),
+.BR libsimple_vvalloczn (3)
diff --git a/man/libsimple_memalignz.3 b/man/libsimple_memalignz.3
new file mode 100644
index 0000000..12d33e5
--- /dev/null
+++ b/man/libsimple_memalignz.3
@@ -0,0 +1,180 @@
+.TH LIBSIMPLE_MEMALIGNZ 3 2018-11-03 libsimple
+.SH NAME
+libsimple_memalignz \- allocate optionally initialised memory with custom alignment
+.SH SYNOPSIS
+.nf
+#include <libsimple.h>
+
+static inline void *libsimple_memalignz(int \fIclear\fP, size_t \fIalignment\fP, size_t \fIn\fP);
+static inline void *libsimple_enmemalignz(int \fIstatus\fP, int \fIclear\fP, size_t \fIalignment\fP, size_t \fIn\fP);
+static inline void *libsimple_ememalignz(int \fIclear\fP, size_t \fIalignment\fP, size_t \fIn\fP);
+
+#ifndef memalignz
+# define memalignz libsimple_memalignz
+#endif
+#ifndef enmemalignz
+# define enmemalignz libsimple_enmemalignz
+#endif
+#ifndef ememalignz
+# define ememalignz libsimple_ememalignz
+#endif
+.fi
+.PP
+Link with
+.IR \-lsimple .
+.SH DESCRIPTION
+The
+.BR libsimple_memalignz (),
+.BR libsimple_enmemalignz (),
+and
+.BR libsimple_ememalignz ()
+functions allocate
+.I n
+bytes to the heap and return a pointer with an
+alignment of
+.I alignment
+bytes to the allocated memory. The memory will be
+initialised with zeroes if
+.I clear
+is a non-zero value. The function
+.BR free (3)
+shall be called with the returned pointer as
+input when the allocated memory is no longer needed.
+.PP
+The
+.BR libsimple_enmemalignz ()
+and
+.BR libsimple_ememalignz ()
+functions will terminate the process if the memory
+cannot be allocated of if the user tries to allocate
+0 bytes, by calling the
+.BR libsimple_enprintf ()
+and
+.BR libsimple_eprintf ()
+functions, respectively.
+On failure, the process's exit value will be
+.I status
+if the
+.BR libsimple_enmemalignz ()
+function is used or
+.IR libsimple_default_failure_exit (3)
+if the
+.BR libsimple_ememalignz ()
+function is used.
+.PP
+The
+.BR libsimple_enmemalignz ()
+and
+.BR libsimple_ememalignz ()
+functions behaviour is unspecified if
+.I n
+is 0.
+.SH RETURN VALUE
+The
+.BR libsimple_memalignz (),
+.BR libsimple_enmemalignz (),
+and
+.BR libsimple_ememalignz ()
+functions return a pointer to the allocated memory
+upon success completion; otherwise the
+.BR libsimple_memalignz ()
+function return
+.B NULL
+and set
+.I errno
+it indicate the error, and the
+.BR libsimple_enmemalignz ()
+and
+.BR libsimple_ememalignz ()
+functions terminated the process.
+.SH ERRORS
+The
+.BR libsimple_memalignz ()
+function will fail if:
+.TP
+.B EINVAL
+.I n
+is 0.
+.TP
+.B EINVAL
+.I alignment
+is not a power of two.
+.TP
+.B ENOMEM
+Enough memory could not be allocated.
+.PP
+The
+.BR libsimple_enmemalignz ()
+and
+.BR libsimple_ememalignz ()
+functions will terminate the process on failure.
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lb lb lb
+l l l.
+Interface Attribute Value
+T{
+.BR libsimple_memalignz (),
+.br
+.BR libsimple_enmemalignz (),
+.br
+.BR libsimple_ememalignz ()
+T} Thread safety MT-Safe
+T{
+.BR libsimple_memalignz (),
+.br
+.BR libsimple_enmemalignz (),
+.br
+.BR libsimple_ememalignz ()
+T} Async-signal safety AS-Safe
+T{
+.BR libsimple_memalignz (),
+.br
+.BR libsimple_enmemalignz (),
+.br
+.BR libsimple_ememalignz ()
+T} Async-cancel safety AC-Safe
+.TE
+.SH EXAMPLES
+None.
+.SH APPLICATION USAGE
+None.
+.SH RATIONALE
+None.
+.SH FUTURE DIRECTIONS
+None.
+.SH NOTES
+None.
+.SH BUGS
+None.
+.SH SEE ALSO
+.BR libsimple_enmalloc (3),
+.BR libsimple_mallocz (3),
+.BR libsimple_vmallocn (3),
+.BR libsimple_vmalloczn (3),
+.BR libsimple_encalloc (3),
+.BR libsimple_vcallocn (3),
+.BR libsimple_enrealloc (3),
+.BR libsimple_vreallocn (3),
+.BR libsimple_memalign (3),
+.BR libsimple_vmemalignn (3),
+.BR libsimple_vmemalignzn (3),
+.BR libsimple_enposix_memalign (3),
+.BR libsimple_posix_memalignz (3),
+.BR libsimple_vposix_memalignn (3),
+.BR libsimple_vposix_memalignzn (3),
+.BR libsimple_enaligned_alloc (3),
+.BR libsimple_aligned_allocz (3),
+.BR libsimple_valigned_allocn (3),
+.BR libsimple_valigned_alloczn (3),
+.BR libsimple_pvalloc (3),
+.BR libsimple_pvallocz (3),
+.BR libsimple_vpvallocn (3),
+.BR libsimple_vpvalloczn (3),
+.BR libsimple_valloc (3),
+.BR libsimple_vallocz (3),
+.BR libsimple_vvallocn (3),
+.BR libsimple_vvalloczn (3)
diff --git a/man/libsimple_pvalloc.3 b/man/libsimple_pvalloc.3
index 8cb1c97..93e23ae 100644
--- a/man/libsimple_pvalloc.3
+++ b/man/libsimple_pvalloc.3
@@ -58,14 +58,6 @@ function is used or
if the
.BR libsimple_epvalloc ()
function is used.
-.PP
-The
-.BR libsimple_enpvalloc ()
-and
-.BR libsimple_epvalloc ()
-functions behaviour is unspecified if
-.I n
-is 0.
.SH RETURN VALUE
The
.BR libsimple_pvalloc (),
@@ -89,6 +81,10 @@ The
.BR libsimple_pvalloc ()
function will fail if:
.TP
+.B EINVAL
+.I n
+is 0.
+.TP
.B ENOMEM
Enough memory could not be allocated.
.PP
diff --git a/man/libsimple_pvallocz.3 b/man/libsimple_pvallocz.3
index b415e48..72181ef 100644
--- a/man/libsimple_pvallocz.3
+++ b/man/libsimple_pvallocz.3
@@ -91,6 +91,10 @@ The
.BR libsimple_pvallocz ()
function will fail if:
.TP
+.B EINVAL
+.I n
+is 0.
+.TP
.B ENOMEM
Enough memory could not be allocated.
.PP
diff --git a/man/libsimple_valigned_allocn.3 b/man/libsimple_valigned_allocn.3
new file mode 100644
index 0000000..e4ee1c8
--- /dev/null
+++ b/man/libsimple_valigned_allocn.3
@@ -0,0 +1,235 @@
+.TH LIBSIMPLE_VALIGNED_ALLOCN 3 2018-11-03 libsimple
+.SH NAME
+libsimple_valigned_allocn \- allocate memory with custom alignment
+.SH SYNOPSIS
+.nf
+#include <libsimple.h>
+
+static inline void *libsimple_valigned_allocn(size_t \fIalignment\fP, size_t \fIn\fP, va_list \fIap\fP);
+static inline void *libsimple_envaligned_allocn(int \fIstatus\fP, size_t \fIalignment\fP, size_t \fIn\fP, va_list \fIap\fP);
+static inline void *libsimple_evaligned_allocn(size_t \fIalignment\fP, size_t \fIn\fP, va_list \fIap\fP);
+static inline void *libsimple_aligned_allocn(size_t \fIalignment\fP, size_t \fIn\fP, ..., /* (size_t)0 */);
+static inline void *libsimple_enaligned_allocn(int \fIstatus\fP, size_t \fIalignment\fP, size_t \fIn\fP, ..., /* (size_t)0 */);
+static inline void *libsimple_ealigned_allocn(size_t \fIalignment\fP, size_t \fIn\fP, ..., /* (size_t)0 */);
+
+#ifndef valigned_allocn
+# define valigned_allocn libsimple_valigned_allocn
+#endif
+#ifndef envaligned_allocn
+# define envaligned_allocn libsimple_envaligned_allocn
+#endif
+#ifndef evaligned_allocn
+# define evaligned_allocn libsimple_evaligned_allocn
+#endif
+#ifndef aligned_allocn
+# define aligned_allocn libsimple_aligned_allocn
+#endif
+#ifndef enaligned_allocn
+# define enaligned_allocn libsimple_enaligned_allocn
+#endif
+#ifndef ealigned_allocn
+# define ealigned_allocn libsimple_ealigned_allocn
+#endif
+.fi
+.PP
+Link with
+.IR \-lsimple .
+.SH DESCRIPTION
+The
+.BR libsimple_aligned_allocn (),
+.BR libsimple_enaligned_allocn (),
+and
+.BR libsimple_ealigned_allocn ()
+functions allocate
+.I N
+uninitialised bytes to the heap and return a
+pointer with an alignment of
+.I alignment
+bytes to the allocated memory, where
+.I N
+is the product of
+.I n
+and all following arguments (which should have the type
+.BR size_t )
+up to the first 0;
+.I n
+must not be 0. The function
+.BR free (3)
+shall be called with the returned pointer as
+input when the allocated memory is no longer needed.
+.PP
+The
+.BR libsimple_enaligned_allocn ()
+and
+.BR libsimple_ealigned_allocn ()
+functions will terminate the process if the memory
+cannot be allocated, by calling the
+.BR libsimple_enprintf ()
+and
+.BR libsimple_eprintf ()
+functions, respectively.
+On failure, the process's exit value will be
+.I status
+if the
+.BR libsimple_enaligned_allocn ()
+function is used or
+.IR libsimple_default_failure_exit (3)
+if the
+.BR libsimple_ealigned_allocn ()
+function is used.
+.PP
+The
+.BR libsimple_valigned_allocn (),
+.BR libsimple_envaligned_allocn (),
+and
+.BR libsimple_evaligned_allocn ()
+functions are versions of the
+.BR libsimple_aligned_allocn (),
+.BR libsimple_enaligned_allocn (),
+and
+.BR libsimple_ealigned_allocn (),
+respectively, that use
+.B va_list
+instead of variadic arguments.
+.SH RETURN VALUE
+The
+.BR libsimple_valigned_allocn (),
+.BR libsimple_envaligned_allocn (),
+.BR libsimple_evaligned_allocn (),
+.BR libsimple_aligned_allocn (),
+.BR libsimple_enaligned_allocn (),
+and
+.BR libsimple_ealigned_allocn ()
+functions return a pointer to the allocated memory
+upon success completion; otherwise the
+.BR libsimple_valigned_allocn ()
+and
+.BR libsimple_aligned_allocn ()
+functions return
+.B NULL
+and set
+.I errno
+it indicate the error, and the
+.BR libsimple_envaligned_allocn (),
+.BR libsimple_evaligned_allocn (),
+.BR libsimple_enaligned_allocn (),
+and
+.BR libsimple_ealigned_allocn ()
+functions terminated the process.
+.SH ERRORS
+The
+.BR libsimple_valigned_allocn (),
+.BR libsimple_aligned_allocn ()
+function will fail if:
+.TP
+.B EINVAL
+.I n
+is 0.
+.TP
+.B EINVAL
+.I n
+is not a multiple of
+.IR alignment .
+.TP
+.B EINVAL
+.I alignment
+is not a power of two.
+.B ENOMEM
+Enough memory could not be allocated.
+.PP
+The
+.BR libsimple_envaligned_allocn (),
+.BR libsimple_evaligned_allocn (),
+.BR libsimple_enaligned_allocn (),
+and
+.BR libsimple_ealigned_allocn ()
+functions will terminate the process on failure.
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lb lb lb
+l l l.
+Interface Attribute Value
+T{
+.BR libsimple_valigned_allocn (),
+.br
+.BR libsimple_envaligned_allocn (),
+.br
+.BR libsimple_evaligned_allocn (),
+.br
+.BR libsimple_aligned_allocn (),
+.br
+.BR libsimple_enaligned_allocn (),
+.br
+.BR libsimple_ealigned_allocn ()
+T} Thread safety MT-Safe
+T{
+.BR libsimple_valigned_allocn (),
+.br
+.BR libsimple_envaligned_allocn (),
+.br
+.BR libsimple_evaligned_allocn (),
+.br
+.BR libsimple_aligned_allocn (),
+.br
+.BR libsimple_enaligned_allocn (),
+.br
+.BR libsimple_ealigned_allocn ()
+T} Async-signal safety AS-Safe
+T{
+.BR libsimple_valigned_allocn (),
+.br
+.BR libsimple_envaligned_allocn (),
+.br
+.BR libsimple_evaligned_allocn (),
+.br
+.BR libsimple_aligned_allocn (),
+.br
+.BR libsimple_enaligned_allocn (),
+.br
+.BR libsimple_ealigned_allocn ()
+T} Async-cancel safety AC-Safe
+.TE
+.SH EXAMPLES
+None.
+.SH APPLICATION USAGE
+None.
+.SH RATIONALE
+None.
+.SH FUTURE DIRECTIONS
+None.
+.SH NOTES
+None.
+.SH BUGS
+None.
+.SH SEE ALSO
+.BR libsimple_enmalloc (3),
+.BR libsimple_mallocz (3),
+.BR libsimple_vmallocn (3),
+.BR libsimple_vmalloczn (3),
+.BR libsimple_encalloc (3),
+.BR libsimple_vcallocn (3),
+.BR libsimple_enrealloc (3),
+.BR libsimple_vreallocn (3),
+.BR libsimple_memalign (3),
+.BR libsimple_memalignz (3),
+.BR libsimple_vmemalignn (3),
+.BR libsimple_vmemalignzn (3),
+.BR libsimple_enposix_memalign (3),
+.BR libsimple_posix_memalignz (3),
+.BR libsimple_vposix_memalignn (3),
+.BR libsimple_vposix_memalignzn (3),
+.BR libsimple_enaligned_alloc (3),
+.BR libsimple_aligned_allocz (3),
+.BR libsimple_valigned_alloczn (3),
+.BR libsimple_pvalloc (3),
+.BR libsimple_pvallocz (3),
+.BR libsimple_vpvallocn (3),
+.BR libsimple_vpvalloczn (3),
+.BR libsimple_valloc (3),
+.BR libsimple_vallocz (3),
+.BR libsimple_vvallocn (3),
+.BR libsimple_vvalloczn (3),
+.BR aligned_alloc (3)
diff --git a/man/libsimple_valigned_alloczn.3 b/man/libsimple_valigned_alloczn.3
new file mode 100644
index 0000000..715817d
--- /dev/null
+++ b/man/libsimple_valigned_alloczn.3
@@ -0,0 +1,239 @@
+.TH LIBSIMPLE_VALIGNED_ALLOCZN 3 2018-11-03 libsimple
+.SH NAME
+libsimple_valigned_alloczn \- allocate optionally initialised memory with custom alignment
+.SH SYNOPSIS
+.nf
+#include <libsimple.h>
+
+void *libsimple_valigned_alloczn(int \fIclear\fP, size_t \fIalignment\fP, size_t \fIn\fP, va_list \fIap\fP);
+void *libsimple_envaligned_alloczn(int \fIstatus\fP, int \fIclear\fP, size_t \fIalignment\fP, size_t \fIn\fP, va_list \fIap\fP);
+static inline void *libsimple_evaligned_alloczn(int \fIclear\fP, size_t \fIalignment\fP, size_t \fIn\fP, va_list \fIap\fP);
+static inline void *libsimple_aligned_alloczn(int \fIclear\fP, size_t \fIalignment\fP, size_t \fIn\fP, ..., /* (size_t)0 */);
+static inline void *libsimple_enaligned_alloczn(int \fIstatus\fP, int \fIclear\fP, size_t \fIalignment\fP, size_t \fIn\fP, ..., /* (size_t)0 */);
+static inline void *libsimple_ealigned_alloczn(int \fIclear\fP, size_t \fIalignment\fP, size_t \fIn\fP, ..., /* (size_t)0 */);
+
+#ifndef valigned_alloczn
+# define valigned_alloczn libsimple_valigned_alloczn
+#endif
+#ifndef envaligned_alloczn
+# define envaligned_alloczn libsimple_envaligned_alloczn
+#endif
+#ifndef evaligned_alloczn
+# define evaligned_alloczn libsimple_evaligned_alloczn
+#endif
+#ifndef aligned_alloczn
+# define aligned_alloczn libsimple_aligned_alloczn
+#endif
+#ifndef enaligned_alloczn
+# define enaligned_alloczn libsimple_enaligned_alloczn
+#endif
+#ifndef ealigned_alloczn
+# define ealigned_alloczn libsimple_ealigned_alloczn
+#endif
+.fi
+.PP
+Link with
+.IR \-lsimple .
+.SH DESCRIPTION
+The
+.BR libsimple_aligned_alloczn (),
+.BR libsimple_enaligned_alloczn (),
+and
+.BR libsimple_ealigned_alloczn ()
+functions allocate
+.I N
+bytes to the heap and return a pointer with an
+alignment of
+.I alignment
+bytes to the allocated memory, where
+.I N
+is the product of
+.I n
+and all following arguments (which should have the type
+.BR size_t )
+up to the first 0;
+.I n
+must not be 0. The memory will be initialised
+with zeroes if
+.I clear
+is a non-zero value. The function
+.BR free (3)
+shall be called with the returned pointer as
+input when the allocated memory is no longer needed.
+.PP
+The
+.BR libsimple_enaligned_alloczn ()
+and
+.BR libsimple_ealigned_alloczn ()
+functions will terminate the process if the memory
+cannot be allocated, by calling the
+.BR libsimple_enprintf ()
+and
+.BR libsimple_eprintf ()
+functions, respectively.
+On failure, the process's exit value will be
+.I status
+if the
+.BR libsimple_enaligned_alloczn ()
+function is used or
+.IR libsimple_default_failure_exit (3)
+if the
+.BR libsimple_ealigned_alloczn ()
+function is used.
+.PP
+The
+.BR libsimple_valigned_alloczn (),
+.BR libsimple_envaligned_alloczn (),
+and
+.BR libsimple_evaligned_alloczn ()
+functions are versions of the
+.BR libsimple_aligned_alloczn (),
+.BR libsimple_enaligned_alloczn (),
+and
+.BR libsimple_ealigned_alloczn (),
+respectively, that use
+.B va_list
+instead of variadic arguments.
+.SH RETURN VALUE
+The
+.BR libsimple_valigned_alloczn (),
+.BR libsimple_envaligned_alloczn (),
+.BR libsimple_evaligned_alloczn (),
+.BR libsimple_aligned_alloczn (),
+.BR libsimple_enaligned_alloczn (),
+and
+.BR libsimple_ealigned_alloczn ()
+functions return a pointer to the allocated memory
+upon success completion; otherwise the
+.BR libsimple_valigned_alloczn ()
+and
+.BR libsimple_aligned_alloczn ()
+functions return
+.B NULL
+and set
+.I errno
+it indicate the error, and the
+.BR libsimple_envaligned_alloczn (),
+.BR libsimple_evaligned_alloczn (),
+.BR libsimple_enaligned_alloczn (),
+and
+.BR libsimple_ealigned_alloczn ()
+functions terminated the process.
+.SH ERRORS
+The
+.BR libsimple_valigned_alloczn (),
+.BR libsimple_aligned_alloczn ()
+function will fail if:
+.TP
+.B EINVAL
+.I n
+is 0.
+.TP
+.B EINVAL
+.I n
+is not a multiple of
+.IR alignment .
+.TP
+.B EINVAL
+.I alignment
+is not a power of two.
+.TP
+.B ENOMEM
+Enough memory could not be allocated.
+.PP
+The
+.BR libsimple_envaligned_alloczn (),
+.BR libsimple_evaligned_alloczn (),
+.BR libsimple_enaligned_alloczn (),
+and
+.BR libsimple_ealigned_alloczn ()
+functions will terminate the process on failure.
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lb lb lb
+l l l.
+Interface Attribute Value
+T{
+.BR libsimple_valigned_alloczn (),
+.br
+.BR libsimple_envaligned_alloczn (),
+.br
+.BR libsimple_evaligned_alloczn (),
+.br
+.BR libsimple_aligned_alloczn (),
+.br
+.BR libsimple_enaligned_alloczn (),
+.br
+.BR libsimple_ealigned_alloczn ()
+T} Thread safety MT-Safe
+T{
+.BR libsimple_valigned_alloczn (),
+.br
+.BR libsimple_envaligned_alloczn (),
+.br
+.BR libsimple_evaligned_alloczn (),
+.br
+.BR libsimple_aligned_alloczn (),
+.br
+.BR libsimple_enaligned_alloczn (),
+.br
+.BR libsimple_ealigned_alloczn ()
+T} Async-signal safety AS-Safe
+T{
+.BR libsimple_valigned_alloczn (),
+.br
+.BR libsimple_envaligned_alloczn (),
+.br
+.BR libsimple_evaligned_alloczn (),
+.br
+.BR libsimple_aligned_alloczn (),
+.br
+.BR libsimple_enaligned_alloczn (),
+.br
+.BR libsimple_ealigned_alloczn ()
+T} Async-cancel safety AC-Safe
+.TE
+.SH EXAMPLES
+None.
+.SH APPLICATION USAGE
+None.
+.SH RATIONALE
+None.
+.SH FUTURE DIRECTIONS
+None.
+.SH NOTES
+None.
+.SH BUGS
+None.
+.SH SEE ALSO
+.BR libsimple_enmalloc (3),
+.BR libsimple_mallocz (3),
+.BR libsimple_vmallocn (3),
+.BR libsimple_vmalloczn (3),
+.BR libsimple_encalloc (3),
+.BR libsimple_vcallocn (3),
+.BR libsimple_enrealloc (3),
+.BR libsimple_vreallocn (3),
+.BR libsimple_memalign (3),
+.BR libsimple_memalignz (3),
+.BR libsimple_vmemalignn (3),
+.BR libsimple_vmemalignzn (3),
+.BR libsimple_enposix_memalign (3),
+.BR libsimple_posix_memalignz (3),
+.BR libsimple_vposix_memalignn (3),
+.BR libsimple_vposix_memalignzn (3),
+.BR libsimple_enaligned_alloc (3),
+.BR libsimple_aligned_allocz (3),
+.BR libsimple_valigned_allocn (3),
+.BR libsimple_pvalloc (3),
+.BR libsimple_pvallocz (3),
+.BR libsimple_vpvallocn (3),
+.BR libsimple_vpvalloczn (3),
+.BR libsimple_valloc (3),
+.BR libsimple_vallocz (3),
+.BR libsimple_vvallocn (3),
+.BR libsimple_vvalloczn (3),
+.BR aligned_alloc (3)
diff --git a/man/libsimple_valloc.3 b/man/libsimple_valloc.3
index c9c4f62..665e7d8 100644
--- a/man/libsimple_valloc.3
+++ b/man/libsimple_valloc.3
@@ -57,14 +57,6 @@ function is used or
if the
.BR libsimple_evalloc ()
function is used.
-.PP
-The
-.BR libsimple_envalloc ()
-and
-.BR libsimple_evalloc ()
-functions behaviour is unspecified if
-.I n
-is 0.
.SH RETURN VALUE
The
.BR libsimple_valloc (),
@@ -88,6 +80,9 @@ The
.BR libsimple_valloc ()
function will fail if:
.TP
+.B n
+is 0
+.TP
.B ENOMEM
Enough memory could not be allocated.
.PP
diff --git a/man/libsimple_vallocz.3 b/man/libsimple_vallocz.3
index d766a0a..79e212d 100644
--- a/man/libsimple_vallocz.3
+++ b/man/libsimple_vallocz.3
@@ -91,6 +91,10 @@ The
.BR libsimple_vallocz ()
function will fail if:
.TP
+.B EINVAL
+.I n
+is 0.
+.TP
.B ENOMEM
Enough memory could not be allocated.
.PP
diff --git a/man/libsimple_vmalloczn.3 b/man/libsimple_vmalloczn.3
index f7fdf09..c25e772 100644
--- a/man/libsimple_vmalloczn.3
+++ b/man/libsimple_vmalloczn.3
@@ -66,9 +66,9 @@ shall be called with the returned pointer as
input when the allocated memory is no longer needed.
.PP
The
-.BR libsimple_enmallocz ()
+.BR libsimple_enmalloczn ()
and
-.BR libsimple_emallocz ()
+.BR libsimple_emalloczn ()
functions will terminate the process if the memory
cannot be allocated, by calling the
.BR libsimple_enprintf ()
@@ -78,11 +78,11 @@ functions, respectively.
On failure, the process's exit value will be
.I status
if the
-.BR libsimple_enmallocz ()
+.BR libsimple_enmalloczn ()
function is used or
.IR libsimple_default_failure_exit (3)
if the
-.BR libsimple_emallocz ()
+.BR libsimple_emalloczn ()
function is used.
.PP
The
@@ -138,11 +138,11 @@ functions, and if:
is 0.
.PP
The
-.BR libsimple_envmallocz (),
-.BR libsimple_evmallocz (),
-.BR libsimple_enmallocz (),
+.BR libsimple_envmalloczn (),
+.BR libsimple_evmalloczn (),
+.BR libsimple_enmalloczn (),
and
-.BR libsimple_emallocz ()
+.BR libsimple_emalloczn ()
functions will terminate the process on failure.
.SH ATTRIBUTES
For an explanation of the terms used in this section, see
diff --git a/man/libsimple_vmemalignn.3 b/man/libsimple_vmemalignn.3
new file mode 100644
index 0000000..f298029
--- /dev/null
+++ b/man/libsimple_vmemalignn.3
@@ -0,0 +1,229 @@
+.TH LIBSIMPLE_VMEMALIGNN 3 2018-11-03 libsimple
+.SH NAME
+libsimple_vmemalignn \- allocate memory with custom alignment
+.SH SYNOPSIS
+.nf
+#include <libsimple.h>
+
+static inline void *libsimple_vmemalignn(size_t \fIalignment\fP, size_t \fIn\fP, va_list \fIap\fP);
+static inline void *libsimple_envmemalignn(int \fIstatus\fP, size_t \fIalignment\fP, size_t \fIn\fP, va_list \fIap\fP);
+static inline void *libsimple_evmemalignn(size_t \fIalignment\fP, size_t \fIn\fP, va_list \fIap\fP);
+static inline void *libsimple_memalignn(size_t \fIalignment\fP, size_t \fIn\fP, ..., /* (size_t)0 */);
+static inline void *libsimple_enmemalignn(int \fIstatus\fP, size_t \fIalignment\fP, size_t \fIn\fP, ..., /* (size_t)0 */);
+static inline void *libsimple_ememalignn(size_t \fIalignment\fP, size_t \fIn\fP, ..., /* (size_t)0 */);
+
+#ifndef vmemalignn
+# define vmemalignn libsimple_vmemalignn
+#endif
+#ifndef envmemalignn
+# define envmemalignn libsimple_envmemalignn
+#endif
+#ifndef evmemalignn
+# define evmemalignn libsimple_evmemalignn
+#endif
+#ifndef memalignn
+# define memalignn libsimple_memalignn
+#endif
+#ifndef enmemalignn
+# define enmemalignn libsimple_enmemalignn
+#endif
+#ifndef ememalignn
+# define ememalignn libsimple_ememalignn
+#endif
+.fi
+.PP
+Link with
+.IR \-lsimple .
+.SH DESCRIPTION
+The
+.BR libsimple_memalignn (),
+.BR libsimple_enmemalignn (),
+and
+.BR libsimple_ememalignn ()
+functions allocate
+.I N
+uninitialised bytes to the heap and return a
+pointer with an alignment of
+.I alignment
+bytes to the allocated memory, where
+.I N
+is the product of
+.I n
+and all following arguments (which should have the type
+.BR size_t )
+up to the first 0;
+.I n
+must not be 0. The function
+.BR free (3)
+shall be called with the returned pointer as
+input when the allocated memory is no longer needed.
+.PP
+The
+.BR libsimple_enmemalignn ()
+and
+.BR libsimple_ememalignn ()
+functions will terminate the process if the memory
+cannot be allocated, by calling the
+.BR libsimple_enprintf ()
+and
+.BR libsimple_eprintf ()
+functions, respectively.
+On failure, the process's exit value will be
+.I status
+if the
+.BR libsimple_enmemalignn ()
+function is used or
+.IR libsimple_default_failure_exit (3)
+if the
+.BR libsimple_ememalignn ()
+function is used.
+.PP
+The
+.BR libsimple_vmemalignn (),
+.BR libsimple_envmemalignn (),
+and
+.BR libsimple_evmemalignn ()
+functions are versions of the
+.BR libsimple_memalignn (),
+.BR libsimple_enmemalignn (),
+and
+.BR libsimple_ememalignn (),
+respectively, that use
+.B va_list
+instead of variadic arguments.
+.SH RETURN VALUE
+The
+.BR libsimple_vmemalignn (),
+.BR libsimple_envmemalignn (),
+.BR libsimple_evmemalignn (),
+.BR libsimple_memalignn (),
+.BR libsimple_enmemalignn (),
+and
+.BR libsimple_ememalignn ()
+functions return a pointer to the allocated memory
+upon success completion; otherwise the
+.BR libsimple_vmemalignn ()
+and
+.BR libsimple_memalignn ()
+functions return
+.B NULL
+and set
+.I errno
+it indicate the error, and the
+.BR libsimple_envmemalignn (),
+.BR libsimple_evmemalignn (),
+.BR libsimple_enmemalignn (),
+and
+.BR libsimple_ememalignn ()
+functions terminated the process.
+.SH ERRORS
+The
+.BR libsimple_vmemalignn (),
+.BR libsimple_memalignn ()
+function will fail if:
+.TP
+.B EINVAL
+.I n
+is 0.
+.TP
+.B EINVAL
+.I alignment
+is not a power of two.
+.B ENOMEM
+Enough memory could not be allocated.
+.PP
+The
+.BR libsimple_envmemalignn (),
+.BR libsimple_evmemalignn (),
+.BR libsimple_enmemalignn (),
+and
+.BR libsimple_ememalignn ()
+functions will terminate the process on failure.
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lb lb lb
+l l l.
+Interface Attribute Value
+T{
+.BR libsimple_vmemalignn (),
+.br
+.BR libsimple_envmemalignn (),
+.br
+.BR libsimple_evmemalignn (),
+.br
+.BR libsimple_memalignn (),
+.br
+.BR libsimple_enmemalignn (),
+.br
+.BR libsimple_ememalignn ()
+T} Thread safety MT-Safe
+T{
+.BR libsimple_vmemalignn (),
+.br
+.BR libsimple_envmemalignn (),
+.br
+.BR libsimple_evmemalignn (),
+.br
+.BR libsimple_memalignn (),
+.br
+.BR libsimple_enmemalignn (),
+.br
+.BR libsimple_ememalignn ()
+T} Async-signal safety AS-Safe
+T{
+.BR libsimple_vmemalignn (),
+.br
+.BR libsimple_envmemalignn (),
+.br
+.BR libsimple_evmemalignn (),
+.br
+.BR libsimple_memalignn (),
+.br
+.BR libsimple_enmemalignn (),
+.br
+.BR libsimple_ememalignn ()
+T} Async-cancel safety AC-Safe
+.TE
+.SH EXAMPLES
+None.
+.SH APPLICATION USAGE
+None.
+.SH RATIONALE
+None.
+.SH FUTURE DIRECTIONS
+None.
+.SH NOTES
+None.
+.SH BUGS
+None.
+.SH SEE ALSO
+.BR libsimple_enmalloc (3),
+.BR libsimple_mallocz (3),
+.BR libsimple_vmallocn (3),
+.BR libsimple_vmalloczn (3),
+.BR libsimple_encalloc (3),
+.BR libsimple_vcallocn (3),
+.BR libsimple_enrealloc (3),
+.BR libsimple_vreallocn (3),
+.BR libsimple_memalign (3),
+.BR libsimple_memalignz (3),
+.BR libsimple_vmemalignzn (3),
+.BR libsimple_enposix_memalign (3),
+.BR libsimple_posix_memalignz (3),
+.BR libsimple_vposix_memalignn (3),
+.BR libsimple_vposix_memalignzn (3),
+.BR libsimple_enaligned_alloc (3),
+.BR libsimple_aligned_allocz (3),
+.BR libsimple_valigned_allocn (3),
+.BR libsimple_valigned_alloczn (3),
+.BR libsimple_pvalloc (3),
+.BR libsimple_pvallocz (3),
+.BR libsimple_vpvallocn (3),
+.BR libsimple_vpvalloczn (3),
+.BR libsimple_valloc (3),
+.BR libsimple_vallocz (3),
+.BR libsimple_vvallocn (3),
+.BR libsimple_vvalloczn (3)
diff --git a/man/libsimple_vmemalignzn.3 b/man/libsimple_vmemalignzn.3
new file mode 100644
index 0000000..b09ae4c
--- /dev/null
+++ b/man/libsimple_vmemalignzn.3
@@ -0,0 +1,233 @@
+.TH LIBSIMPLE_VMEMALIGNZN 3 2018-11-03 libsimple
+.SH NAME
+libsimple_vmemalignzn \- allocate optionally initialised memory with custom alignment
+.SH SYNOPSIS
+.nf
+#include <libsimple.h>
+
+static inline void *libsimple_vmemalignzn(int \fIclear\fP, size_t \fIalignment\fP, size_t \fIn\fP, va_list \fIap\fP);
+static inline void *libsimple_envmemalignzn(int \fIstatus\fP, int \fIclear\fP, size_t \fIalignment\fP, size_t \fIn\fP, va_list \fIap\fP);
+static inline void *libsimple_evmemalignzn(int \fIclear\fP, size_t \fIalignment\fP, size_t \fIn\fP, va_list \fIap\fP);
+static inline void *libsimple_memalignzn(int \fIclear\fP, size_t \fIalignment\fP, size_t \fIn\fP, ..., /* (size_t)0 */);
+static inline void *libsimple_enmemalignzn(int \fIstatus\fP, int \fIclear\fP, size_t \fIalignment\fP, size_t \fIn\fP, ..., /* (size_t)0 */);
+static inline void *libsimple_ememalignzn(int \fIclear\fP, size_t \fIalignment\fP, size_t \fIn\fP, ..., /* (size_t)0 */);
+
+#ifndef vmemalignzn
+# define vmemalignzn libsimple_vmemalignzn
+#endif
+#ifndef envmemalignzn
+# define envmemalignzn libsimple_envmemalignzn
+#endif
+#ifndef evmemalignzn
+# define evmemalignzn libsimple_evmemalignzn
+#endif
+#ifndef memalignzn
+# define memalignzn libsimple_memalignzn
+#endif
+#ifndef enmemalignzn
+# define enmemalignzn libsimple_enmemalignzn
+#endif
+#ifndef ememalignzn
+# define ememalignzn libsimple_ememalignzn
+#endif
+.fi
+.PP
+Link with
+.IR \-lsimple .
+.SH DESCRIPTION
+The
+.BR libsimple_memalignzn (),
+.BR libsimple_enmemalignzn (),
+and
+.BR libsimple_ememalignzn ()
+functions allocate
+.I N
+bytes to the heap and return a pointer with an
+alignment of
+.I alignment
+bytes to the allocated memory, where
+.I N
+is the product of
+.I n
+and all following arguments (which should have the type
+.BR size_t )
+up to the first 0;
+.I n
+must not be 0. The memory will be initialised
+with zeroes if
+.I clear
+is a non-zero value. The function
+.BR free (3)
+shall be called with the returned pointer as
+input when the allocated memory is no longer needed.
+.PP
+The
+.BR libsimple_enmemalignzn ()
+and
+.BR libsimple_ememalignzn ()
+functions will terminate the process if the memory
+cannot be allocated, by calling the
+.BR libsimple_enprintf ()
+and
+.BR libsimple_eprintf ()
+functions, respectively.
+On failure, the process's exit value will be
+.I status
+if the
+.BR libsimple_enmemalignzn ()
+function is used or
+.IR libsimple_default_failure_exit (3)
+if the
+.BR libsimple_ememalignzn ()
+function is used.
+.PP
+The
+.BR libsimple_vmemalignzn (),
+.BR libsimple_envmemalignzn (),
+and
+.BR libsimple_evmemalignzn ()
+functions are versions of the
+.BR libsimple_memalignzn (),
+.BR libsimple_enmemalignzn (),
+and
+.BR libsimple_ememalignzn (),
+respectively, that use
+.B va_list
+instead of variadic arguments.
+.SH RETURN VALUE
+The
+.BR libsimple_vmemalignzn (),
+.BR libsimple_envmemalignzn (),
+.BR libsimple_evmemalignzn (),
+.BR libsimple_memalignzn (),
+.BR libsimple_enmemalignzn (),
+and
+.BR libsimple_ememalignzn ()
+functions return a pointer to the allocated memory
+upon success completion; otherwise the
+.BR libsimple_vmemalignzn ()
+and
+.BR libsimple_memalignzn ()
+functions return
+.B NULL
+and set
+.I errno
+it indicate the error, and the
+.BR libsimple_envmemalignzn (),
+.BR libsimple_evmemalignzn (),
+.BR libsimple_enmemalignzn (),
+and
+.BR libsimple_ememalignzn ()
+functions terminated the process.
+.SH ERRORS
+The
+.BR libsimple_vmemalignzn (),
+.BR libsimple_memalignzn ()
+function will fail if:
+.TP
+.B EINVAL
+.I n
+is 0.
+.TP
+.B EINVAL
+.I alignment
+is not a power of two.
+.TP
+.B ENOMEM
+Enough memory could not be allocated.
+.PP
+The
+.BR libsimple_envmemalignzn (),
+.BR libsimple_evmemalignzn (),
+.BR libsimple_enmemalignzn (),
+and
+.BR libsimple_ememalignzn ()
+functions will terminate the process on failure.
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lb lb lb
+l l l.
+Interface Attribute Value
+T{
+.BR libsimple_vmemalignzn (),
+.br
+.BR libsimple_envmemalignzn (),
+.br
+.BR libsimple_evmemalignzn (),
+.br
+.BR libsimple_memalignzn (),
+.br
+.BR libsimple_enmemalignzn (),
+.br
+.BR libsimple_ememalignzn ()
+T} Thread safety MT-Safe
+T{
+.BR libsimple_vmemalignzn (),
+.br
+.BR libsimple_envmemalignzn (),
+.br
+.BR libsimple_evmemalignzn (),
+.br
+.BR libsimple_memalignzn (),
+.br
+.BR libsimple_enmemalignzn (),
+.br
+.BR libsimple_ememalignzn ()
+T} Async-signal safety AS-Safe
+T{
+.BR libsimple_vmemalignzn (),
+.br
+.BR libsimple_envmemalignzn (),
+.br
+.BR libsimple_evmemalignzn (),
+.br
+.BR libsimple_memalignzn (),
+.br
+.BR libsimple_enmemalignzn (),
+.br
+.BR libsimple_ememalignzn ()
+T} Async-cancel safety AC-Safe
+.TE
+.SH EXAMPLES
+None.
+.SH APPLICATION USAGE
+None.
+.SH RATIONALE
+None.
+.SH FUTURE DIRECTIONS
+None.
+.SH NOTES
+None.
+.SH BUGS
+None.
+.SH SEE ALSO
+.BR libsimple_enmalloc (3),
+.BR libsimple_mallocz (3),
+.BR libsimple_vmallocn (3),
+.BR libsimple_vmalloczn (3),
+.BR libsimple_encalloc (3),
+.BR libsimple_vcallocn (3),
+.BR libsimple_enrealloc (3),
+.BR libsimple_vreallocn (3),
+.BR libsimple_memalign (3),
+.BR libsimple_memalignz (3),
+.BR libsimple_vmemalignn (3),
+.BR libsimple_enposix_memalign (3),
+.BR libsimple_posix_memalignz (3),
+.BR libsimple_vposix_memalignn (3),
+.BR libsimple_vposix_memalignzn (3),
+.BR libsimple_enaligned_alloc (3),
+.BR libsimple_aligned_allocz (3),
+.BR libsimple_valigned_allocn (3),
+.BR libsimple_valigned_alloczn (3),
+.BR libsimple_pvalloc (3),
+.BR libsimple_pvallocz (3),
+.BR libsimple_vpvallocn (3),
+.BR libsimple_vpvalloczn (3),
+.BR libsimple_valloc (3),
+.BR libsimple_vallocz (3),
+.BR libsimple_vvallocn (3),
+.BR libsimple_vvalloczn (3)
diff --git a/man/libsimple_vpvalloczn.3 b/man/libsimple_vpvalloczn.3
index 39bbaf4..cb2ed5a 100644
--- a/man/libsimple_vpvalloczn.3
+++ b/man/libsimple_vpvalloczn.3
@@ -61,9 +61,9 @@ shall be called with the returned pointer as
input when the allocated memory is no longer needed.
.PP
The
-.BR libsimple_enpvallocz ()
+.BR libsimple_enpvalloczn ()
and
-.BR libsimple_epvallocz ()
+.BR libsimple_epvalloczn ()
functions will terminate the process if the memory
cannot be allocated, by calling the
.BR libsimple_enprintf ()
@@ -73,11 +73,11 @@ functions, respectively.
On failure, the process's exit value will be
.I status
if the
-.BR libsimple_enpvallocz ()
+.BR libsimple_enpvalloczn ()
function is used or
.IR libsimple_default_failure_exit (3)
if the
-.BR libsimple_epvallocz ()
+.BR libsimple_epvalloczn ()
function is used.
.PP
The
@@ -132,11 +132,11 @@ is 0.
Enough memory could not be allocated.
.PP
The
-.BR libsimple_envpvallocz (),
-.BR libsimple_evpvallocz (),
-.BR libsimple_enpvallocz (),
+.BR libsimple_envpvalloczn (),
+.BR libsimple_evpvalloczn (),
+.BR libsimple_enpvalloczn (),
and
-.BR libsimple_epvallocz ()
+.BR libsimple_epvalloczn ()
functions will terminate the process on failure.
.SH ATTRIBUTES
For an explanation of the terms used in this section, see
diff --git a/man/libsimple_vvalloczn.3 b/man/libsimple_vvalloczn.3
index 606dbae..44a9b84 100644
--- a/man/libsimple_vvalloczn.3
+++ b/man/libsimple_vvalloczn.3
@@ -61,9 +61,9 @@ shall be called with the returned pointer as
input when the allocated memory is no longer needed.
.PP
The
-.BR libsimple_envallocz ()
+.BR libsimple_envalloczn ()
and
-.BR libsimple_evallocz ()
+.BR libsimple_evalloczn ()
functions will terminate the process if the memory
cannot be allocated, by calling the
.BR libsimple_enprintf ()
@@ -73,11 +73,11 @@ functions, respectively.
On failure, the process's exit value will be
.I status
if the
-.BR libsimple_envallocz ()
+.BR libsimple_envalloczn ()
function is used or
.IR libsimple_default_failure_exit (3)
if the
-.BR libsimple_evallocz ()
+.BR libsimple_evalloczn ()
function is used.
.PP
The
@@ -132,11 +132,11 @@ is 0.
Enough memory could not be allocated.
.PP
The
-.BR libsimple_envvallocz (),
-.BR libsimple_evvallocz (),
-.BR libsimple_envallocz (),
+.BR libsimple_envvalloczn (),
+.BR libsimple_evvalloczn (),
+.BR libsimple_envalloczn (),
and
-.BR libsimple_evallocz ()
+.BR libsimple_evalloczn ()
functions will terminate the process on failure.
.SH ATTRIBUTES
For an explanation of the terms used in this section, see