unlikely(p->state > TASK_STOPPED)) 
unlikely(p->state & TASK_TRACED)) 
static int wait_task_stopped(task_t *p, int delayed_group_leader, int noreap,			     struct siginfo __user *infop,			     int __user *stat_addr, struct rusage __user *ru){	int retval, exit_code;	if (!p->exit_code)		return 0;	if (delayed_group_leader && !(p->ptrace & PT_PTRACED) &&	    p->signal && p->signal->group_stop_count > 0)		/*		 * A group stop is in progress and this is the group leader.		 * We won't report until all threads have stopped.		 */		return 0;	/*	 * Now we are pretty sure this task is interesting.	 * Make sure it doesn't get reaped out from under us while we	 * give up the lock and then examine it below.  We don't want to	 * keep holding onto the tasklist_lock while we call getrusage and	 * possibly take page faults for user memory.	 */	get_task_struct(p);	read_unlock(&tasklist_lock);	if (unlikely(noreap)) {		pid_t pid = p->pid;		uid_t uid = p->uid;		int why = (p->ptrace & PT_PTRACED) ? CLD_TRAPPED : CLD_STOPPED;		exit_code = p->exit_code;		if (unlikely(!exit_code) ||		    unlikely(p->state > TASK_STOPPED))			goto bail_ref;		return wait_noreap_copyout(p, pid, uid,					   why, (exit_code << 8) | 0x7f,					   infop, ru);	}	write_lock_irq(&tasklist_lock);	/*	 * This uses xchg to be atomic with the thread resuming and setting	 * it.  It must also be done with the write lock held to prevent a	 * race with the EXIT_ZOMBIE case.	 */	exit_code = xchg(&p->exit_code, 0);	if (unlikely(p->exit_state)) {		/*		 * The task resumed and then died.  Let the next iteration		 * catch it in EXIT_ZOMBIE.  Note that exit_code might		 * already be zero here if it resumed and did _exit(0).		 * The task itself is dead and won't touch exit_code again;		 * other processors in this function are locked out.		 */		p->exit_code = exit_code;		exit_code = 0;	}	if (unlikely(exit_code == 0)) {		/*		 * Another thread in this function got to it first, or it		 * resumed, or it resumed and then died.		 */		write_unlock_irq(&tasklist_lock);bail_ref:		put_task_struct(p);		/*		 * We are returning to the wait loop without having successfully		 * removed the process and having released the lock. We cannot		 * continue, since the "p" task pointer is potentially stale.		 *		 * Return -EAGAIN, and do_wait() will restart the loop from the		 * beginning. Do _not_ re-acquire the lock.		 */		return -EAGAIN;	}	/* move to end of parent's list to avoid starvation */	remove_parent(p);	add_parent(p, p->parent);	write_unlock_irq(&tasklist_lock);	retval = ru ? getrusage(p, RUSAGE_BOTH, ru) : 0;	if (!retval && stat_addr)		retval = put_user((exit_code << 8) | 0x7f, stat_addr);	if (!retval && infop)		retval = put_user(SIGCHLD, &infop->si_signo);	if (!retval && infop)		retval = put_user(0, &infop->si_errno);	if (!retval && infop)		retval = put_user((short)((p->ptrace & PT_PTRACED)					  ? CLD_TRAPPED : CLD_STOPPED),				  &infop->si_code);	if (!retval && infop)		retval = put_user(exit_code, &infop->si_status);	if (!retval && infop)		retval = put_user(p->pid, &infop->si_pid);	if (!retval && infop)		retval = put_user(p->uid, &infop->si_uid);	if (!retval)		retval = p->pid;	put_task_struct(p);	BUG_ON(!retval);	return retval;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/14bf01bb0599c89fc7f426d20353b76e12555308/exit.c/buggy/kernel/exit.c