Re: incompatible open modes

From: Andries Brouwer (aebr_at_win.tue.nl)
Date: 07/31/03

  • Next message: Ben Pfaff: "Re: Emulating i486 on i386 (was: TSCs are a no-no on i386)"
    Date:	Thu, 31 Jul 2003 19:35:58 +0200
    To: Zack Brown <zbrown@tumblerings.org>
    
    

    > On Thu, Jul 31, 2003 at 12:09:14PM -0400, Ata, John wrote:

    > > the manpage on "open" states that if a file is opened "O_RDONLY|O_TRUNC",
    > > the O_TRUNC is either ignored or an error is returned. The 2.4 kernel
    > > appears to cheerfully truncate the file on open. I wondered which
    > > behavior is actually intended.
    > >
    > > O_TRUNC
    > > If the file already exists and is a regular file and the open
    > > mode allows writing (i.e., is O_RDWR or O_WRONLY) it will be
    > > truncated to length 0.
    > > Otherwise the effect of O_TRUNC is unspecified.
    > > (On many Linux versions it will be ignored; on other versions
    > > it will return an error.)

    This was just recently discussed, and it became clear that the parenthetical
    remark only led to confusion. It has been deleted. Instead

           The (undefined) effect of O_RDONLY | O_TRUNC various among
           implementations. On many systems the file is actually
           truncated.

    has been added.

    Andries

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Ben Pfaff: "Re: Emulating i486 on i386 (was: TSCs are a no-no on i386)"

    Relevant Pages

    • Re: [PATCH] PS/2 mouse rate setting
      ... > Actually partly being guilty of it too - but as Andries points out it would ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
      (Linux-Kernel)
    • Re: i_blksize
      ... If sizeof(struct inode) decreases by 1% then we can keep 1% more inodes. ... Andries ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
      (Linux-Kernel)
    • Re: 2.6.0-test2: cursor started to disappear
      ... >> Loop is not stable at all. ... Andries ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
      (Linux-Kernel)
    • Re: [04/07] partitions/msdos.c fix
      ... Andries ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: AGP bogosities
      ... is a difference between whats output to the screen during bootup (set ... Copyright 2005 by Maurice Eugene Heskett, ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
      (Linux-Kernel)