Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 May 2012 22:10:47 +0400
From:      Andrey Chernov <ache@FreeBSD.ORG>
To:        Garrett Cooper <yanegomi@gmail.com>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Konstantin Belousov <kib@FreeBSD.ORG>
Subject:   Re: svn commit: r235266 - head/lib/libc/stdlib
Message-ID:  <20120511181047.GA21793@vniz.net>
In-Reply-To: <CAGH67wQnd7rwwUn1ep-3QJzYOdtQ5OayMvLVMBJvVCu6iPtBPg@mail.gmail.com>
References:  <201205111129.q4BBT85G081093@svn.freebsd.org> <20120511145432.GA19173@vniz.net> <20120511170412.GR2358@deviant.kiev.zoral.com.ua> <CAGH67wQnd7rwwUn1ep-3QJzYOdtQ5OayMvLVMBJvVCu6iPtBPg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, May 11, 2012 at 10:55:39AM -0700, Garrett Cooper wrote:
> On Fri, May 11, 2012 at 10:04 AM, Konstantin Belousov
> <kostikbel@gmail.com> wrote:
> > On Fri, May 11, 2012 at 06:54:32PM +0400, Andrey Chernov wrote:
> >> Thanks, but in this two places old errno value should be saved across
> >> free() because free() may damage it:
> > I do not agree. free() cannot change errno.
> 
>     It might depending on the OS (logically it shouldn't, but I
> digress), but there was some recent discussion on the POSIX list about
> errno not being mangled via free:
> http://austingroupbugs.net/view.php?id=385 .

Yes. The initial paragraph from it states pretty clear:

Line 25639 [XSH errno] is explicit that "The setting of errno after a
successful call to a function is unspecified unless the description of
that function specifies that errno shall not be modified." However,
free() does not mention its interaction with errno.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120511181047.GA21793>