tahamajs's picture
download
raw
834 Bytes
// init: The initial user-level program
#include "types.h"
#include "stat.h"
#include "user.h"
#include "fcntl.h"
char *argv[] = { "sh", 0 };
int
main(void)
{
int pid, wpid;
if(open("console", O_RDWR) < 0){
mknod("console", 1, 1);
open("console", O_RDWR);
}
dup(0); // stdout
dup(0); // stderr
for(;;){
printf(1, "init: starting sh\n");
printf(1,"Group #29:\n");
printf(1,"Elaheh Khodaverdi\n");
printf(1,"Fereshteh Bagheri\n");
printf(1,"Atefeh Mirzakhani\n");
pid = fork();
if(pid < 0){
printf(1, "init: fork failed\n");
exit();
}
if(pid == 0){
change_scheduling_queue(getpid(), 1);
exec("sh", argv);
printf(1, "init: exec sh failed\n");
exit();
}
while((wpid=wait()) >= 0 && wpid != pid)
printf(1, "zombie!\n");
}
}

Xet Storage Details

Size:
834 Bytes
·
Xet hash:
f9688a6e113066f664fe6990ec4d74ba6388a5f85945bdfd977c8fa214a93b85

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.