[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2] xl: track child processes for the benefit of libxl



On Tue, 2012-05-22 at 12:17 +0100, Ian Jackson wrote:
> Ian Campbell writes ("Re: [PATCH v2] xl: track child processes for the 
> benefit of libxl"):
> > On Fri, 2012-05-18 at 19:25 +0100, Ian Jackson wrote:
> > > +pid_t xl_waitpid(xlchildnum child, int *status, int flags)
> > > +{
> > > +    xlchild *ch = &children[child];
> > > +    pid_t got = ch->pid;
> > > +    assert(got);
> > > +    if (ch->reaped) {
> > > +        *status = ch->status;
> > > +        ch->pid = 0;
> > > +        return got;
> > > +    }
> > > +    for (;;) {
> > > +        got = waitpid(ch->pid, status, flags);
> > 
> > Is it always the case that xl has at most one child?
> 
> I don't think it is necessarily the case.
> 
> > Because if not then we may reap the wrong one here.
> 
> No, the whole point of waitpid is that you get to specify which child
> to reap.  Unless I'm missing something ?

No I was, for some reason I thought we were waiting for any child here.
You can safely ignore this comment ;-)

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.