Date: Tue, 10 Jan 2006 16:18:48 +0000 From: Tofik Suleymanov <tofik@oxygen.az> To: kamal kc <kamal_ckk@yahoo.com> Cc: freebsd <freebsd-hackers@freebsd.org> Subject: Re: using get_system_info() - obtaining system load averages Message-ID: <43C3DE68.70303@oxygen.az> In-Reply-To: <20060110112821.75288.qmail@web30001.mail.mud.yahoo.com> References: <20060110112821.75288.qmail@web30001.mail.mud.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
kamal kc wrote: >--- Peter Jeremy <PeterJeremy@optushome.com.au> wrote: > > > >>On Mon, 2006-Jan-09 23:59:10 -0800, kamal kc wrote: >> >> >>>thanks i tried getloadavg() it worked. >>> >>>but when i tried to put it in the kernel the kernel >>>failed to link. >>> >>> >>You didn't mention the kernel bit before. To access >>the load average in the kernel, you just access >>"averunnable" (see <sys/resource.h>). Note that you >>cannot do floating point arithmetic in the kernel so >>the load averages are stored as fixed point numbers. >> >> >> > >thanks , it worked !!!! > >i used the ldavg[] and fscale of averunnable to get >the system load. > > >you people are great .. > >kamal > > > > > > > > > >__________________________________________ >Yahoo! DSL – Something to write home about. >Just $16.99/mo. or less. >dsl.yahoo.com > >_______________________________________________ >freebsd-hackers@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > > > Just a curiosity: why use kernel-space functions to get system load ? Isn't it better to use sysctls in user-space ?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43C3DE68.70303>