From owner-freebsd-audit Thu May 16 5:24:46 2002 Delivered-To: freebsd-audit@freebsd.org Received: from south.nanolink.com (south.nanolink.com [217.75.134.10]) by hub.freebsd.org (Postfix) with SMTP id 139E237B41F for ; Thu, 16 May 2002 05:24:28 -0700 (PDT) Received: (qmail 57327 invoked from network); 16 May 2002 12:32:11 -0000 Received: from unknown (HELO straylight.ringlet.net) (212.116.140.125) by south.nanolink.com with SMTP; 16 May 2002 12:32:11 -0000 Received: (qmail 84438 invoked by uid 1000); 16 May 2002 12:23:45 -0000 Date: Thu, 16 May 2002 15:23:45 +0300 From: Peter Pentchev To: Dag-Erling Smorgrav Cc: Bruce Evans , Giorgos Keramidas , Mike Makonnen , freebsd-audit@FreeBSD.ORG Subject: Re: RFC: Port of NetBSD cat(1)'s -f option. Message-ID: <20020516152345.E349@straylight.oblivion.bg> Mail-Followup-To: Dag-Erling Smorgrav , Bruce Evans , Giorgos Keramidas , Mike Makonnen , freebsd-audit@FreeBSD.ORG References: <20020515211758.GB68380@hades.hell.gr> <20020516164332.B1704-100000@gamplex.bde.org> <20020516134044.A349@straylight.oblivion.bg> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="2qXFWqzzG3v1+95a" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from des@ofug.org on Thu, May 16, 2002 at 02:14:05PM +0200 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --2qXFWqzzG3v1+95a Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 16, 2002 at 02:14:05PM +0200, Dag-Erling Smorgrav wrote: > Peter Pentchev writes: > > Also, aren't we supposed to test the return values of syscalls explicit= ly > > against -1, and not just < 0? >=20 > Is a negative return value different from -1 more correct than -1? > Should it be silently ignored? Hmm. The standards (and our manual pages) say that most syscalls return *exactly* -1 on error. A negative value different than -1 should be treated as some kind of meta-error; maybe something that might warrant an err(EX_OSERR, ...). No, I do not really think that it is possible - or even thinkable - to make that check every time a syscall is invoked :) Actually, now I don't know what to think - for the past few months, I have been writing my own programs with explicit checks for -1. Is there an OS out there that returns negative values other than -1? I presume that no *new* OS and no new syscalls will be written to return such, so no further incompatibility would be introduced; but is there an existing platform that would break programs which check explicitly for -1? G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 What would this sentence be like if it weren't self-referential? --2qXFWqzzG3v1+95a Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iD8DBQE846TR7Ri2jRYZRVMRAsAoAJ9J/SvWvVtjiKTPGKkU2uxAoBQUnwCgnLlv c9kiXUlEwmKEqfMm0+4ie7o= =Ig8u -----END PGP SIGNATURE----- --2qXFWqzzG3v1+95a-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message