From owner-svn-src-head@FreeBSD.ORG Mon Mar 16 17:42:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C747D8B7; Mon, 16 Mar 2015 17:42:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9955887B; Mon, 16 Mar 2015 17:42:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2GHgsxI038601; Mon, 16 Mar 2015 17:42:54 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2GHgsE3038599; Mon, 16 Mar 2015 17:42:54 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201503161742.t2GHgsE3038599@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Mon, 16 Mar 2015 17:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280148 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Mar 2015 17:42:54 -0000 Author: rwatson Date: Mon Mar 16 17:42:53 2015 New Revision: 280148 URL: https://svnweb.freebsd.org/changeset/base/280148 Log: Introduce a cap_ioctl_t used for the 'cmds' arguments to cap_ioctls_limit() and cap_ioctls_get(). On FreeBSD, these are 'unsigned long', but on Linux, ioctl(2) takes an 'int', making mild abstraction desirable. MFC after: 3 days Sponsored by: Google, Inc. Modified: head/sys/sys/capsicum.h head/sys/sys/types.h Modified: head/sys/sys/capsicum.h ============================================================================== --- head/sys/sys/capsicum.h Mon Mar 16 16:29:33 2015 (r280147) +++ head/sys/sys/capsicum.h Mon Mar 16 17:42:53 2015 (r280148) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2008-2010 Robert N. M. Watson + * Copyright (c) 2008-2010, 2015 Robert N. M. Watson * Copyright (c) 2012 FreeBSD Foundation * All rights reserved. * @@ -398,13 +398,13 @@ int __cap_rights_get(int version, int fd /* * Limits allowed ioctls for the given descriptor. */ -int cap_ioctls_limit(int fd, const unsigned long *cmds, size_t ncmds); +int cap_ioctls_limit(int fd, const cap_ioctl_t *cmds, size_t ncmds); /* * Returns array of allowed ioctls for the given descriptor. * If all ioctls are allowed, the cmds array is not populated and * the function returns CAP_IOCTLS_ALL. */ -ssize_t cap_ioctls_get(int fd, unsigned long *cmds, size_t maxcmds); +ssize_t cap_ioctls_get(int fd, cap_ioctl_t *cmds, size_t maxcmds); /* * Limits allowed fcntls for the given descriptor (CAP_FCNTL_*). */ Modified: head/sys/sys/types.h ============================================================================== --- head/sys/sys/types.h Mon Mar 16 16:29:33 2015 (r280147) +++ head/sys/sys/types.h Mon Mar 16 17:42:53 2015 (r280148) @@ -232,6 +232,11 @@ typedef __useconds_t useconds_t; /* micr #define _USECONDS_T_DECLARED #endif +#ifndef _CAP_IOCTL_T_DECLARED +#define _CAP_IOCTL_T_DECLARED +typedef unsigned long cap_ioctl_t; +#endif + #ifndef _CAP_RIGHTS_T_DECLARED #define _CAP_RIGHTS_T_DECLARED struct cap_rights;