summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpjanzen <>2000-01-19 05:36:38 +0000
committerpjanzen <>2000-01-19 05:36:38 +0000
commit1416135cbe2fc16cb4fb905c8141d66bec9d3191 (patch)
tree50769e20442746363ace631d000ab767e72b885b /src
parent481a8567856cde7f96f77cb5851d482b77163fa9 (diff)
downloadopenbsd-1416135cbe2fc16cb4fb905c8141d66bec9d3191.tar.gz
openbsd-1416135cbe2fc16cb4fb905c8141d66bec9d3191.tar.bz2
openbsd-1416135cbe2fc16cb4fb905c8141d66bec9d3191.zip
Clarify and mention that errno is set to ENOMEM on failure of malloc(),
calloc(), and realloc(). Idea from NetBSD.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/stdlib/malloc.316
1 files changed, 11 insertions, 5 deletions
diff --git a/src/lib/libc/stdlib/malloc.3 b/src/lib/libc/stdlib/malloc.3
index ea8f41e6c5..804f0b9094 100644
--- a/src/lib/libc/stdlib/malloc.3
+++ b/src/lib/libc/stdlib/malloc.3
@@ -33,7 +33,7 @@
33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34.\" SUCH DAMAGE. 34.\" SUCH DAMAGE.
35.\" 35.\"
36.\" $OpenBSD: malloc.3,v 1.17 1999/11/10 22:19:22 aaron Exp $ 36.\" $OpenBSD: malloc.3,v 1.18 2000/01/19 05:36:38 pjanzen Exp $
37.\" 37.\"
38.Dd August 27, 1996 38.Dd August 27, 1996
39.Dt MALLOC 3 39.Dt MALLOC 3
@@ -241,8 +241,11 @@ The
241and 241and
242.Fn calloc 242.Fn calloc
243functions return 243functions return
244a pointer to the allocated space if successful; otherwise 244a pointer to the allocated space if successful; otherwise,
245a null pointer is returned. 245a null pointer is returned and
246.Va errno
247is set to
248.Er ENOMEM .
246.Pp 249.Pp
247The 250The
248.Fn free 251.Fn free
@@ -252,8 +255,11 @@ functions return no value.
252.Pp 255.Pp
253The 256The
254.Fn realloc 257.Fn realloc
255function a pointer to the possibly moved allocated space; 258function returns a pointer to the (possibly moved) allocated space
256otherwise a null pointer is returned. 259if successful; otherwise, a null pointer is returned and
260.Va errno
261is set to
262.Er ENOMEM .
257.Sh MESSAGES 263.Sh MESSAGES
258If 264If
259.Fn malloc , 265.Fn malloc ,