

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


COMP755 Advanced Operating Systems
do forever { print prompt; read command; if (fork()==0) { // child process use exec() to load program; } wait for child process to terminate; }
int _execv( const char * cmdname , const char * argv[ ] ); where:
int main ( int argc, char *argv[] ) { ... return 5; } The argv array passed to the main function when you start a C programs is the argv array passed to execv by the shell.
Process::Start(S“myprog.exe");
This is a Microsoft Foundation Class object.
When a program is started, it has three I/O streams open: 0 stdin – Standard input, usually keyboard 1 stdout – Standard output, usually screen 2 stderr – Standard error, usually screen
Standard I/O streams can be redirected from the command line ls > myfile.txt myprog < usualstuff.txt cc nogood.c >& allmsg.txt