/**************************************************************************** * gp.c - a simple process lister for AIX. Just dumps the contents of the * process table - no sort, no options. Works when "ps" is locking up due to * AIX bugs/full process table. * * pgibbs@trinem.co.uk ****************************************************************************/ #include #include main(int argc,char **argv) { struct procsinfo ProcessBuffer[10000]; pid_t Pid; long ProcCount; long k; short TitlePrinted=0; Pid=0; do { ProcCount=getprocs( ProcessBuffer, sizeof(struct procsinfo), (struct fdsinfo *)0, 0, &Pid, 10000); if (ProcCount && !TitlePrinted) { printf("pid ppid Process Name User System\n"); printf("----- ----- ------------ ---- ------\n"); TitlePrinted=1; } for (k=0;k