Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Mar 2012 23:45:28 +0200
From:      Jilles Tjoelker <jilles@stack.nl>
To:        Matthew Seaman <matthew@FreeBSD.org>
Cc:        freebsd-stable@FreeBSD.org
Subject:   Re: Too many open files
Message-ID:  <20120327214528.GA33932@stack.nl>
In-Reply-To: <4F7033CF.6000308@FreeBSD.org>
References:  <a8f31306b066f86beabc61fce1e2b5fb.squirrel@mail.digital-infotech.net> <CADGWnjWTNviAyfReZ-fy0rhF=DKsA57rCscYtsU=v25rTMq5Xw@mail.gmail.com> <4F7019FC.4090907@ShaneWare.Biz> <4660483b96cf883fd66b46f4578d1def.squirrel@mail.digital-infotech.net> <20120326085640.GB5335@home.opsec.eu> <4F7033CF.6000308@FreeBSD.org>

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



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