00001 #include "syscall.h"
00002
00003 int
00004 main()
00005 {
00006 SpaceId newProc;
00007 OpenFileId input = ConsoleInput;
00008 OpenFileId output = ConsoleOutput;
00009 char prompt[2], ch, buffer[60];
00010 int i;
00011
00012 prompt[0] = '-';
00013 prompt[1] = '-';
00014
00015 while( 1 )
00016 {
00017 Write(prompt, 2, output);
00018
00019 i = 0;
00020
00021 do {
00022
00023 Read(&buffer[i], 1, input);
00024
00025 } while( buffer[i++] != '\n' );
00026
00027 buffer[--i] = '\0';
00028
00029 if( i > 0 ) {
00030 newProc = Exec(buffer);
00031 Join(newProc);
00032 }
00033 }
00034 }
00035
The University of Southern California does not screen or control the content on this website and thus does not guarantee the accuracy, integrity, or quality of such content. All content on this website is provided by and is the sole responsibility of the person from which such content originated, and such content does not necessarily reflect the opinions of the University administration or the Board of Trustees