[runtime] Use getrlimit () to obtain the size of the fd table instead of getdtablesiz...
[mono.git] / mono / io-layer / system.c
index 1cedb180644bd46100efe7a1b484fd48d4d0d95d..3a336ce2cef01900d3fb83eddf3235c52bac392a 100644 (file)
@@ -20,7 +20,13 @@ void GetSystemInfo(WapiSystemInfo *info)
        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
 }