Article View: news.software.nntp
Article #9459Re: NNRPD compile trouble
From: Matthew B. Wood
Date: Fri, 19 Jul 1996 00:00
Date: Fri, 19 Jul 1996 00:00
72 lines
2634 bytes
2634 bytes
Clayton O'Neill (coneill@premier1.premier.net) wrote:
: On Fri, 19 Jul 1996 02:11:24 GMT, Matthew B. Wood 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 */
Thanks, Clayton! I patched it and it compiled. It didn't seem to take
the automatic patch though:
Patching file loadave.c using Plan A...
Hunk #1 failed at 1.
Hunk #2 succeeded at 75 with fuzz 2.
1 out of 2 hunks failed--saving rejects to loadave.c.rej
done
...So I went ahead and updated it by hand.
Should someone contact the INN FAQ maintainer about this?
--
Matthew B. Wood mbwood@netcom.com
"Psychoplasmics: The Ultimate Therapeutic Device"
Technical Details
Message-ID:
<devtrixDut02G.42B@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-mailReferences:
<devtrixDurq30.3CB@netcom.com> <slrn4utu7s.h6l.coneill@premier1.premier.net>Show Full Headers
Complete Article Headers
Message-ID: <devtrixDut02G.42B@netcom.com> Subject: Re: NNRPD compile trouble Date: Fri, 19 Jul 1996 00:00:00 +0000 From: devtrix@netcom.com (Matthew B. Wood) References: <devtrixDurq30.3CB@netcom.com> <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-mail X-Deja-AN: 168904802 Sender: devtrix@netcom21.netcom.com Organization: NETCOM On-line Communication Services (408 261-4700 guest) Newsgroups: news.software.nntp