How to use pfind in freeBSD

Rodrigo OSORIO rodrigo at bebik.net
Fri Mar 16 09:08:31 UTC 2012


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 at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at 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 


More information about the freebsd-hackers mailing list