🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
9 messages
9 total messages Started by Matthew B. Wood Fri, 19 Jul 1996 00:00
NNRPD compile trouble
#9461
Author: Matthew B. Wood
Date: Fri, 19 Jul 1996 00:00
18 lines
1175 bytes
Trying to compile inn1.4unoff4 under Linux 2.0.0.  Using hints from the 
INN FAQ, everything compiled smoothly... except nnrpd.

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!

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


Re: NNRPD compile trouble
#9442
Author: Clayton O'Neill
Date: Fri, 19 Jul 1996 00:00
60 lines
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


Re: NNRPD compile trouble
#9459
Author: Matthew B. Wood
Date: Fri, 19 Jul 1996 00:00
72 lines
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"


Re: NNRPD compile trouble
#9464
Author: 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 */


Re: NNRPD compile trouble
#9485
Author: Heiko W.Rupp
Date: Sat, 20 Jul 1996 00:00
23 lines
1225 bytes
[ This message has been posted and mailed - please reply in news. ]

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?


Re: NNRPD compile trouble (fodder for the FAQ)
#9487
Author: Alan Brown
Date: Sun, 21 Jul 1996 00:00
22 lines
1277 bytes
In article <devtrixDurq30.3CB@netcom.com>,
Matthew B. Wood <devtrix@netcom.com> wrote:

>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!

This should be in the FAQ in the linux section. (Heiko, you reading this?)

You need libelf. The Current version is 0.5.2.

This is the ELF object file access library.

The latest version is at ftp://wsn4.ifw.uni-hannover.de/ and may be at 
other places too.

AB
-- 
One net to rule them all, one net to find them, one net to bring them all,
using Unix to bind them.

Re: NNRPD compile trouble
#9492
Author: Doug McClure
Date: Sun, 21 Jul 1996 00:00
190 lines
5971 bytes
Help...I'm running Irix 6.2 on a Challenge S, forced into using cc since
gcc is unrecoverably DOA. All patches are rejecting - no matter how I
try to get them in, and the compile still fails with the errors about
nlist. I'm compiling using n32 and mmap as well. Sorry to hit with such
a giant post, but I get at best

117 % make
        cc -I../include -O2 -n32 -c article.c
        cc -I../include -O2 -n32 -c group.c
        cc -I../include -O2 -n32 -c commands.c
        cc -I../include -O2 -n32 -c misc.c
        cc -I../include -O2 -n32 -c newnews.c
        cc -I../include -O2 -n32 -c nnrpd.c
        cc -I../include -O2 -n32 -c post.c
        cc -I../include -O2 -n32 -c loadave.c
        cc -n32  -o nnrpd article.o group.o commands.o misc.o newnews.o
nnrpd.o post.o loadave.o ../libinn.a 
ld32: ERROR 33: Unresolved text symbol "nlist" -- 1st referenced by
loadave.o.
ld32: INFO 60: Output file removed because of error.
cc ERROR:  /usr/lib64/cmplrs/ld32 returned non-zero status 1
*** Error code 1 (bu21)



Here is the loadave.c I have manually patched - probably made a mess of
it, I admittedly avoid C:

====================================================================

/*  $Revision: 1.4 $
**
*/

#include "nnrpd.h"
#if NNRP_LOADLIMIT > 0
#ifdef linux

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" },
#define X_AVENRUN       0
    { NULL }
};


/*
**  Get the current load average as an integer.
*/
int
GetLoadAverage()
{
    int         fd;
    int         oerrno;
#if     defined(FSCALE)
    long        avenrun[3];
#else
    double      avenrun[3];
#endif  /* defined(FSCALE) */

    fd = open("/dev/kmem", 0, 0);
    if (fd < 0)
        return -1;

#if     defined(HPUX)
    (void)nlist("/hp-ux", NameList);
#else
#if     defined(SUNOS5)
    (void)nlist("/dev/ksyms", NameList);
#else
    (void)nlist("/vmunix", NameList);
#endif  /* defined(SUNOS5) */
#endif  /* !defined(HPUX) */
    if (NameList[0].n_type == 0
     || lseek(fd, (off_t) NameList[X_AVENRUN].n_value, SEEK_SET) == -1
     || read(fd, (char *)avenrun, sizeof avenrun) != sizeof avenrun) {
        oerrno = errno;
        (void)close(fd);
        errno = oerrno;
        return -1;
    }

    (void)close(fd);

#if     defined(FSCALE)
    return (int)(avenrun[0] + FSCALE / 2) >> FSHIFT;
#else
    return (int)(avenrun[0] + 0.5);
#endif  /* defined(FSCALE) */
}
#endif /* linux */
#endif  /* NNRP_LOADLIMIT > 0 */


=--------------------------------------------------------------------
Very frustrating since every other aspect of INN compiled perfectly for
once. Ack!

Doug McClure
SCESCAPE



Matthew B. Wood wrote:
> 
> 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"

Re: NNRPD compile trouble
#9494
Author: Clayton O'Neill
Date: Sun, 21 Jul 1996 00:00
30 lines
2005 bytes
In article <31F1BBB7.2C67@scescape.net>, you wrote:
>Help...I'm running Irix 6.2 on a Challenge S, forced into using cc since
>gcc is unrecoverably DOA. All patches are rejecting - no matter how I
>try to get them in, and the compile still fails with the errors about
>nlist. I'm compiling using n32 and mmap as well. Sorry to hit with such
>a giant post, but I get at best

>        cc -n32  -o nnrpd article.o group.o commands.o misc.o newnews.o
>nnrpd.o post.o loadave.o ../libinn.a 
>ld32: ERROR 33: Unresolved text symbol "nlist" -- 1st referenced by
>loadave.o.
>ld32: INFO 60: Output file removed because of error.
>cc ERROR:  /usr/lib64/cmplrs/ld32 returned non-zero status 1
>*** Error code 1 (bu21)

Sorry, I wasn't very clear about my previous patch.  It's probably only
going to fix the problem under Linux.  Under Irix it's recommended that you
set LIBS = -lmld.  I would guess that this will fix the problem, but if it
doesn't you can always disable load ave checking by specifying -1 for
NNRP_LOADLIMIT.

-- 
-------------------------------------------------------------------------
Clayton O'Neill             Business-->                   Premier One Inc
whatever@oneill.net                                   clayton@premier.net
http://www.oneill.net       <--Personal            http://www.premier.net


Re: NNRPD compile trouble (fodder for the FAQ)
#9496
Author: Heiko W.Rupp
Date: Sun, 21 Jul 1996 00:00
22 lines
1191 bytes
[ This message has been posted and mailed - please reply in news. ]

In <4st3a8$2kb@papaioea.manawatu.gen.nz>, Alan Brown wrote:
:|This should be in the FAQ in the linux section. (Heiko, you reading this?)

Yup.

:|You need libelf. The Current version is 0.5.2.

If I have libelf what else do I need?

I am no linux guy. Please find a solution that I can include in the FAQ 
and mail it to me. Thanks.

-- 
Heiko W.Rupp        Gerwigstr.5        D-76131  Karlsruhe    +49 721 9661524
Q:  What do you call a hacker who collects coins?
A:  A gnumismatist.


Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads