From owner-freebsd-net@FreeBSD.ORG Wed Dec 17 04:00:36 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9696106568B for ; Wed, 17 Dec 2008 04:00:36 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id C35818FC1A for ; Wed, 17 Dec 2008 04:00:36 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 3CAF11A3C3C; Tue, 16 Dec 2008 19:41:14 -0800 (PST) Date: Tue, 16 Dec 2008 19:41:14 -0800 From: Alfred Perlstein To: Ferner Cilloniz Message-ID: <20081217034114.GU18389@elvis.mu.org> References: <1229437998.4942.2.camel@mobiliare.Belkin> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1229437998.4942.2.camel@mobiliare.Belkin> User-Agent: Mutt/1.4.2.3i Cc: freebsd-net@freebsd.org Subject: Re: working directory within kernel code X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2008 04:00:36 -0000 * Ferner Cilloniz [081216 12:33] wrote: > I am trying to determine the current working directory when a system > call is issued. im interested in determining this from a kernel module. > > however, because system calls are only given a thread* and a void*, > which gets casted, is there any way i find out the cwd? thread should point to proc which should have a "current dir" vnode in it, or a pointer to a struct that has it... keep poking around. -Alfred