Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jan 2001 23:24:22 +0100 (CET)
From:      Andrzej Bialecki <abial@webgiro.com>
To:        Hajimu UMEMOTO <ume@FreeBSD.org>
Cc:        current@freebsd.org
Subject:   Re: number of processes forked since boot
Message-ID:  <Pine.BSF.4.20.0101152321530.13323-100000@mx.webgiro.com>
In-Reply-To: <20010116.025742.74757685.ume@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 16 Jan 2001, Hajimu UMEMOTO wrote:

> Hi,
> 
> I wish to obtain number of processes forked since boot from userland.
> So, I made a patch to intend to commit.
> Any comment?

> Index: sys/kern/kern_fork.c
> diff -u sys/kern/kern_fork.c.orig sys/kern/kern_fork.c
> --- sys/kern/kern_fork.c.orig	Fri Jan 12 02:46:53 2001
> +++ sys/kern/kern_fork.c	Tue Jan 16 02:30:26 2001
> @@ -146,6 +146,9 @@
>  int	nprocs = 1;				/* process 0 */
>  static int nextpid = 0;
>  
> +static unsigned int nforks = 0;
> +SYSCTL_UINT(_kern, KERN_NFORKS, nforks, CTLFLAG_RD, &nforks, 0, "");

If any, I think this should be long, otherwise on machines like web
servers the counter will overflow in a short time.

Andrzej Bialecki

//  <abial@webgiro.com> WebGiro AB, Sweden (http://www.webgiro.com)
// -------------------------------------------------------------------
// ------ FreeBSD: The Power to Serve. http://www.freebsd.org --------
// --- Small & Embedded FreeBSD: http://www.freebsd.org/~picobsd/ ----




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" 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.20.0101152321530.13323-100000>