/[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.3 by rory, Wed Sep 11 01:53:34 2002 UTC revision 1.4 by rory, Wed Sep 11 23:00:09 2002 UTC
# Line 364  int init_process_info_sysdep(void) { Line 364  int init_process_info_sysdep(void) {
364      { 0 }      { 0 }
365    };    };
366    
367      kvm_handle = kvm_open(NULL, NULL, NULL, O_RDONLY, "monit");
   kvm_handle = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open");  
368    
369    if ( kvm_handle == NULL ) {    if ( kvm_handle == NULL ) {
370    
# Line 376  int init_process_info_sysdep(void) { Line 375  int init_process_info_sysdep(void) {
375    /* ----------------------------- INIT MEM -----------------------------*/    /* ----------------------------- INIT MEM -----------------------------*/
376    /* Got it from libgtop/sysdep/freebsd/mem.c */    /* Got it from libgtop/sysdep/freebsd/mem.c */
377    
378      /* Initialize nlist structure */
379      if (kvm_nlist (kvm_handle, nlst) < 0)
380      {
381        return FALSE;
382      }
383    
384    /* get the page size with "getpagesize" and calculate pageshift    /* get the page size with "getpagesize" and calculate pageshift
385     * from it */     * from it */
386    
387    pagesize = getpagesize ();    pagesize = getpagesize ();
388    pageshift = 0;    pageshift = 0;
389    while (pagesize > 1) {    while (pagesize > 1) {
# Line 386  int init_process_info_sysdep(void) { Line 392  int init_process_info_sysdep(void) {
392      pagesize >>= 1;      pagesize >>= 1;
393    
394    }    }
395      
396    /* we only need the amount of log(2)1024 for our conversion */    /* we only need the amount of log(2)1024 for our conversion */
397    pageshift -= LOG1024;    pageshift -= LOG1024;
398    
399    /* Get the data from kvm_* */    /* Get the data from kvm_* */
400    if (kvm_read (kvm_handle, nlst[1].n_value,    if (kvm_read (kvm_handle, nlst[1].n_value,
401                  &vmm, sizeof (vmm)) != sizeof (vmm)) {                  &vmm, sizeof (vmm)) != sizeof (vmm)) {
   
402      return FALSE;      return FALSE;
403    
404    }    }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

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