lkml.org 
[lkml]   [2011]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.



\
 
 \ /
  Last update: 2011-11-27 18:41    [W:0.202 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site