From owner-freebsd-hackers Thu Jul 15 22:32:42 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from cs.rpi.edu (mumble.cs.rpi.edu [128.213.8.16]) by hub.freebsd.org (Postfix) with ESMTP id BA9B514CD1; Thu, 15 Jul 1999 22:32:40 -0700 (PDT) (envelope-from crossd@cs.rpi.edu) Received: from cs.rpi.edu (phoenix.cs.rpi.edu [128.113.96.153]) by cs.rpi.edu (8.9.3/8.9.3) with ESMTP id BAA54322; Fri, 16 Jul 1999 01:32:27 -0400 (EDT) Message-Id: <199907160532.BAA54322@cs.rpi.edu> To: Kevin Day Cc: dillon@apollo.backplane.com (Matthew Dillon), green@FreeBSD.ORG (Brian F. Feldman), a.reilly@lake.com.au (Andrew Reilly), dcs@newsguy.com (Daniel C. Sobral), lyndon@orthanc.ab.ca, freebsd-hackers@FreeBSD.ORG, crossd@cs.rpi.edu Subject: Re: Swap overcommit In-Reply-To: Message from Kevin Day of "Fri, 16 Jul 1999 00:02:55 CDT." <199907160502.AAA28122@celery.dragondata.com> Date: Fri, 16 Jul 1999 01:32:17 -0400 From: "David E. Cross" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > No, wait, I got that wrong I think. > > > > Oh yah, I remember now. Hmm. How odd. I came across a case where > > read() could return -1 and not set errno properly if errno > > was already set, but a perusal of the kernel code seems to indicate > > that this can't happen. Very weird. > > > > I thought I saw this somewhere too, but I thought it was more of a case that > it was somewhere *inside* read that errno had to be preserved. i.e. errno > gets set somewhere at the top of the code, and if it was already set at a > certain point, failure was expected, and to pass along the original errno, > not the new one. > > Or perhaps we're sharing a hallucination. :) Well, set/getpriority(2), certainly can return "-1" and not be an error. You would need to clear out errno before that call and check it on return. This is where excpetions would be a great gain. It could also be used to force programmers to check their system calls more closely. Oops, you didn't handle excpetion foo? SIGBADPROGRAMMER. -- David Cross | email: crossd@cs.rpi.edu Systems Administrator/Research Programmer | Web: http://www.cs.rpi.edu/~crossd Rensselaer Polytechnic Institute, | Ph: 518.276.2860 Department of Computer Science | Fax: 518.276.4033 I speak only for myself. | WinNT:Linux::Linux:FreeBSD To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message