Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Apr 2005 17:59:56 +1000
From:      Peter Jeremy <PeterJeremy@optushome.com.au>
To:        FreeBSD Current <freebsd-current@FreeBSD.ORG>
Subject:   Re: strtonum(3) in FreeBSD?
Message-ID:  <20050413075956.GO89047@cirb503493.alcatel.com.au>
In-Reply-To: <20050413030814.GA21318@VARK.MIT.EDU>
References:  <1113332762.27362.29.camel@localhost.localdomain> <20050412195700.GN89047@cirb503493.alcatel.com.au> <20050413030814.GA21318@VARK.MIT.EDU>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 2005-Apr-12 23:08:15 -0400, David Schultz wrote:
>It actually has a sensible way of distinguishing errors (it always
>sets errno, even if to 0),

I thought so initially but on closer reading, it does correctly preserve
errno on success.

> but this is unintuitive to anyone who
>is used to the broken POSIX way of doing it.

I would dispute the 'broken' adjective.  Having errno only affected by
errors means that you can issue a series of system calls and determine
that something failed - which may be enough.  POSIX inherited this
behaviour from Unix - which has always behaved this way AFAIK.  (That
said, there are a couple of library functions that change errno but
return success).

-- 
Peter Jeremy



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