Too many open files

Jilles Tjoelker jilles at stack.nl
Tue Mar 27 21:45:30 UTC 2012


On Mon, Mar 26, 2012 at 10:15:59AM +0100, Matthew Seaman wrote:
> Does 'procstat -fa' give better results for you?

> It seems to be one of those little hidden secrets that FreeBSD comes
> with a bunch of native applications that provide pretty much equivalent
> functionality to lsof(1).  See: fstat(1), procstat(1), sockstat(1).

> Which is odd, given that since these sort of applications have to read
> and interpret kernel memory -- an action for which there isn't a nice
> well defined ABI -- the application has to be kept rigorously in synch
> with the kernel it is used against.  Something that is intrinsically
> easier to do when kernel and application are compiled at the same time
> and from the same source tree.

procstat (in all versions that have it) and fstat (in FreeBSD 9.0 and
newer) use a well-defined sysctl-based API to access the information.
This API was extended in FreeBSD 9.0 and a library libprocstat provides
a convenient interface.

Reading from kernel memory not only couples the application tightly to
the kernel implementation, but also can also be considered a security
issue because there is a lot of sensitive information in kernel memory;
it cannot be permitted in a jail.

-- 
Jilles Tjoelker


More information about the freebsd-stable mailing list