Commit 76db2ea7 authored by Dong Hung Pham's avatar Dong Hung Pham 🤡
Browse files

Update prak2.cpp

parent 3e026e59
......@@ -86,15 +86,12 @@ void loop(void){
} else {
// Parent process
if (background){//parent process because pid bigger than 0
do {
wpid = waitpid(pid, &status, WUNTRACED);
}while (!WIFEXITED(status) && !WIFSIGNALED(status));
}
else{
do {
wpid = waitpid(pid, &status, WNOHANG);
//wpid = waitpid(pid, &status, WNOHANG);
printf("%ld Started\n",pid);
}while (!WIFEXITED(status) && !WIFSIGNALED(status));
}
}
}
......@@ -122,6 +119,7 @@ ps ax: https://man7.org/linux/man-pages/man1/ps.1.html
trasdasd: Hier wird error ausgeben weil execvp() = -1 ist.
Die einzige Aenderung die ich bemerke ist, dass das alte "ps ax" schon aus der Tabelle gelöscht wurde.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment