/[monit]/monit/process/sysdep.c
ViewVC logotype

Diff of /monit/process/sysdep.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by rory, Fri Sep 27 01:56:29 2002 UTC revision 1.7 by chopp, Mon Oct 28 15:22:15 2002 UTC
# Line 24  Line 24 
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
# Line 91  Line 93 
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    
# Line 113  Line 117 
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  }  }
# Line 196  static long mem_kbyte_max; Line 202  static long mem_kbyte_max;
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    
# Line 205  int init_process_info_sysdep(void) { Line 212  int init_process_info_sysdep(void) {
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];
# Line 375  int init_process_info_sysdep(void) { Line 385  int init_process_info_sysdep(void) {
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 ) {

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26