Re: Is this a bug in libc6?
On Sat, 11 Apr 1998, Steve Greenland wrote:
> > BTW, in Debian, fclose says it returns an error, and does not mention
> > corrupting memory.
> > ERRORS
> > EBADF The argument stream is not an open stream.
> > The fclose function may also fail and set errno for any of
> > the errors specified for the routines close(2) or
> > fflush(3).
> Oh, sure, that's an error it *may* report, *if* it detects it. I don't
> see anything on the man page that would expect me to believe that the
> implementation will detect all possible invalid streams and report an
> error. I am also quite willing to believe that the particular error we
> are discussing (fclose(fp);fclose(fp)) will be detected.
The point here is that it's _documented_ to return EBADF if the stream
pointer is not an open stream, and that's not what happens. This is
difficult to enforce in practice, and is not necessary for ISO compliance --
so let's fix the man page.
Has anyone submitted a bug against manpages yet?
To UNSUBSCRIBE, email to email@example.com
with a subject of "unsubscribe". Trouble? Contact firstname.lastname@example.org