Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Jul 1999 01:32:17 -0400
From:      "David E. Cross" <crossd@cs.rpi.edu>
To:        Kevin Day <toasty@dragondata.com>
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 
Message-ID:  <199907160532.BAA54322@cs.rpi.edu>
In-Reply-To: Message from Kevin Day <toasty@dragondata.com>  of "Fri, 16 Jul 1999 00:02:55 CDT." <199907160502.AAA28122@celery.dragondata.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> >     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




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