From owner-freebsd-hackers Thu Aug 3 13:55:30 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id 1A02937B7CC for ; Thu, 3 Aug 2000 13:54:33 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.9.3/8.9.3) id PAA03523; Thu, 3 Aug 2000 15:54:24 -0500 (CDT) (envelope-from dan) Date: Thu, 3 Aug 2000 15:54:23 -0500 From: Dan Nelson To: Laurence Barry Cc: FreeBSD Hackers Subject: Re: nfiles Message-ID: <20000803155423.A3001@dan.emsphone.com> References: <39898D03.6185C6C3@herculeez.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.3.6i In-Reply-To: <39898D03.6185C6C3@herculeez.com>; from "Laurence Barry" on Thu Aug 3 16:17:23 GMT 2000 X-OS: FreeBSD 5.0-CURRENT Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In the last episode (Aug 03), Laurence Barry said: > I need to determine the total number of files open on a system. The > only way I can think to do this is a sysctl() call with > mib[0]=CTL_KERN and mib[1]=KERN_FILE, then trawl through the file > structure that is returned. There must be a simpler way. Figure out how pstat -T does it: $ pstat -T 294/3240 files 0M/1173M swap space -- Dan Nelson dnelson@emsphone.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message