From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Viro To: 9fans@cse.psu.edu Subject: Re: [9fans] 9fs/9auth for FreeBSD In-Reply-To: <200103282256.f2SMuEl95658@orthanc.ab.ca> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Wed, 28 Mar 2001 18:35:34 -0500 Topicbox-Message-UUID: 7654e118-eac9-11e9-9e20-41e7f4b1d025 On Wed, 28 Mar 2001, Lyndon Nerenberg wrote: > >>>>> "Alexander" == Alexander Viro writes: > > Alexander> PS: POSIX says nothing, since append-only is BSDism and > Alexander> POSIX is a codification of Missed'em'V bugs, so > Alexander> append-only is out of scope. > > Let's make sure we're talking about the same thing here. The chflags() > behaviour is 4.4BSD-specific. The O_APPEND behaviour has been around > since the dawn of time (or at least SVR1). My copy of POSIX is at > home, however SuS V2 states explicitly (both open(2) and write(2)) > that O_APPEND causes all writes to set the file pointer to the end of > the file prior to performing the write I/O, and that the combination > of the implicit seek and the associated write are atomic. Wait a second. The question being: what happens if you open append-only file with fd = open("foo", O_RDWR), then lseek(fd, 0, SEEK_SET), then write(fd, buf, len)? Plan9: append to EOF. Linux: -EPERM on open() FreeBSD: -EPERM on write() (open() succeeds).