On Thu, Nov 13, 2008 at 03:30, Michael Kerrisk <mtk.manpages@xxxxxxxxxxxxxx> wrote: > Hi Bert, > >>>> The argument >>>> .I cpusetsize >>>> is the length (in bytes) of the buffer pointed to by >>>> .IR cpuset . >>>> Normally this argument would be specified as >>>> .IR sizeof(cpu_set_t) . >>>> The constant >>>> .B CPU_SETSIZE >>>> specifies a value one greater than the >>>> maximum CPU number that can be stored in a CPU set. >>> >>> I came independently to the same conclusion than you. AFAICS,glibc defines >>> the cpu_set_t to be a 1024 bits long structure. But the kernel defines the >>> corresponding structure to be a bit field of appropriate length to store >>> NR_CPUS. >>> >>> Interesting enough, the exact size of the kernel structure is determined by >>> the glibc on the 1st call to pthread_setaffinity_np(). >>> >>> We'll run into troubles if run this on a server with more than 1K core ;-) >> Thats why glibc provides a new set of function to handle cpu_set_t >> with more than 1K bits. >> Look for the definitions of macros with a _S suffix in <sched.h>. > > Thanks for alerting me to this. Of course those macros need > documenting. I've pretty much completed a page documenting them. > Would you be willing to check it over? Sure. Bert > > Cheers, > > Michael > > -- > Michael Kerrisk > Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ > git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git > man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html > Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html > -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html