How about this:
#include <sys/sysinfo.h>
...
//nproc = get_nprocs(); // Available processors
nproc = get_nprocs_conf(); // Configured processors (some can be down...)
(glibc 2.2.5, but i think it keeps working since time ago).
BTW, why linux does not implement sysconf(_SC_NPROC_[CONF,ONLN]) ??
TIA
-- J.A. Magallon # Let the source be with you... mailto:jamagallon@able.es Mandrake Linux release 8.3 (Cooker) for i586 Linux werewolf 2.4.19-pre6-jam1 #1 SMP Sun Apr 7 00:50:05 CEST 2002 i686 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/