svn commit: r236582 - head/lib/libc/stdlib

Andrey Chernov ache at FreeBSD.ORG
Tue Jun 5 13:35:36 UTC 2012


On Tue, Jun 05, 2012 at 03:10:06PM +0200, Dag-Erling Sm??rgrav wrote:
> Pawel Jakub Dawidek <pjd at FreeBSD.org> writes:
> > Very interesting. However free(3) is always successful. Maybe we need
> > more context here, but the sentence above might talk about functions
> > that can either succeed or fail and such functions do set errno on
> > failure, but we don't know what they do to errno on success - they
> > sometimes interact with the errno, free(3) never does.
> 
> Even if free() itself never fails, it might have side effects such as
> unmapping a slab, logging a KTR event etc. which can modify errno.

I totally agree. Even if our free() will be cleaned in this sense or save 
errno internally, we need the code which not relays on some particular 
implementation but works in general scope with any standard-conformant 
free().

-- 
http://ache.vniz.net/


More information about the svn-src-all mailing list