From owner-cvs-src-old@FreeBSD.ORG Tue Feb 17 20:01:40 2009 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51C6B1065788 for ; Tue, 17 Feb 2009 20:01:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 214F08FC0A for ; Tue, 17 Feb 2009 20:01:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1HK1eNS000468 for ; Tue, 17 Feb 2009 20:01:40 GMT (envelope-from jhb@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1HK1ewQ000467 for cvs-src-old@freebsd.org; Tue, 17 Feb 2009 20:01:40 GMT (envelope-from jhb@repoman.freebsd.org) Message-Id: <200902172001.n1HK1ewQ000467@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to jhb@repoman.freebsd.org using -f From: John Baldwin Date: Tue, 17 Feb 2009 19:57:52 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: RELENG_7 Subject: cvs commit: src/sys/kern kern_descrip.c uipc_sem.c src/sys/modules/sem Makefile src/sys/sys file.h ksem.h user.h src/tools/regression/posixsem Makefile posixsem.c posixsem.t test.c test.h src/usr.bin/procstat procstat_files.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 20:01:40 -0000 jhb 2009-02-17 19:57:52 UTC FreeBSD src repository Modified files: (Branch: RELENG_7) sys/kern kern_descrip.c uipc_sem.c sys/modules/sem Makefile sys/sys file.h ksem.h user.h usr.bin/procstat procstat_files.c Added files: (Branch: RELENG_7) tools/regression/posixsem Makefile posixsem.c posixsem.t test.c test.h Log: SVN rev 188727 on 2009-02-17 19:57:52Z by jhb MFC: Rework the lifetime management of the kernel implementation of POSIX semaphores. Specifically, semaphores are now represented as new file descriptor type that is set to close on exec. This removes the need for all of the manual process reference counting (and fork, exec, and exit event handlers) as the normal file descriptor operations handle all of that for us nicely. It is also suggested as one possible implementation in the spec and at least one other OS (OS X) uses this approach. Refer to the original commit for more details on specific bug fixes, etc. A notable difference in this MFC relative to the original commit to HEAD is that the MAC entry points are unchanged to preserve the ABI for MAC policy modules. fstat() on a POSIX semaphore in 7 uses the mac_check_posix_sem_getvalue() hook to determine access as that is the closest match to stat() of the available hooks. Discussed with: rwatson (MAC bits (or lack thereof)) Revision Changes Path 1.313.2.13 +6 -0 src/sys/kern/kern_descrip.c 1.28.2.4 +559 -627 src/sys/kern/uipc_sem.c 1.2.10.1 +1 -1 src/sys/modules/sem/Makefile 1.73.2.2 +1 -0 src/sys/sys/file.h 1.3.2.1 +24 -18 src/sys/sys/ksem.h 1.70.2.6 +1 -0 src/sys/sys/user.h 1.1.2.1 +11 -0 src/tools/regression/posixsem/Makefile (new) 1.1.2.1 +1437 -0 src/tools/regression/posixsem/posixsem.c (new) 1.1.2.1 +5 -0 src/tools/regression/posixsem/posixsem.t (new) 1.1.2.1 +128 -0 src/tools/regression/posixsem/test.c (new) 1.1.2.1 +59 -0 src/tools/regression/posixsem/test.h (new) 1.5.2.7 +4 -0 src/usr.bin/procstat/procstat_files.c