Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Dong Hung Pham
Betriebssystem Mi2X
Commits
76db2ea7
Commit
76db2ea7
authored
Dec 02, 2020
by
Dong Hung Pham
🤡
Browse files
Update prak2.cpp
parent
3e026e59
Changes
1
Hide whitespace changes
Inline
Side-by-side
prak2.cpp
View file @
76db2ea7
...
...
@@ -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.
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment