summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
authorpjanzen <pjanzen@openbsd.org>2000-01-19 05:36:38 +0000
committerpjanzen <pjanzen@openbsd.org>2000-01-19 05:36:38 +0000
commit2b6a477fcc9c8fc3e86d60b049a9af61768fe722 (patch)
tree32b65df89b9a34b77fc4f0a58a63bd9ed7fc5483 /lib/libc/stdlib
parentMax value returned is 2^31 - 1, regardless of the arch-dependent LONG_MAX. (diff)
downloadwireguard-openbsd-2b6a477fcc9c8fc3e86d60b049a9af61768fe722.tar.xz
wireguard-openbsd-2b6a477fcc9c8fc3e86d60b049a9af61768fe722.zip
Clarify and mention that errno is set to ENOMEM on failure of malloc(),
calloc(), and realloc(). Idea from NetBSD.
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r--lib/libc/stdlib/malloc.316
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/libc/stdlib/malloc.3 b/lib/libc/stdlib/malloc.3
index ea8f41e6c5a..804f0b90940 100644
--- a/lib/libc/stdlib/malloc.3
+++ b/lib/libc/stdlib/malloc.3
@@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: malloc.3,v 1.17 1999/11/10 22:19:22 aaron Exp $
+.\" $OpenBSD: malloc.3,v 1.18 2000/01/19 05:36:38 pjanzen Exp $
.\"
.Dd August 27, 1996
.Dt MALLOC 3
@@ -241,8 +241,11 @@ The
and
.Fn calloc
functions return
-a pointer to the allocated space if successful; otherwise
-a null pointer is returned.
+a pointer to the allocated space if successful; otherwise,
+a null pointer is returned and
+.Va errno
+is set to
+.Er ENOMEM .
.Pp
The
.Fn free
@@ -252,8 +255,11 @@ functions return no value.
.Pp
The
.Fn realloc
-function a pointer to the possibly moved allocated space;
-otherwise a null pointer is returned.
+function returns a pointer to the (possibly moved) allocated space
+if successful; otherwise, a null pointer is returned and
+.Va errno
+is set to
+.Er ENOMEM .
.Sh MESSAGES
If
.Fn malloc ,