From owner-freebsd-arch@FreeBSD.ORG Sun May 10 04:53:24 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 9F423106567E for ; Sun, 10 May 2009 04:53:24 +0000 (UTC) (envelope-from scholz@scriptolutions.com) Received: from dd17920.kasserver.com (dd17920.kasserver.com [85.13.138.236]) by mx1.freebsd.org (Postfix) with ESMTP id 5FA868FC1D for ; Sun, 10 May 2009 04:53:24 +0000 (UTC) (envelope-from scholz@scriptolutions.com) Received: from X64SSD (unknown [117.47.148.131]) by dd17920.kasserver.com (Postfix) with ESMTP id 1A62A181B39BE; Sun, 10 May 2009 06:52:18 +0200 (CEST) Date: Sun, 10 May 2009 06:49:24 +0200 From: Lothar Scholz X-Mailer: The Bat! (v3.62.08) Professional Organization: Scriptolutions X-Priority: 3 (Normal) Message-ID: <19461540.20090510064924@scriptolutions.com> To: Jilles Tjoelker In-Reply-To: <20090509200724.GA25714@stack.nl> References: <588815840.20090509203115@scriptolutions.com> <20090509200724.GA25714@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-arch@freebsd.org Subject: Re[2]: Posix shared memory problem X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Lothar Scholz List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2009 04:53:25 -0000 Hello Jilles, Saturday, May 9, 2009, 10:07:24 PM, you wrote: JT> 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. JT> shm_open/shm_unlink refer to the filesystem; they are fairly direct JT> wrappers around open and unlink. Question is where are they stored? In Linux it is "/dev/shm". In my case it looks like the directory for shm_open files has some wrong access rights so that a normal user can't generate it. JT> POSIX suggests making the pathname a configuration option; JT> alternatively, using a directory for temporary files such as /tmp could JT> work. I will try this hack soon if nobody comes up with a solution. -- Best regards, Lothar Scholz mailto:scholz@scriptolutions.com