Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mutexes and flags
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 413

PostPosted: Wed Oct 18, 2023 9:36 pm    Post subject: mutexes and flags Reply with quote

forum hello again. please tell me how in the parent process can I know for sure that the child process is now completed? which flag or mutex in fork() reflects this? from where in fork() can I read this?
Back to top
View user's profile Send private message
salahx
Guru
Guru


Joined: 12 Mar 2005
Posts: 559

PostPosted: Wed Oct 18, 2023 9:55 pm    Post subject: Reply with quote

The parent process will get SIGCHLD when the child process ends. The parent then needs to call one of the flavors of wait() on it to clean up after it.
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 413

PostPosted: Wed Oct 18, 2023 10:30 pm    Post subject: Reply with quote

salahx wrote:
The parent process will get SIGCHLD when the child process ends. The parent then needs to call one of the flavors of wait() on it to clean up after it.



how to process it? how to read it to understand that the child process is completed? what SIGCHLD should it contain ?
Back to top
View user's profile Send private message
salahx
Guru
Guru


Joined: 12 Mar 2005
Posts: 559

PostPosted: Thu Oct 19, 2023 1:52 am    Post subject: Reply with quote

You would install a signal handler (with sigaction) for SIGCHLD in the parent. See the man pages for sigaction() and wait() for some examples.
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 413

PostPosted: Thu Oct 19, 2023 12:14 pm    Post subject: Reply with quote

salahx wrote:
You would install a signal handler (with sigaction) for SIGCHLD in the parent. See the man pages for sigaction() and wait() for some examples.


we've already figured it out. thank you forum, you provide great support
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum