From owner-freebsd-questions@FreeBSD.ORG Sun Dec 28 04:10:45 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 242091065670 for ; Sun, 28 Dec 2008 04:10:45 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from mail.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id E56B48FC14 for ; Sun, 28 Dec 2008 04:10:44 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from localhost (mail.rachie.is-a-geek.net [192.168.2.101]) by mail.rachie.is-a-geek.net (Postfix) with ESMTP id 19E8AAFBC02; Sat, 27 Dec 2008 19:10:44 -0900 (AKST) From: Mel To: freebsd-questions@freebsd.org Date: Sat, 27 Dec 2008 19:10:43 -0900 User-Agent: KMail/1.9.10 References: <200812271517.46409.fbsd.questions@rachie.is-a-geek.net> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200812271910.43793.fbsd.questions@rachie.is-a-geek.net> Cc: Mitar 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 04:10:45 -0000 On Saturday 27 December 2008 18:16:41 Mitar wrote: > Hi! > > On Sun, Dec 28, 2008 at 1:17 AM, Mel > > wrote: > > 15 fd = open(fname, O_WRONLY|O_APPEND); > > Try only with O_APPEND, without O_WRONLY. Why would you? 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. If this is really a bug in FreeBSD I'd expect way more applications to suffer issues. There must be something else at play and I certainly don't have an explanation why specifying the O_WRONLY flag would cause this bug to disappear. I suspect priv(9) to be responsible for the change in behavior you're seeing, however that should return EPERM not EACCES. -- Mel Problem with today's modular software: they start with the modules and never get to the software part.