lkml.org 
[lkml]   [2005]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: disowning a process
From
Date
On Fri, 2005-05-27 at 13:55 -0500, Davy Durham wrote:
> Cool.. I looked at the daemon function and I might be able to use it..
>
> However, I compiled your code... seems to work.. but where is the wait()
> done on the middle parrent so that it isn't left defunct?

Sorry, forgot about that...
[...]

> >
> >/* parent code here */

waitpid(pid,&status,0);

/* and then you can look at WEXITSTATUS(status) to
see if the second fork succeeded. */
if (WEXITSTATUS(status)) {
/* failed */
} else {
/* succeeded */
}

/* Here the second child and parent are now divorced */


-- Steve


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-05-27 21:13    [W:0.044 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site