Re: close return value
Sandy Harris (email@example.com)
Thu, 18 Jul 2002 11:32:33 -0400
"Richard B. Johnson" wrote:
> On 18 Jul 2002, Patrick J. LoPresti wrote:
> > Pete Zaitcev <firstname.lastname@example.org> writes:
> > > The problem with errors from close() is that NOTHING SMART can be
> > > done by the application when it receives it.
> > This is like saying "nothing smart" can be done when write() returns
> > ENOSPC. Such statements are either trivially true or blatantly false,
> > depending on what you mean by "smart".
> > Failures happen. They can happen on write(), they can happen on
> > close(), and they can happen on any system call for which the API
> > allows it. There is no difference! Your application either deals
> > with them and is correct or fails to deal with them and is broken.
> > If the API allows an error return, you *must* check for it, period.
> Well no. Many procedures are called for effect. When is the last
> time you checked the return-value of printf() or puts()? If your
> code does this it's wasting CPU cycles.
There's a classic paper on this:
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to email@example.com
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/