2010-10-17 21:50:55 +02:00
|
|
|
|
|
|
|
int cmd_ps(char param[])
|
|
|
|
{
|
|
|
|
|
|
|
|
int i, n;
|
|
|
|
char *buf1k;
|
|
|
|
unsigned PID;
|
|
|
|
short STATE;
|
|
|
|
|
|
|
|
buf1k = malloc(1024);
|
|
|
|
if (NULL == buf1k)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
for (i = 1;;i++)
|
|
|
|
{
|
|
|
|
n = kol_process_info(i, buf1k);
|
2012-03-23 19:53:16 +01:00
|
|
|
PID = *(buf1k+30);
|
|
|
|
STATE = *(buf1k+50);
|
2010-10-17 21:50:55 +02:00
|
|
|
if ( 9 != STATE)
|
|
|
|
printf (" %7d %s\n\r", PID, buf1k+10);
|
|
|
|
if (i == n)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
free(buf1k);
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
}
|