Article View: news.software.nntp
Article #9442Re: NNRPD compile trouble
From: Clayton O'Neill
Date: Fri, 19 Jul 1996 00:00
Date: Fri, 19 Jul 1996 00:00
60 lines
2176 bytes
2176 bytes
On Fri, 19 Jul 1996 02:11:24 GMT, Matthew B. Wood <devtrix@netcom.com> wrote:
>gcc -O -o nnrpd article.o group.o commands.o misc.o newnews.o nnrpd.o
>post.o loadave.o ../libinn.a
>loadave.o(.text+0x3b): undefined reference to `nlist'
>make: *** [nnrpd] Error 1
>
>I have /usr/include/nlist.h, but I can't seem to find it in any of the
>libraries. Where is located? I'm surprised this in't in the FAQ!
The below patch fixes this. This patch is going to be rolled into 1.5.
--- /usr/local/news/INN/nnrpd/loadave.c Fri Jan 29 10:51:58 1993
+++ loadave.c Wed Jul 17 15:36:30 1996
@@ -1,8 +1,28 @@
-/* $Revision: 1.3 $
+/* $Revision: 1.4 $
**
*/
#include "nnrpd.h"
#if NNRP_LOADLIMIT > 0
+#ifdef linux
+
+/*
+** Get the current load average as an integer.
+*/
+int
+GetLoadAverage()
+{
+ FILE *ProcLoadAve;
+ float load;
+
+ if ((ProcLoadAve=fopen("/proc/loadavg", "r"))==NULL)
+ return -1;
+ if (fscanf(ProcLoadAve,"%f", &load)!=1)
+ return -1;
+ fclose(ProcLoadAve);
+ return (int)(load+0.5);
+}
+
+#else
#include <nlist.h>
STATIC struct nlist NameList[] = {
{ "_avenrun" },
@@ -55,4 +75,5 @@
return (int)(avenrun[0] + 0.5);
#endif /* defined(FSCALE) */
}
+#endif /* linux */
#endif /* NNRP_LOADLIMIT > 0 */
--
-------------------------------------------------------------------------
Clayton O'Neill Business--> Premier One Inc
whatever@oneill.net clayton@premier.net
http://www.oneill.net <--Personal http://www.premier.net
Technical Details
Message-ID:
<slrn4utu7s.h6l.coneill@premier1.premier.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<devtrixDurq30.3CB@netcom.com>Show Full Headers
Complete Article Headers
Message-ID: <slrn4utu7s.h6l.coneill@premier1.premier.net> Subject: Re: NNRPD compile trouble Date: Fri, 19 Jul 1996 00:00:00 +0000 From: coneill@premier1.premier.net (Clayton O'Neill) References: <devtrixDurq30.3CB@netcom.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 170299525 Organization: Premier One Newsgroups: news.software.nntp