/*****************************************************************************/ /* Copyright (c) 1998, David Paquet. All rights reserved. */ /* This file is free software; you can redistribute it and/or modify it */ /* under the same terms as Perl itself. */ /*****************************************************************************/ #include "os/aix.h" char* OS_initialize() { struct CuAt* obj; int how_many; Sysmem = 0; /* * Get the real memory size via ODM * */ if (odm_initialize() == 0) { obj = (struct CuAt*)getattr ("sys0", "realmem", 0, &how_many); Sysmem = strtoull(obj->value, 0, 10); odm_terminate(); } else { printf("BIG PROLEM !\n"); } Sysmem = Sysmem * 1024; /* * Get The number of processors * */ ProcessNumber = sysconf(_SC_NPROCESSORS_ONLN); if ( ProcessNumber == -1 ) { ProcessNumber = 1; } /* * Get the page size in bytes * */ PageSize = getpagesize(); return NULL; } void OS_get_table() { int i, proc_nb; struct procinfo pr_buff[MAX_PROCS]; struct userinfo uinfo; char format[F_FLAST + 1]; char wchan[15], pctcpu[7], pctmem[7], state[10]; char Args[MAXARGLN+1], Arglist[MAXARGLN+1], Comm[MAXARGLN+1]; int argcount; struct timeval now_tval; double utime, stime, cutime, cstime, now; strcpy(format, Fullformat); proc_nb = getproc(pr_buff, MAX_PROCS, sizeof(struct procinfo)); gettimeofday(&now_tval, (void *)NULL); now = (double)now_tval.tv_sec + (double) now_tval.tv_usec / 1000000.0; for(i=0; i