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

//  <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to