projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
2004-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git]
/
mono
/
io-layer
/
system.c
diff --git
a/mono/io-layer/system.c
b/mono/io-layer/system.c
index 55e3cdd08dbf07b21c1b9f462d90e7ced7719c26..3a336ce2cef01900d3fb83eddf3235c52bac392a 100644
(file)
--- a/
mono/io-layer/system.c
+++ b/
mono/io-layer/system.c
@@
-1,3
+1,12
@@
+/*
+ * system.c: System information
+ *
+ * Author:
+ * Dick Porter (dick@ximian.com)
+ *
+ * (C) 2002 Ximian, Inc.
+ */
+
#include <config.h>
#include <glib.h>
#include <sys/time.h>
#include <config.h>
#include <glib.h>
#include <sys/time.h>
@@
-11,7
+20,13
@@
void GetSystemInfo(WapiSystemInfo *info)
info->dwPageSize=getpagesize();
/* Fill in the rest of this junk. Maybe with libgtop */
info->dwPageSize=getpagesize();
/* Fill in the rest of this junk. Maybe with libgtop */
- info->dwNumberOfProcessors=1;
+#ifdef _SC_NPROCESSORS_ONLN
+ info->dwNumberOfProcessors = sysconf (_SC_NPROCESSORS_ONLN);
+ if (info->dwNumberOfProcessors <= 0)
+ info->dwNumberOfProcessors = 1;
+#else
+ info->dwNumberOfProcessors = 1;
+#endif
}
}