Date: Tue, 02 Mar 2004 12:28:44 +0100 From: grinder <grinder@pro.hu> To: freebsd-hackers@freebsd.org Subject: Re: Re: Sockets and the owner process Message-ID: <E1Ay84q-0002Kt-00@wakumbi.prim.hu>
next in thread | raw e-mail | index | archive | help
> The best you can hope for is to determine processes that are actually > using the socket, and that can vary during the socket's lifetime. You > would have to scour the file descriptor tables in all process > structures to determine which processes had a handle on each socket you > have an interest in. I found that too your solution is the only way. But i have a problem with that. The proc structure has a variable: struct vnode *p_tracep; This is a pointer to the vnode list, so this is good for me, if i can walk through the opened vnode list for a process. But how can i find out which process opened that vnode and how can i walk through the opened vnode list (for one specified process)? As i see the vnode struct has multiple variables with vnode pointer type: struct vnode { ... TAILQ_ENTRY(vnode) v_freelist; /* vnode freelist */ TAILQ_ENTRY(vnode) v_nmntvnodes; /* vnodes for mount point */ LIST_ENTRY(vnode) v_synclist; /* vnodes with dirty buffers */ ... struct vnode *v_dd; /* .. vnode */ ... }; Which way is good for me if i would like to walk through the list (so which is a pointer to the next vnode item)? Thanks, Tibor Kiss
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1Ay84q-0002Kt-00>