From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 2 03:28:47 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CAD0216A4CE for ; Tue, 2 Mar 2004 03:28:47 -0800 (PST) Received: from jam.adverticum.net (jam.adverticum.net [195.228.75.77]) by mx1.FreeBSD.org (Postfix) with ESMTP id 19B2A43D3F for ; Tue, 2 Mar 2004 03:28:47 -0800 (PST) (envelope-from grinder@pro.hu) Received: from wakumbi.prim.hu (wakumbi.prim.hu [195.228.75.115]) by jam.adverticum.net (Postfix) with ESMTP id E9E8BAB1EE for ; Tue, 2 Mar 2004 12:28:44 +0100 (CET) Received: from www-data by wakumbi.prim.hu with local (Exim 3.35 #1 (Debian)) id 1Ay84q-0002Kt-00 for ; Tue, 02 Mar 2004 12:28:44 +0100 Received: from gprs4.vodafone.hu [80.244.96.196] by www-data with webmail (PrimPosta); Tue, Mar 2 12:28:44 2004 +0100 (CET) From: grinder To: freebsd-hackers@freebsd.org Errors-To: grinder@pro.hu X-Sender: grinder@pro.hu MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 8bit X-Mailer: PrimPosta Sender: grinder@pro.hu Message-Id: Date: Tue, 02 Mar 2004 12:28:44 +0100 Subject: Re: Re: Sockets and the owner process X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: grinder List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2004 11:28:47 -0000 > 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