Re: HOWTO hide a process.

Tigran Aivazian (tigran@btconnect.com)
Sun, 5 Aug 2001 16:21:00 +0100 (BST)


On Sun, 5 Aug 2001, Lukas Dobrek wrote:
> struct task_struct * task;
> task=find_task_by_pid(<pid>);
> task->pid=0;

no, don't do that. This is the correct way to do what you want:

/*
* Remove our kernel threads from ps listings.
*/
write_lock_irq(&tasklist_lock);
unhash_pid(current);
current->pidhash_pprev = &current->pidhash_next;
current->pidhash_next = NULL;
write_unlock_irq(&tasklist_lock);

Regards,
Tigran

-
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/