From owner-p4-projects@FreeBSD.ORG Mon Aug 25 10:47:35 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CA111106568B; Mon, 25 Aug 2008 10:47:35 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DA361065676 for ; Mon, 25 Aug 2008 10:47:35 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 886318FC60 for ; Mon, 25 Aug 2008 10:47:35 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m7PAlZgL090000 for ; Mon, 25 Aug 2008 10:47:35 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m7PAlZ6O089998 for perforce@freebsd.org; Mon, 25 Aug 2008 10:47:35 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Mon, 25 Aug 2008 10:47:35 GMT Message-Id: <200808251047.m7PAlZ6O089998@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 148371 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Aug 2008 10:47:36 -0000 http://perforce.freebsd.org/chv.cgi?CH=148371 Change 148371 by rwatson@rwatson_freebsd_capabilities on 2008/08/25 10:46:43 Add a new right, CAP_KEVENT, which controls use of a kqueue, to be disinguished from CAP_EVENT, which control use of a kqueue/select/ poll to monitor another descriptor. Affected files ... .. //depot/projects/trustedbsd/capabilities/src/sys/kern/kern_event.c#5 edit .. //depot/projects/trustedbsd/capabilities/src/sys/sys/capability.h#17 edit Differences ... ==== //depot/projects/trustedbsd/capabilities/src/sys/kern/kern_event.c#5 (text+ko) ==== @@ -702,7 +702,7 @@ struct file *fp; int i, n, nerrors, error; - if ((error = fget(td, fd, CAP_EVENT, &fp)) != 0) + if ((error = fget(td, fd, CAP_KEVENT, &fp)) != 0) return (error); if ((error = kqueue_acquire(fp, &kq)) != 0) goto done_norel; @@ -2016,7 +2016,7 @@ struct file *fp; int error; - if ((error = fget(td, fd, CAP_EVENT, &fp)) != 0) + if ((error = fget(td, fd, CAP_KEVENT, &fp)) != 0) return (error); if ((error = kqueue_acquire(fp, &kq)) != 0) goto noacquire; ==== //depot/projects/trustedbsd/capabilities/src/sys/sys/capability.h#17 (text+ko) ==== @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/capabilities/src/sys/sys/capability.h#16 $ + * $P4: //depot/projects/trustedbsd/capabilities/src/sys/sys/capability.h#17 $ */ /* @@ -87,7 +87,8 @@ #define CAP_SEM_POST 0x0000010000000000ULL /* ksem_post */ #define CAP_SEM_WAIT 0x0000020000000000ULL /* ksem_wait */ #define CAP_SEM_GETVALUE 0x0000040000000000ULL /* ksem_getvalue */ -#define CAP_MASK_VALID 0x000007ffffffffffULL +#define CAP_KEVENT 0x0000080000000000ULL /* kevent(2) */ +#define CAP_MASK_VALID 0x00000fffffffffffULL /* * Notes: @@ -100,7 +101,8 @@ * * pread and pwrite will not use CAP_SEEK. * - * CAP_EVENT covers select, poll, and kqueue registration for a capability. + * CAP_EVENT covers select, poll, and kqueue registration for a capability; + * CAP_KEVENT controls the use of a kqueue(2) description. * * sendfile is authorized using CAP_READ on the file and CAP_WRITE on the * socket.