From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 16 09:08:31 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9060E106566C for ; Fri, 16 Mar 2012 09:08:31 +0000 (UTC) (envelope-from rodrigo@bebik.net) Received: from smtp3-g21.free.fr (smtp3-g21.free.fr [IPv6:2a01:e0c:1:1599::12]) by mx1.freebsd.org (Postfix) with ESMTP id C67E08FC18 for ; Fri, 16 Mar 2012 09:08:28 +0000 (UTC) Received: from oldfaithful.bebik.local (unknown [82.227.164.69]) by smtp3-g21.free.fr (Postfix) with ESMTP id 8DFD1A6227 for ; Fri, 16 Mar 2012 10:08:23 +0100 (CET) Received: by oldfaithful.bebik.local (Postfix, from userid 1001) id 5DF482F188; Fri, 16 Mar 2012 10:13:27 +0100 (CET) Date: Fri, 16 Mar 2012 10:13:27 +0100 From: Rodrigo OSORIO To: freebsd-hackers@freebsd.org Message-ID: <20120316091327.GA27873@oldfaithful.bebik.local> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Subject: Re: How to use pfind in freeBSD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2012 09:08:31 -0000 On 16/03/12 12:39 +0530, kota saikrishna wrote: > I need to get process data structure using a pid. I found the pfind > function which returns struct proc * but when i tried to use pfind > function it is showing ---undefined reference to `pfind' > Can any one suggest how to use pfind() function? > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" Hi, pfind and friends looks like kernel only function. I can suggest you to explore the sysctl(3) way to recover the kern.proc structures. There are fexw examples on the internet, you can check a code I wrote few years ago to recover the battery state in my laptop using sysctl ; hope this help. http://www.bebik.net/doku.php/battery_life_and_sysctl_3 Regards, Rodrigo