On Mar 29, 12:49 am, Ondrej Certik <ond...@certik.cz> wrote:
> I just tried the following code on several linuxes (Debian, Ubuntu,
> Gentoo, Red Hat, OpenSUSE) and on OS X 10.5 Intel and it seems to just
> work everywhere:
>
> #include "unistd.h"
> #include "stdio.h"
>
> int main()
> {
>     int ncpus;
>     ncpus = sysconf(_SC_NPROCESSORS_ONLN);
>     printf("%d", ncpus);
>     return 0;
>
> }

This is the best way.  I am using sysconf on POSIX systems now.
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to