From owner-svn-src-head@FreeBSD.ORG Wed Oct 27 02:32:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88D29106564A; Wed, 27 Oct 2010 02:32:54 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 77FAA8FC1C; Wed, 27 Oct 2010 02:32:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9R2Wsco084555; Wed, 27 Oct 2010 02:32:54 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9R2Wsu3084553; Wed, 27 Oct 2010 02:32:54 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201010270232.o9R2Wsu3084553@svn.freebsd.org> From: David Xu Date: Wed, 27 Oct 2010 02:32:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214409 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 27 Oct 2010 02:32:54 -0000 Author: davidxu Date: Wed Oct 27 02:32:54 2010 New Revision: 214409 URL: http://svn.freebsd.org/changeset/base/214409 Log: If input parameter cpusetsize is zero, give userland size of cpuset mask kernel is using. Modified: head/sys/kern/kern_cpuset.c Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Wed Oct 27 02:07:25 2010 (r214408) +++ head/sys/kern/kern_cpuset.c Wed Oct 27 02:32:54 2010 (r214409) @@ -889,6 +889,10 @@ cpuset_getaffinity(struct thread *td, st int error; size_t size; + if (uap->cpusetsize == 0) { + td->td_retval[0] = sizeof(cpuset_t); + return (0); + } if (uap->cpusetsize < sizeof(cpuset_t) || uap->cpusetsize > CPU_MAXSIZE / NBBY) return (ERANGE);