lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 11 Jul 2011 22:16:30 +0200
From:	Jiri Slaby <jirislaby@...il.com>
To:	loody <miloody@...il.com>
CC:	linux-kernel@...r.kernel.org
Subject: Re: how to find a task through name faster?

On 07/11/2011 06:52 PM, loody wrote:
> hi all:
> I found a way to find a task I need by name, test,  as below:
> for_each_process(task) {
>     if(strcmp(task->comm, "test")
>         printk(ā€œ%s[%d]\nā€, task->comm, task->pid);
> }
> 
> But it is time-consuming to do so if I periodically want to know
> whether "test" exist or not.
> is there better way to do so?

It depends on what you are trying to achieve. Maybe process accounting
is what you want?

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ