From owner-freebsd-current@FreeBSD.ORG Wed Dec 2 21:11:40 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADC1C106566C for ; Wed, 2 Dec 2009 21:11:40 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.freebsd.org (Postfix) with ESMTP id 764958FC15 for ; Wed, 2 Dec 2009 21:11:40 +0000 (UTC) Received: from [172.31.193.10] (cpe-174-097-131-132.nc.res.rr.com [174.97.131.132]) (authenticated bits=0) by duke.cs.duke.edu (8.14.2/8.14.2) with ESMTP id nB2LBcZV003406 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 2 Dec 2009 16:11:39 -0500 (EST) Message-ID: <4B16D802.6030904@cs.duke.edu> Date: Wed, 02 Dec 2009 16:11:30 -0500 From: Andrew Gallatin User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: process shared semaphores? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 21:11:40 -0000 The man page for sem_init(3) says: A non-zero value for pshared specifies a shared semaphore that can be used by multiple processes, which this implementation is not capable of. Is this still correct? I'm asking, both because it seems strange to not return an error if the implementation does not support pshared semaphores, and because the threads library seems to expect it to work. Eg: int _sem_init(sem_t *sem, int pshared, unsigned int value) { semid_t semid; semid = (semid_t)SEM_USER; if ((pshared != 0) && (ksem_init(&semid, value) != 0)) return (-1); <.... So is the man page out of date, or is the userspace code future-proof for when the kernel catches up? Thanks, Drew