Re: fflush() on readonly files

From: Andrey Chernov (ache_at_nagual.pp.ru)
Date: 06/19/04

  • Next message: Andrey Chernov: "Re: fflush() on readonly files"
    Date: Sat, 19 Jun 2004 17:07:18 +0400
    To: Tim Robbins <tjr@FreeBSD.ORG>
    
    

    On Sat, Jun 19, 2004 at 10:01:49PM +1000, Tim Robbins wrote:
    > This has already been discussed:
    > - Microsoft libraries and other libraries imitating them discard buffered
    > input data (like fpurge().)

    Damn them.

    > - UNIX libc (at least 7th ed.), Solaris libc, GNU libc and products derived
    > from P.J. Plauger's C library (e.g. QNX) do nothing and indicate success.

    We need to do the same again (at least until some standard says
    otherwise).

    > - BSD since Torek's stdio rewrite (inc. FreeBSD and Mac OS X) indicate
    > an error.

    We need to fix just fflush() case only, left other rewrite parts
    untouched.

    if ((fp->_flags & (__SWR | __SRW)) == 0)
            retval = 0;

    > There is no reason to change from the perfectly correct & well-documented
    > behaviour BSD has had for 10-15 years. The original poster's example provides
    > a good argument for this: it detects application bugs.

    I agree.

    -- 
    Andrey Chernov | http://ache.pp.ru/
    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
    

  • Next message: Andrey Chernov: "Re: fflush() on readonly files"