[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:

> Hej med jer
> 
> Hvordan er det muligt at finde ud af når en 'child process' dør, uden at
> man behøver at kalde 'waitpid' konstandt? Det jeg kunne finde med 'man'
> 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?

Ved at bruge sigaction(2) og flaget SA_SIGINFO. Når du gør det kan du
bruge en anderledes signatur til din signal håndtering, der bl.a. gør
at du får en struct siginfo_t * med som argument, der bl.a. indeholder
pid på afsenderen af signalet.
 
-- 
Christian Hemmingsen


 
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] *