3a336ce2cef01900d3fb83eddf3235c52bac392a
[mono.git] / mono / io-layer / system.c
1 /*
2  * system.c:  System information
3  *
4  * Author:
5  *      Dick Porter (dick@ximian.com)
6  *
7  * (C) 2002 Ximian, Inc.
8  */
9
10 #include <config.h>
11 #include <glib.h>
12 #include <sys/time.h>
13 #include <stdlib.h>
14 #include <unistd.h>
15
16 #include "mono/io-layer/wapi.h"
17
18 void GetSystemInfo(WapiSystemInfo *info)
19 {
20         info->dwPageSize=getpagesize();
21
22         /* Fill in the rest of this junk. Maybe with libgtop */
23 #ifdef _SC_NPROCESSORS_ONLN
24         info->dwNumberOfProcessors = sysconf (_SC_NPROCESSORS_ONLN);
25         if (info->dwNumberOfProcessors <= 0)
26                 info->dwNumberOfProcessors = 1;
27 #else
28         info->dwNumberOfProcessors = 1;
29 #endif
30 }
31
32