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.

> 2011-08-03  Uros Bizjak  <ubiz...@gmail.com>
> 
>       * config/linux/proc.c (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: Call gomp_cpuset_popcount.
>       * libgomp.h (gomp_cpuset_popcount): Declare.
> 
> Bootstrapped on x86_64-pc-linux-gnu, testing in progress.
> 
> OK if it passes?

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.

        Jakub

Reply via email to