On Sat, Feb 19, 2011 at 3:24 PM, Tavian Barnes <[email protected]> wrote: > On 19 February 2011 06:28, Nezmer <[email protected]> wrote: >> Actually, The sysconf() method works at least in FreeBSD and the man page >> says the sysconf interface is defined by POSIX.1 > > The sysconf() interface is specified by POSIX.1, but > _SC_NPROCESSORS_ONLN is a non-standard extension. > >>> You can look at how x264 guys implemented this. Check out >>> x264_cpu_num_processors() in common/cpu.c in their source tree. > > Seems to be basically a more platform-complete version of what I'm > doing here [1]. But yeah, we'd need something like that if pacman is > supposed to run on everything unix-based. I don't imagine we care > much about Windows compatibility :)
Take a look at git; it has plenty of code that has been tested for doing this and it works just fine on Windows. -Dan
