🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #9464

Re: NNRPD compile trouble

#9464
From: Matthew B. Wood
Date: Sat, 20 Jul 1996 00:00
88 lines
2865 bytes
Heiko W.Rupp (hwr@pilhuhn.de) wrote:

: In <devtrixDut02G.42B@netcom.com>, Matthew B. Wood wrote:

: :|...So I went ahead and updated it by hand.  

: I added that to the FAQ.

: :|Should someone contact the INN FAQ maintainer about this?

: Yupp, send me mail ;-)

: No honestly - I can't alway read all articles on news.software.nntp, so
: I might miss valuable information.

: -- 
: Heiko W.Rupp        Gerwigstr.5        D-76131  Karlsruhe    +49 721 9661524
: Advertisement for donkey rides in Thailand:  Would you like to ride
:         on your own ass?

Heiko, Clayton:

thanks for your attention in getting this done!  I've re-formatted 
Clayton's patch data below into a new-style context diff format patch.  
With a simple "patch < patchfile" in the nnrpd source directory, 
Linux users should be able to patch in one simple step.  For a source 
file, I used "loadave.c" right from the 'inn1.4unoff4' distribution.

I hope this helps!

--
Matthew B. Wood                                              mbwood@netcom.com
             "Psychoplasmics:  The Ultimate Therapeutic Device"



--- loadave.c   Sat Jul 20 09:20:21 1996
***************
*** 1,8 ****
! /*  $Revision: 1.3 $
  **
  */
  #include "nnrpd.h"
  #if   NNRP_LOADLIMIT > 0
  #include <nlist.h>
  STATIC struct nlist NameList[] = {
      { "_avenrun" },
--- 1,28 ----
! /*  $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,58 ****
--- 75,79 ----
      return (int)(avenrun[0] + 0.5);
  #endif        /* defined(FSCALE) */
  }
+ #endif /* linux */
  #endif        /* NNRP_LOADLIMIT > 0 */


Technical Details
Message-ID: <devtrixDuuoH4.BwF@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
References: <devtrixDurq30.3CB@netcom.com> <slrn4utu7s.h6l.coneill@premier1.premier.net> <devtrixDut02G.42B@netcom.com> <4sqdsf$g98$5@snert.pilhuhn.de>

Show Full Headers
Complete Article Headers
Message-ID: <devtrixDuuoH4.BwF@netcom.com>
Subject: Re: NNRPD compile trouble
Date: Sat, 20 Jul 1996 00:00:00 +0000
From: devtrix@netcom.com (Matthew B. Wood)
References: <devtrixDurq30.3CB@netcom.com> <slrn4utu7s.h6l.coneill@premier1.premier.net> <devtrixDut02G.42B@netcom.com> <4sqdsf$g98$5@snert.pilhuhn.de>
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: 169802446
Sender: devtrix@netcom21.netcom.com
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
Newsgroups: news.software.nntp