Date: Wed, 27 Oct 2010 02:32:54 +0000 (UTC) From: David Xu <davidxu@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r214409 - head/sys/kern Message-ID: <201010270232.o9R2Wsu3084553@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010270232.o9R2Wsu3084553>