From owner-freebsd-arch@FreeBSD.ORG Sat May 9 20:07:27 2009 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3CD9106566B for ; Sat, 9 May 2009 20:07:27 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 7402F8FC2A for ; Sat, 9 May 2009 20:07:27 +0000 (UTC) (envelope-from jilles@stack.nl) Received: by mx1.stack.nl (Postfix, from userid 65534) id D67D3359950; Sat, 9 May 2009 22:07:26 +0200 (CEST) X-Spam-DCC: CTc-dcc2: scanner01.stack.nl 1031; Body=1 Fuz1=1 Fuz2=1 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on scanner01.stack.nl X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Relay-Country: _RELAYCOUNTRY_ Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id B8586359947; Sat, 9 May 2009 22:07:24 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id A6C49228B7; Sat, 9 May 2009 22:07:24 +0200 (CEST) Date: Sat, 9 May 2009 22:07:24 +0200 From: Jilles Tjoelker To: Lothar Scholz Message-ID: <20090509200724.GA25714@stack.nl> References: <588815840.20090509203115@scriptolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <588815840.20090509203115@scriptolutions.com> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-arch@freebsd.org Subject: Re: Posix shared memory problem X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2009 20:07:27 -0000 On Sat, May 09, 2009 at 08:31:15PM +0200, Lothar Scholz wrote: > Thanks for solving the posix semaphore problem. But with shared memory > there comes the next issue: > int main() { > int m; > shm_unlink("/barfoo"); > m = shm_open("/barfoo", O_RDWR|O_CREAT|O_EXCL, S_IRWXU); > if (m == 1) perror("shm_open error"); > } > i always get permission denied error, and i tried many values > for flags and mode? I can only get this working as root but not > as a normal user. shm_open/shm_unlink refer to the filesystem; they are fairly direct wrappers around open and unlink. POSIX suggests making the pathname a configuration option; alternatively, using a directory for temporary files such as /tmp could work. -- Jilles Tjoelker