0

hello everyone!
i'm writing a program using linux environment and i'm curious about the use of
waitpid().i have searched the command on google but i'm not sure i understood the return values of the command. for example i want to use it as follows:

if(waitpid(-1,&status,WNOHANG )>0)
sum++;

where sum counts the processes that have finished.
i'm not sure if waitpid returns a positive value when a process is done
thanks in advance

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by Ancient Dragon
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.