[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] signaler og SIGCHILD



Anders Larsen <sslug@sslug> writes:

> fortæller at der vil bliver sendt et SIGCHILD signal når det sker. Men
> hvordan får man så fat i 'barnets' pid, så man kan indsamle returnerings
> værdigen?

Du kan eventuelt lade din handler for SIGCHLD gøre noget ala følgende:

voin handle_sigchld(int signum) {
    int* status;
    pid_t pid;

    /* Collect all terminated childrens */
    while(pid = waitpid(-1, status, WNOHANG) {}
} 

Det er ikke efterprøvet, og der skal måske også lige lidt ekstra
fejlhåndtering til.

-- 
 Peter Makholm     |    According to the hacker ethic, the meaning of life
 sslug@sslug |            is not Friday, but it is not Sunday either
 http://hacking.dk |                                      -- Peeka Himanen


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:09 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *