diff options
author | Mystery Man <unknown@mandriva.org> | 2005-04-04 19:00:13 +0000 |
---|---|---|
committer | Mystery Man <unknown@mandriva.org> | 2005-04-04 19:00:13 +0000 |
commit | ff340ae492915a1723450c148641b594326c5fd8 (patch) | |
tree | 3ddaf354b14099899888a5a4c65a2bbbe5d5c3af /mdk-stage1/dietlibc/libcruft/sysconf_cpus.c | |
parent | eb8a0c458d1d40e8aaaa00753fcef8cff968c277 (diff) | |
download | drakx-backup-do-not-use-ff340ae492915a1723450c148641b594326c5fd8.tar drakx-backup-do-not-use-ff340ae492915a1723450c148641b594326c5fd8.tar.gz drakx-backup-do-not-use-ff340ae492915a1723450c148641b594326c5fd8.tar.bz2 drakx-backup-do-not-use-ff340ae492915a1723450c148641b594326c5fd8.tar.xz drakx-backup-do-not-use-ff340ae492915a1723450c148641b594326c5fd8.zip |
This commit was manufactured by cvs2svn to create tag 'V10_2_19mdk'.V10_2_19mdk
Diffstat (limited to 'mdk-stage1/dietlibc/libcruft/sysconf_cpus.c')
-rw-r--r-- | mdk-stage1/dietlibc/libcruft/sysconf_cpus.c | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/mdk-stage1/dietlibc/libcruft/sysconf_cpus.c b/mdk-stage1/dietlibc/libcruft/sysconf_cpus.c deleted file mode 100644 index b5361d0a4..000000000 --- a/mdk-stage1/dietlibc/libcruft/sysconf_cpus.c +++ /dev/null @@ -1,64 +0,0 @@ -#include <unistd.h> -#include <string.h> -#include <fcntl.h> -#include <errno.h> -#include "dietfeatures.h" - -/* - * by Olaf Dreesen - * - * arm NO SMP ?!? (return 1) - * - * alpha -> cpus detected\t\t: <nr>\n - * sparc -> ncpus active\t: <nr>\n - * - * default -> processor\t: <cpunr>\n (one per cpu) - */ - -#ifdef SLASH_PROC_OK -int __sc_nr_cpus(void); -int __sc_nr_cpus() { -#if defined(__arm__) - return 1; -#else - int fd; - fd = open("/proc/cpuinfo", O_RDONLY); - if (fd==-1) return 1; /* fallback if no proc-fs mounted */ - else { - int n,nr=0; - char buf[2048]; /* holds ~6 cpuinfos */ - - while((n=read(fd,buf,sizeof(buf)))>0) { - register int i=0; - while (i<n) { -#if defined(__alpha__) - if ((buf[i]=='c')&&(!memcmp(buf+i,"cpus detected",13))) { - i+=17; - nr=atoi(buf+i); - break; - } -#elif defined(__sparc__) - if ((buf[i]=='n')&&(!memcmp(buf+i,"ncpus active",12))) { - i+=15; - nr=atoi(buf+i); - break; - } -#else /* DEFAULT */ - if ((buf[i]=='p')&&(!memcmp(buf+i,"processor",9))) { - ++nr; - i+=9; - } -#endif - while(buf[i++]!='\n'); /* skip rest of line */ - } - } - close(fd); - return nr; - } -#endif -} -#else -int __sc_nr_cpus() { - return 1; /* kludge kludge ;-) */ -} -#endif |