add the feature to start elf-files

This commit is contained in:
Marian Ohligs 2011-05-24 18:54:53 +02:00
parent 6ba32a14b5
commit af0728a57d
2 changed files with 6 additions and 6 deletions

Binary file not shown.

View file

@ -28,6 +28,7 @@ int main(int argc, char** argv)
system("clear");
showlogo();
while(1) {
printf("$ ");
size = scanf("%s", command);
if(!strcmp(command, "exit")) {
return 0;
@ -35,17 +36,16 @@ int main(int argc, char** argv)
if(!strcmp(command, "help")) {
help();
} else {
//pid = fork();
//if (pid == 0) { //child
pid = fork();
if (pid == 0) { //child
char* newargv[] = {command, NULL};
char* newenv[] = {"USER=root", "PATH=/bin:/sbin:/usr/bin", "PWD=/", "TEMP=/tmp", NULL};
execve(command, newargv, newenv);
return errno;
//} else {
// wait(&status);
// printf("Beendet");
//}
} else {
wait(&status);
}
}
}
return errno;