lkml.org 
[lkml]   [2004]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] use pid_alive in proc_pid_status
Manfred Spraul <manfred@colorfullife.com> wrote:
>
> +/**
> + * pid_alive - check that a task structure is not stale
> + * @p: Task structure to be checked.
> + *
> + * Test if a process is not yet dead (at most zombie state)
> + * If pid_alive fails, then pointers within the task structure
> + * can be stale and must not be dereferenced.
> + */
> +int pid_alive(struct task_struct *p)
> +{
> + return p->pids[PIDTYPE_PID].nr != 0;
> +}

Can we not simply test p->exit_state? That's already done in quite a few
places and making things consistent would be nice.

-
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-03-22 14:08    [W:0.068 / U:5.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site