On Thu, Jul 07, 2016 at 10:52:01AM +0200, Riccardo Mottola wrote: > Hi, > > Gabriel Paubert wrote: > >>That is garbage in my opinion, given there exists a proper interface > >>>for getting that info. > >Seconded, getauxval (not getauxvec!) is simpler, officially supported > >for a long time, and while the intent is not to modify the format of > >/proc/cpuinfo in a way that would break existing uses, it is not set > >in stone. For a start, the /proc/cpuinfo format does not scale well to > >hundreds or thousands of cores/threads, and you could say the same of > >other /proc files, like /proc/interrupts. > > I wonder if you can have different cores? e.g. how is a Cell > processor seen in cpuinfo? Just out of curiosity.
The Cell SPU are separate processors, and are a different target architecture for the compiler. > > Anyway, I think the best of two worlds would be to use getauxval() > when available (most probably any currently supported OS) and fall > back to cpuinfo if not. A configure test I suppose is quite simple. You don't always configure/compile on the machine you run. Especially the people who build distributions. Gabriel