Re: process with socket

From: Jan Engelhardt
Date: Mon Oct 25 2004 - 05:54:59 EST


>Hi,
> I am working on UNIX Network Programming (sockets programming in C). My
>problem is I do not know how to identify whether a process in Linux kernel has
>a socket. Because so many different processes in Linux kernel are running, a
>process forks many child processes and forms a process tree. I want to
>identify a process that has socket and saves state data about it. Then saves
>the same data about his parent process and walks up the process tree by
>repeating this procedure until a process with PID 0 is reached. But I do not
>know how to identify if a process has a socket.

This might give you a start:

$ find /proc -type s

or

$ ls -Rl /proc/[0-9]* | grep ^s



Jan Engelhardt
--
Gesellschaft für Wissenschaftliche Datenverarbeitung
Am Fassberg, 37077 Göttingen, www.gwdg.de
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/