mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-11-24 01:39:35 +03:00
SHELL:
- Added new API: SC_GET_PID - Fixed data type pid - unsigned int. - Fixed cmd_ps output pid; git-svn-id: svn://kolibrios.org@8633 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
504bda29b5
commit
1a73ba1001
@ -18,13 +18,13 @@ printf (" PID NAME RAM KB\n\r", PID, buf1k+10);
|
||||
for (i = 1;;i++)
|
||||
{
|
||||
n = kol_process_info(i, buf1k);
|
||||
PID = *(buf1k+30);
|
||||
STATE = *(buf1k+50);
|
||||
memcpy(&PID, buf1k+30 ,sizeof(unsigned));
|
||||
STATE = *(buf1k+50);
|
||||
if (9 != STATE)
|
||||
{
|
||||
if (!sel || 0 == strnicmp(param, buf1k+10, 10))
|
||||
{
|
||||
printf (" %7d %11s %d\n\r", PID, buf1k+10, (*(int*)(buf1k+26)+1)/1024);
|
||||
printf (" %7u %11s %d\n\r", PID, buf1k+10, (*(int*)(buf1k+26)+1)/1024);
|
||||
if (sel)
|
||||
{
|
||||
LAST_PID = PID;
|
||||
|
@ -7,6 +7,7 @@ int program_console(int pid)
|
||||
|
||||
char name[32];
|
||||
char *buffer;
|
||||
char *buf1k;
|
||||
int result;
|
||||
int i;
|
||||
char command;
|
||||
@ -17,7 +18,7 @@ itoa(pid, name);
|
||||
strcat(name, "-SHELL");
|
||||
|
||||
buffer = NULL;
|
||||
|
||||
buf1k = NULL;
|
||||
|
||||
for (i = 0; i < 30; i++)
|
||||
{
|
||||
@ -41,7 +42,6 @@ for (i = 0; i < 30; i++)
|
||||
|
||||
switch (command)
|
||||
{
|
||||
|
||||
case SC_EXIT:
|
||||
*buffer = SC_OK;
|
||||
is_end = 1;
|
||||
@ -64,8 +64,8 @@ for (i = 0; i < 30; i++)
|
||||
case SC_PUTS:
|
||||
printf("%s", buffer+1 );
|
||||
*buffer = SC_OK;
|
||||
break;
|
||||
|
||||
break;
|
||||
|
||||
case SC_GETC:
|
||||
*(buffer+1) = (char) getch() ;
|
||||
*buffer = SC_OK;
|
||||
@ -75,7 +75,15 @@ for (i = 0; i < 30; i++)
|
||||
gets(buffer+1, size-2);
|
||||
*buffer = SC_OK;
|
||||
break;
|
||||
|
||||
|
||||
case SC_GET_PID:
|
||||
buf1k=malloc(1024);
|
||||
kol_process_info(-1, buf1k);
|
||||
memcpy(buffer+1, buf1k+30, sizeof(unsigned));
|
||||
*buffer = SC_OK;
|
||||
free(buf1k);
|
||||
break;
|
||||
|
||||
default:
|
||||
#if LANG_ENG
|
||||
printf (" Error in console application.\n\r");
|
||||
|
@ -6,3 +6,4 @@
|
||||
#define SC_GETC 4
|
||||
#define SC_GETS 5
|
||||
#define SC_CLS 6
|
||||
#define SC_GET_PID 7
|
||||
|
Loading…
Reference in New Issue
Block a user