From owner-freebsd-current@FreeBSD.ORG Wed Apr 13 17:27:07 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 17E7F16A4CE for ; Wed, 13 Apr 2005 17:27:07 +0000 (GMT) Received: from smtp4.server.rpi.edu (smtp4.server.rpi.edu [128.113.2.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7D96343D54 for ; Wed, 13 Apr 2005 17:27:06 +0000 (GMT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp4.server.rpi.edu (8.13.0/8.13.0) with ESMTP id j3DHR4Yn003323; Wed, 13 Apr 2005 13:27:05 -0400 Mime-Version: 1.0 Message-Id: In-Reply-To: <20050413075956.GO89047@cirb503493.alcatel.com.au> References: <1113332762.27362.29.camel@localhost.localdomain> <20050412195700.GN89047@cirb503493.alcatel.com.au> <20050413030814.GA21318@VARK.MIT.EDU> <20050413075956.GO89047@cirb503493.alcatel.com.au> Date: Wed, 13 Apr 2005 13:27:03 -0500 To: Peter Jeremy , FreeBSD Current From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-CanItPRO-Stream: default X-RPI-SA-Score: undef - spam-scanning disabled X-Scanned-By: CanIt (www . canit . ca) on 128.113.2.4 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 17:27:07 -0000 At 5:59 PM +1000 4/13/05, Peter Jeremy wrote: > >> 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. Uh, no. This can get you into trouble, if one of those system routines called some other system routine, and that other system routine "failed", but in a way which is not really an error for the routine you called. This happens if a system routine is calling 'stat()' for some *optional* config file, for instance. It is not an error to you at all if that optional config file does not exist, but errno will have been set. Note that I have lost time debugging non-problems because of programmers who used this "time-saving trick" of just checking errno (instead of checking the actual return-code from the routines they called). It is very annoying. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu