🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #7357

Re: Compiling INN

#7357
From: Miquel van Smoorenburg
Date: Tue, 07 May 1996 00:00
72 lines
2486 bytes
In article <4mlnmi$6ep@sahara.enmu.edu>,
Brent O'Keeffe <Brent.OKeeffe@enmu.edu> wrote:
>In article <31892C4D.5B3C@trianet.net>,
>   Daniel Salama <dsalama@trianet.net> wrote:
>>I have been trying to compile INN but I keep getting errors! I am now at 
>>a point where when I compile nnrp but it is halting when looking for 
>>"nlist". I looked at loadave.c and it is looking for <nlist.h> but I 
>
>I had the same problem during the compile.  I never did find the correct fix 
>for this problem

If this is for Linux (which I suspect) then here is a diff (from my
inn1.4unoff4 debian package):

diff -ruN inn-1.4unoff4.orig/nnrpd/loadave.c inn-1.4unoff4/nnrpd/loadave.c
--- inn-1.4unoff4.orig/nnrpd/loadave.c	Fri Jan 29 17:51:58 1993
+++ inn-1.4unoff4/nnrpd/loadave.c	Sun Apr  7 16:17:07 1996
@@ -3,6 +3,36 @@
 */
 #include "nnrpd.h"
 #if	NNRP_LOADLIMIT > 0
+
+#ifdef __linux__
+
+/*
+**  Get the current load average as an integer.
+*/
+int
+GetLoadAverage()
+{
+    int		fd, n;
+    char	buf[16];
+    double	avenrun;
+    char	*s;
+
+    if ((fd = open("/proc/loadavg", O_RDONLY)) < 0)
+	return 0;
+    n = read(fd, buf, sizeof(buf) - 1);
+    close(fd);
+    if (n < 0) return 0;
+    buf[n] = 0;
+    if ((s = strchr(buf, ' ')) != NULL)
+	*s = 0;
+    sscanf(buf, "%lf", &avenrun);
+
+    return (int)(avenrun + 0.5);
+}
+
+#else  /* __linux__ */
+
+
 #include <nlist.h>
 STATIC struct nlist NameList[] = {
     { "_avenrun" },
@@ -55,4 +85,7 @@
     return (int)(avenrun[0] + 0.5);
 #endif	/* defined(FSCALE) */
 }
+
+#endif  /* __linux__ */
+
 #endif	/* NNRP_LOADLIMIT > 0 */


Mike.
-- 
  Miquel van    | Cistron Internet Services   --    Alphen aan den Rijn.
  Smoorenburg,  | mailto:info@cistron.nl          http://www.cistron.nl/
miquels@het.net | Tel: +31-172-419445 (Voice) 430979 (Fax) 442580 (Data)

Technical Details
Message-ID: <4mng9i$rns@picard.cistron.nl>
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
References: <31892C4D.5B3C@trianet.net> <4mlnmi$6ep@sahara.enmu.edu>

Show Full Headers
Complete Article Headers
Message-ID: <4mng9i$rns@picard.cistron.nl>
Subject: Re: Compiling INN
Date: Tue, 07 May 1996 00:00:00 +0000
From: miquels@cistron.nl (Miquel van Smoorenburg)
References: <31892C4D.5B3C@trianet.net> <4mlnmi$6ep@sahara.enmu.edu>
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: 153485172
Distribution: inet
Organization: Cistron Internet Services - the Netherlands
Newsgroups: news.software.nntp