summaryrefslogtreecommitdiffstats
path: root/perl-install/c/smp.c
diff options
context:
space:
mode:
authorStew Benedict <stewb@mandriva.org>2001-03-03 00:16:02 +0000
committerStew Benedict <stewb@mandriva.org>2001-03-03 00:16:02 +0000
commit348d706236d2bf7e09bc8214b657faef0b0a30c5 (patch)
treee043ef50e51de81b1fc2c670dae47865f272f812 /perl-install/c/smp.c
parentca30149eca5c7153676f70f8546736646a4343b9 (diff)
downloaddrakx-348d706236d2bf7e09bc8214b657faef0b0a30c5.tar
drakx-348d706236d2bf7e09bc8214b657faef0b0a30c5.tar.gz
drakx-348d706236d2bf7e09bc8214b657faef0b0a30c5.tar.bz2
drakx-348d706236d2bf7e09bc8214b657faef0b0a30c5.tar.xz
drakx-348d706236d2bf7e09bc8214b657faef0b0a30c5.zip
*** empty log message ***
Diffstat (limited to 'perl-install/c/smp.c')
-rw-r--r--perl-install/c/smp.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/perl-install/c/smp.c b/perl-install/c/smp.c
index 08b2b0a7c..e54cac62f 100644
--- a/perl-install/c/smp.c
+++ b/perl-install/c/smp.c
@@ -64,6 +64,35 @@ int sparcDetectSMP(void)
}
#endif /* __sparc__ */
+/* I'm sure this is not right - but don't know what to look for at
+this point - before adding this a machine that was definitely NOT
+SMP was identified as such Feb 12, 2001 sbenedict */
+
+#ifdef __powerpc__
+int ppcDetectSMP(void)
+{
+ int issmp = 0;
+ FILE *f;
+
+ f = fopen("/proc/cpuinfo", "r");
+ if (f) {
+ char buff[1024];
+
+ while (fgets (buff, 1024, f) != NULL) {
+ if (!strncmp (buff, "ncpus active\t: ", 15)) {
+ if (strtoul (buff + 15, NULL, 0) > 1)
+ issmp = 1;
+ break;
+ }
+ }
+ fclose(f);
+ } else
+ return -1;
+
+ return issmp;
+}
+#endif /* __powerpc__ */
+
#ifdef __i386__
#define SMP_MAGIC_IDENT (('_'<<24)|('P'<<16)|('M'<<8)|'_')
@@ -337,6 +366,8 @@ int detectSMP(void)
return isSMP = sparcDetectSMP();
#elif __alpha__
return isSMP = alphaDetectSMP();
+#elif __powerpc__
+ return isSMP = ppcDetectSMP();
#endif
}