Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Nov 1998 21:51:48 +0100 (CET)
From:      Andrzej Bialecki <abial@nask.pl>
To:        "Jason K. Fritcher" <jkf@calweb.com>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: Process table question
Message-ID:  <Pine.BSF.4.02A.9811172121370.14793-100000@korin.warman.org.pl>
In-Reply-To: <Pine.BSF.4.02A.9811162323170.5490-100000@web2.calweb.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 16 Nov 1998, Jason K. Fritcher wrote:

> 
> Hello. I am making a system monitor for FreeBSD 2.[12].x and 3.0, and am
> trying to find a kvm-independant way of counting the number of processes in
> the process table. I have thought about using opendir() on /proc and
> counting the number of directory entries, but I was wondering if there was
> something like a sysctl or other system call to gather the information, or

Sure. See: src/release/picobsd/tinyware/sps for example how to do this.

> is the /proc method the best?

It's one of many. IMHO sysctl(3) is the best one.

Andrzej Bialecki

--------------------   ++-------++  -------------------------------------
 <abial@nask.pl>       ||PicoBSD||   FreeBSD in your pocket? Go and see:
 Research & Academic   |+-------+|       "Small & Embedded FreeBSD"
 Network in Poland     | |TT~~~| |    http://www.freebsd.org/~picobsd/
--------------------   ~-+==---+-+  -------------------------------------


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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.02A.9811172121370.14793-100000>