NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: standards/41992 (fgets returns non-NULL for a buffer size of 1 on an empty file)
The following reply was made to PR standards/41992; it has been noted by GNATS.
From: David Laight <david%l8s.co.uk@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: standards/41992 (fgets returns non-NULL for a buffer size of 1 on
an empty file)
Date: Mon, 12 Oct 2009 22:39:38 +0100
On Fri, Sep 04, 2009 at 11:35:05PM +0000, joerg%NetBSD.org@localhost wrote:
> The behavior required by POSIX is questionable for the case of empty
> buffer. Implementing the requirement for size=1 would require reading
> from the stream, even though no input will be consumed. This can have
> undesirable effects e.g. for pipes.
I'm not sure that reading from the stream (into the stdio buffer)
can be a problem.
Programs using stdio cannot control the offset of the underlying file.
David
--
David Laight: david%l8s.co.uk@localhost
Home |
Main Index |
Thread Index |
Old Index