From owner-freebsd-current Mon Jan 15 15: 9:54 2001 Delivered-To: freebsd-current@freebsd.org Received: from netau1.alcanet.com.au (ntp.alcanet.com.au [203.62.196.27]) by hub.freebsd.org (Postfix) with ESMTP id 4DFF337B69D for ; Mon, 15 Jan 2001 15:09:36 -0800 (PST) Received: from mfg1.cim.alcatel.com.au (mfg1.cim.alcatel.com.au [139.188.23.1]) by netau1.alcanet.com.au (8.9.3 (PHNE_22672)/8.9.3) with ESMTP id KAA08778; Tue, 16 Jan 2001 10:09:31 +1100 (EDT) Received: from gsmx07.alcatel.com.au by cim.alcatel.com.au (PMDF V5.2-32 #37645) with ESMTP id <01JYYZ7G10I8GKTZKQ@cim.alcatel.com.au>; Tue, 16 Jan 2001 10:09:37 +1100 Received: (from jeremyp@localhost) by gsmx07.alcatel.com.au (8.11.0/8.11.0) id f0FN9SA38579; Tue, 16 Jan 2001 10:09:28 +1100 (EST envelope-from jeremyp) Content-return: prohibited Date: Tue, 16 Jan 2001 10:09:28 +1100 From: Peter Jeremy Subject: Re: number of processes forked since boot In-reply-to: ; from abial@webgiro.com on Mon, Jan 15, 2001 at 11:24:22PM +0100 To: Andrzej Bialecki Cc: current@FreeBSD.ORG Mail-followup-to: Andrzej Bialecki , current@FreeBSD.ORG Message-id: <20010116100928.H91029@gsmx07.alcatel.com.au> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-disposition: inline User-Agent: Mutt/1.2.5i References: <20010116.025742.74757685.ume@FreeBSD.org> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 2001-Jan-15 23:24:22 +0100, Andrzej Bialecki wrote: >On Tue, 16 Jan 2001, Hajimu UMEMOTO wrote: ... >> +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. On an i386, "long" and "int" are both 32 bits, hence "long" has a lower maximum count than "unsigned int". "unsigned long" might be a better choice (to give a greater range on the Alpha). In any case, at 1000 forks/sec, a 32-bit counter will still take nearly 50 days to wrap. Lots of other counters will have wrapped by this time. Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message