Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Mar 2012 10:13:27 +0100
From:      Rodrigo OSORIO <rodrigo@bebik.net>
To:        freebsd-hackers@freebsd.org
Subject:   Re: How to use pfind in freeBSD
Message-ID:  <20120316091327.GA27873@oldfaithful.bebik.local>
In-Reply-To: <CAB%2BEr%2B==aBhi5eizXOjDQThi=VD%2B1z%2Bvr4jjos0-FbZg00W=8Q@mail.gmail.com>
References:  <CAB%2BEr%2B==aBhi5eizXOjDQThi=VD%2B1z%2Bvr4jjos0-FbZg00W=8Q@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120316091327.GA27873>