PPT Slide
Process Management SysCalls (sample)
Code sample with argument passing:
char *argb[3] = { “gcc”, “prog1.cc”, (char * ) 0 };
int pid1 = CreateProcess(“gcc”, 3, argb);
char *argv[3];
argv[0] = “pico”; argv[1] = “prog1.cc”;
argv[2] = (char *) NULL;
int pid2 = CreateProcess(“pico”, 3, argv);
int ret1 = Wait(pid1); // ret1= Exit() val from pid1
int ret2 = Wait(pid2); // ret2 = Exit() val from pid2
Exit(0);