From owner-freebsd-questions@FreeBSD.ORG Sun Dec 28 06:07:00 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92049106564A for ; Sun, 28 Dec 2008 06:07:00 +0000 (UTC) (envelope-from jonc@chen.org.nz) Received: from chen.org.nz (ip-58-28-152-174.static-xdsl.xnet.co.nz [58.28.152.174]) by mx1.freebsd.org (Postfix) with ESMTP id 384BA8FC08 for ; Sun, 28 Dec 2008 06:07:00 +0000 (UTC) (envelope-from jonc@chen.org.nz) Received: by chen.org.nz (Postfix, from userid 1000) id 8D5F628424; Sun, 28 Dec 2008 19:06:58 +1300 (NZDT) Date: Sun, 28 Dec 2008 19:06:58 +1300 From: Jonathan Chen To: Mitar Message-ID: <20081228060658.GA73070@osiris.chen.org.nz> References: <200812271517.46409.fbsd.questions@rachie.is-a-geek.net> <200812271910.43793.fbsd.questions@rachie.is-a-geek.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-questions@freebsd.org Subject: Re: Open with O_APPEND fails X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Dec 2008 06:07:00 -0000 On Sun, Dec 28, 2008 at 05:46:39AM +0100, Mitar wrote: > Hi! > > On Sun, Dec 28, 2008 at 5:10 AM, Mel > wrote: > > open(2) will succeed but write(2) will fail with EBADF as documented (and I > > verified this behavior). Still no EACCES as you and the bugreporter are > > seeing. > > Where is documented that write would fail if file is opened only with > O_APPEND? Just O_APPEND should also open file for writing as appending > is also writing. It cannot be used without "write" semantics so file > has to be open also for writing. If I recall correctly, this behaviour has been standard on UNIX-like OS's for a *very* long time now. If you are seeing a write allowed with just O_APPEND on Linux, it would very likely be a Linux only "feature". Cheers. -- Jonathan Chen ---------------------------------------------------------------------- The Internet: an empirical test of the idea that a million monkeys banging on a million keyboards can produce Shakespeare