From owner-freebsd-stable@FreeBSD.ORG Tue Mar 27 21:45:29 2012 Return-Path: Delivered-To: freebsd-stable@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F05941065672; Tue, 27 Mar 2012 21:45:29 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 873F18FC12; Tue, 27 Mar 2012 21:45:29 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 6A5781E5F2D; Tue, 27 Mar 2012 23:45:28 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 5274D2847A; Tue, 27 Mar 2012 23:45:28 +0200 (CEST) Date: Tue, 27 Mar 2012 23:45:28 +0200 From: Jilles Tjoelker To: Matthew Seaman Message-ID: <20120327214528.GA33932@stack.nl> References: <4F7019FC.4090907@ShaneWare.Biz> <4660483b96cf883fd66b46f4578d1def.squirrel@mail.digital-infotech.net> <20120326085640.GB5335@home.opsec.eu> <4F7033CF.6000308@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F7033CF.6000308@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-stable@FreeBSD.org Subject: Re: Too many open files X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Mar 2012 21:45:30 -0000 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