Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Aug 2000 11:21:48 -0400 (EDT)
From:      Zhihui Zhang <zzhang@cs.binghamton.edu>
To:        Laurence Barry <laurence@herculeez.com>
Cc:        FreeBSD Questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: nfiles
Message-ID:  <Pine.SOL.4.21.0008031117380.11190-100000@sol.cs.binghamton.edu>
In-Reply-To: <39898501.6FDC3C79@herculeez.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 3 Aug 2000, Laurence Barry wrote:

> Sure this is a simple one ...
> 
> 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.

You can add a new sysctl variable named something like "kern.openfiles"
easily to account for the number of file structures in use.  Adding a new
sysctl variable is really easy (two lines are enough). But you need to
build a custom kernel.  See FreeBSD handbook online for how to do this.

-Zhihui



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.4.21.0008031117380.11190-100000>