added nprocs.c and Makefile

git-svn-id: svn://anubis/misc/nprocs@85 bd8a9e45-a331-0410-811e-c64571078777
This commit is contained in:
josh committed 2008-12-06 18:30:48 +00:00
1 parent c0a23473e3
commit f189f5c08d
2 files changed
+19

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
all: nprocs
nprocs: nprocs.c
$(CC) -o $@ $<
clean:
-rm -f *.o *~ nprocs
+11
View File
@@ -0,0 +1,11 @@
#include <stdio.h>
#include <unistd.h> /* sysconf() */
int main(int argc, char * argv[])
{
int nprocs = sysconf(_SC_NPROCESSORS_CONF);
printf("Number of processors: %d\n", nprocs);
return 0;
}