Article View: news.software.nntp
Article #2218Re: INN: limit number of connections?
From: H. Peter Anvin N9ITP
Date: Sun, 17 Oct 1993 22:23
Date: Sun, 17 Oct 1993 22:23
51 lines
2818 bytes
2818 bytes
[I am cross-posting this to several groups; followups are directed to
comp.unix.internals]
In article <29hen8INN33g@rodan.uu.net> of news.software.nntp,
rsalz@rodan.UU.NET (Rich Salz) writes:
>
> For what it's worth I am taking the load average code out of nnrpd
> for INN1.5. It is too much hassle to stay portable. The same
> features will be available through innwatch.
>
This appears to be a very common problem: programs that would like to
know about load averages simply cannot because there is no portable
way of doing it. However, there are many people with access to system
documentation who could inform us how to get the load average from
system X. What I propose is that someone (e.g. I) volunteer as "load
average moderator", and that if anyone of you know how to determine
the load average on system X, send me a piece of code that does it,
including just exactly what system X is, and what else you needed to
do (setuid root, setgid kmem, make sure /proc is mounted...)
Also, I need to know what #ifdefs I can rely on to identify your system.
The whole package (liboadavg?) could then be released either in the
public domain or under the GNU LGPL.
In particular, I would like you to write the "getavenrun" function for
this program:
#include <stdio.h>
int getavenrun( /* double *avenrun */ );
main()
{
double avenrun[3]; /* Load average over 1, 5 and 15 minutes */
if ( getavenrun(avenrun) )
{
fprintf(stderr, "Could not get load average\n");
exit(1);
}
printf("Load avg: %0.2f %0.2f %0.2f\n", avenrun[0], avenrun[1], avenrun[2]);
}
--
INTERNET: hpa@nwu.edu FINGER/TALK: hpa@ahab.eecs.nwu.edu
IBM MAIL: I036073 at IBMMAIL NeXTMAIL: hpa@speedy.acns.nwu.edu
ANM�RKNING: Heja Sverige friskt hum�r! EG v�ntar utanf�r!
Linux Is Not UniX
Technical Details
Message-ID:
<CF2BJA.Bqu@eecs.nwu.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.unix.internals.mbox.zip!gmd.de!xlink.net!howland.reston.ans.net!math.ohio-state.edu!news.acns.nwu.edu!news.eecs.nwu.edu!ahab.eecs.nwu.edu!hpaReferences:
<29h66c$qhb@pirates.cs.swt.edu> <29h8hb$1u7@news.mantis.co.uk> <29hen8INN33g@rodan.uu.net>Show Full Headers
Complete Article Headers
Message-ID: <CF2BJA.Bqu@eecs.nwu.edu> Subject: Re: INN: limit number of connections? Date: Sun, 17 Oct 1993 22:23:33 GMT From: hpa@ahab.eecs.nwu.edu (H. Peter Anvin N9ITP) References: <29h66c$qhb@pirates.cs.swt.edu> <29h8hb$1u7@news.mantis.co.uk> <29hen8INN33g@rodan.uu.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.unix.internals.mbox.zip!gmd.de!xlink.net!howland.reston.ans.net!math.ohio-state.edu!news.acns.nwu.edu!news.eecs.nwu.edu!ahab.eecs.nwu.edu!hpa Newsgroups: news.software.nntp,comp.unix.internals,comp.unix.wizards,comp.unix.misc Followup-To: comp.unix.internals Sender: usenet@eecs.nwu.edu Reply-To: hpa@nwu.edu (H. Peter Anvin) Organization: Northwestern University, Evanston, Illinois, USA Lines: 50