24 |
#include <sys/types.h> |
#include <sys/types.h> |
25 |
#endif |
#endif |
26 |
|
|
27 |
|
#include <unistd.h> |
28 |
|
|
29 |
#ifdef HAVE_SYS_STAT_H |
#ifdef HAVE_SYS_STAT_H |
30 |
#include <sys/stat.h> |
#include <sys/stat.h> |
31 |
#endif |
#endif |
93 |
#ifdef LINUX |
#ifdef LINUX |
94 |
#include <asm/param.h> |
#include <asm/param.h> |
95 |
#include <asm/page.h> |
#include <asm/page.h> |
96 |
|
|
97 |
|
static int get_num_cpus(void); |
98 |
#endif |
#endif |
99 |
|
|
100 |
|
|
117 |
|
|
118 |
int init_process_info_sysdep(void) { |
int init_process_info_sysdep(void) { |
119 |
|
|
120 |
|
num_cpus= sysconf( _SC_NPROCESSORS_ONLN); |
121 |
|
|
122 |
return (getuid()==0); |
return (getuid()==0); |
123 |
|
|
124 |
} |
} |
202 |
int init_process_info_sysdep(void) { |
int init_process_info_sysdep(void) { |
203 |
|
|
204 |
struct stat buf; |
struct stat buf; |
205 |
|
|
206 |
|
|
207 |
/* I hope this is okay hack to get the total memsize. (-: */ |
/* I hope this is okay hack to get the total memsize. (-: */ |
208 |
|
|
212 |
|
|
213 |
} |
} |
214 |
|
|
215 |
|
num_cpus= sysconf(_SC_NPROCESSORS_CONF); |
216 |
|
|
217 |
mem_kbyte_max = buf.st_size>>10; |
mem_kbyte_max = buf.st_size>>10; |
218 |
|
|
219 |
return TRUE; |
return TRUE; |
220 |
|
|
221 |
} |
} |
222 |
|
|
223 |
|
|
224 |
int get_process_info_sysdep(ProcInfo_T p) { |
int get_process_info_sysdep(ProcInfo_T p) { |
225 |
|
|
226 |
char buf[4096]; |
char buf[4096]; |
385 |
|
|
386 |
} |
} |
387 |
|
|
388 |
|
num_cpus= sysconf(_SC_NPROCESSORS_CONF); |
389 |
|
|
390 |
kvm_handle = kvm_open(NULL, NULL, NULL, O_RDONLY, "monit"); |
kvm_handle = kvm_open(NULL, NULL, NULL, O_RDONLY, "monit"); |
391 |
|
|
392 |
if ( kvm_handle == NULL ) { |
if ( kvm_handle == NULL ) { |