Date: Wed, 27 Oct 2010 10:49:12 +0000 From: David Xu <davidxu@freebsd.org> To: Garrett Cooper <gcooper@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r214409 - head/sys/kern Message-ID: <4CC803A8.3040602@freebsd.org> In-Reply-To: <AANLkTi=2dTVmB8Goj%2BNXq4F6SmZBNS3bxn8gLjmQ%2BdfV@mail.gmail.com> References: <201010270232.o9R2Wsu3084553@svn.freebsd.org> <AANLkTi=2dTVmB8Goj%2BNXq4F6SmZBNS3bxn8gLjmQ%2BdfV@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Garrett Cooper wrote: > On Tue, Oct 26, 2010 at 7:32 PM, David Xu <davidxu@freebsd.org> wrote: >> 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); > > Isn't this requirement partly broken now? > > [ERANGE] The cpusetsize was either preposterously large or > smaller than the kernel set size. > > Why should cpuset(2) be broken in favor of people not passing valid values? > Thanks, > -Garrett > I really hate to see such a problem that userland can not figure out what kernel is using, I try hardly to guess, but still can not find what it is using. yes, I think the doc may need to be fixed or another syscall is needed.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4CC803A8.3040602>