Read /dev/null differs from POSIX

Steve Kargl sgk at troutmask.apl.washington.edu
Sat May 21 13:32:10 PDT 2005


On Sat, May 21, 2005 at 09:13:29PM +0100, Mark Murray wrote:
> Steve Kargl writes:
> > >From http://www.opengroup.org/onlinepubs/009695399/toc.htm
> > 
> >    /dev/null -- An infinite data source and data sink.  Data
> >    written to /dev/null shall be discarded.  Reads from
> >    /dev/null shall always return end-of-file (EOF).
> > 
> > This program
> 
> ... abuses fread(3) return values.
> 

Sorry for the noise.  I remembered feof() about 15 minutes
ago.  FreeBSD's null(4) man page, although quite short, is
somewhat confusing in its vagueness.

-- 
Steve


More information about the freebsd-standards mailing list