[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111127173430.GB5674@redhat.com>
Date: Sun, 27 Nov 2011 18:34:30 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Konstantin Khlebnikov <khlebnikov@...nvz.org>
Cc: Pavel Emelyanov <xemul@...allels.com>, Tejun Heo <tj@...nel.org>,
Pedro Alves <pedro@...esourcery.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Cyrill Gorcunov <gorcunov@...nvz.org>,
James Bottomley <jbottomley@...allels.com>
Subject: Re: [RFC][PATCH 0/3] fork: Add the ability to create tasks with
given pids
On 11/27, Konstantin Khlebnikov wrote:
>
> We can add flag to sys_wait4(), and stash pid in wait_task_zombie(), right before release_task()
> code will looks something like this:
>
> - if (p != NULL)
> + if (p != NULL) {
> + if ((wo->wo_flags & WCATCHPID) && !current->pid_stash) {
> + struct pid *pid = task_pid(p);
> +
> + pid->flags |= PID_STASHED;
> + current->pid_stash = get_pid(pid);
> + }
> release_task(p);
> + }
>
> And next fork() creates child with the same pid.
> So, struct pid will work like boomerang =)
Like PR_RESERVE_PID, this can only help if the tracee (or whatever)
is single-threaded and it is the natural child.
Personally I do not think such a limited interface makes sense.
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists