Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/stdlib Document return value for realloc(3) when si...



details:   https://anonhg.NetBSD.org/src/rev/9cdd52e9adf8
branches:  trunk
changeset: 345585:9cdd52e9adf8
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Wed Jun 01 05:40:26 2016 +0000

description:
Document return value for realloc(3) when size is 0.  From PR lib/47384

diffstat:

 lib/libc/stdlib/malloc.3 |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r a66d651f9a1e -r 9cdd52e9adf8 lib/libc/stdlib/malloc.3
--- a/lib/libc/stdlib/malloc.3  Wed Jun 01 05:31:59 2016 +0000
+++ b/lib/libc/stdlib/malloc.3  Wed Jun 01 05:40:26 2016 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: malloc.3,v 1.46 2015/11/07 18:46:37 wiz Exp $
+.\" $NetBSD: malloc.3,v 1.47 2016/06/01 05:40:26 pgoyette Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -34,7 +34,7 @@
 .\"     @(#)malloc.3   8.1 (Berkeley) 6/4/93
 .\" $FreeBSD: src/lib/libc/stdlib/malloc.3,v 1.73 2007/06/15 22:32:33 jasone Exp $
 .\"
-.Dd July 26, 2015
+.Dd June 1, 2016
 .Dt MALLOC 3
 .Os
 .Sh NAME
@@ -144,6 +144,11 @@
 .Fn realloc
 function always leaves the original buffer intact
 when an error occurs.
++If
++.Ar size
++is 0, either NULL or a pointer that can be safely passed to
++.Xr free 3
++is returned.
 .Pp
 The
 .Fn free



Home | Main Index | Thread Index | Old Index