This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Wed, Aug 3, 2011 at 11:11 AM, Jakub Jelinek <jakub@redhat.com> wrote: > On Wed, Aug 03, 2011 at 10:36:47AM +0200, Uros Bizjak wrote: >> We should not call CPU_COUNT when not defined in glibc. > > Oops, forgot that old glibcs don't have it. > I don't like the prototype in libgomp.h, for one sched.h isn't included > in libgomp.h thus cpu_set_t is not defined type. ?Plus it isn't a generic > API, but a Linux private function. > So, IMHO either just don't provide any prototype in a header > and put > extern unsigned long gomp_cpuset_popcount (cpu_set_t *); > into config/linux/affinity.c, or introduce > config/linux/proc.h header containing > #include <sched.h> > #ifdef HAVE_PTHREAD_AFFINITY_NP > extern unsigned long gomp_cpuset_popcount (cpu_set_t *); > #endif > and > #include "config/linux/proc.h" > in config/linux/{proc.c,affinity.c}. > Ok with those changes, thanks. Attached is the patch that was committed to SVN. 2011-08-03 Uros Bizjak <ubizjak@gmail.com> * config/linux/proc.h: New. * config/linux/proc.c: Include "proc.h". Do not include <sched.h>. (gomp_cpuset_popcount): Rename from cpuset_popcount. No more static. (gomp_init_num_threads): Update call to cpuset_popcount. (get_num_procs): Ditto. * config/linux/affinity.c (gomp_init_affinity): Call gomp_cpuset_popcount. Tested on x86_64-pc-linux-gnu {,-m32}, committed to mainline SVN. Uros.
Attachment:
g.diff.txt
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |