In the last episode (Apr 08), Garrett Cooper said:
>       I'm trying to see whether it's possible to grab the list of
> files open from a kernel level on FreeBSD, using a userland library
> interface as opposed to lsof.
>       I'm trying to see if there's a simple tool that I could code in
> C/C++ if necessary to spin down disks automatically to save power and
> disk life. Plus, I think that lsof actually would probe the devices
> and 'wake them up' instead of keeping them as-is. However, I could be
> wrong so if I am please let me know.

Take a look at how /usr/bin/fstat does it.  There is apparently a
"kern.file" sysctl that holds the open file table, but fstat digs
through kernel memory.

-- 
        Dan Nelson
        [EMAIL PROTECTED]
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to