From owner-freebsd-current@FreeBSD.ORG Wed Apr 13 08:00:00 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5210A16A4CE for ; Wed, 13 Apr 2005 08:00:00 +0000 (GMT) Received: from mail17.syd.optusnet.com.au (mail17.syd.optusnet.com.au [211.29.132.198]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7943543D5E for ; Wed, 13 Apr 2005 07:59:59 +0000 (GMT) (envelope-from PeterJeremy@optushome.com.au) Received: from cirb503493.alcatel.com.au (c211-30-75-229.belrs2.nsw.optusnet.com.au [211.30.75.229]) j3D7xvli020393 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 13 Apr 2005 17:59:58 +1000 Received: from cirb503493.alcatel.com.au (localhost.alcatel.com.au [127.0.0.1])j3D7xu7l000952 for ; Wed, 13 Apr 2005 17:59:56 +1000 (EST) (envelope-from pjeremy@cirb503493.alcatel.com.au) Received: (from pjeremy@localhost) by cirb503493.alcatel.com.au (8.12.10/8.12.9/Submit) id j3D7xuWq000951 for freebsd-current@FreeBSD.ORG; Wed, 13 Apr 2005 17:59:56 +1000 (EST) (envelope-from pjeremy) Date: Wed, 13 Apr 2005 17:59:56 +1000 From: Peter Jeremy To: FreeBSD Current Message-ID: <20050413075956.GO89047@cirb503493.alcatel.com.au> References: <1113332762.27362.29.camel@localhost.localdomain> <20050412195700.GN89047@cirb503493.alcatel.com.au> <20050413030814.GA21318@VARK.MIT.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050413030814.GA21318@VARK.MIT.EDU> User-Agent: Mutt/1.4.2i Subject: Re: strtonum(3) in FreeBSD? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Apr 2005 08:00:00 -0000 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