From owner-freebsd-hackers Tue Nov 17 12:46:34 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA10260 for freebsd-hackers-outgoing; Tue, 17 Nov 1998 12:46:34 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from korin.warman.org.pl (korin.nask.waw.pl [195.187.243.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA10222 for ; Tue, 17 Nov 1998 12:46:25 -0800 (PST) (envelope-from abial@nask.pl) Received: from localhost (abial@localhost) by korin.warman.org.pl (8.9.1/8.8.5) with SMTP id VAA25037; Tue, 17 Nov 1998 21:51:48 +0100 (CET) X-Authentication-Warning: korin.warman.org.pl: abial owned process doing -bs Date: Tue, 17 Nov 1998 21:51:48 +0100 (CET) From: Andrzej Bialecki X-Sender: abial@korin.warman.org.pl To: "Jason K. Fritcher" cc: hackers@FreeBSD.ORG Subject: Re: Process table question In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 -------------------- ++-------++ ------------------------------------- ||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