Re: structure has no member named `kp_eproc'

2007-05-15 Thread Joerg Sonnenberger
On Tue, May 15, 2007 at 01:48:18AM +1000, Petr Janda wrote:
 I'm trying to compile net-snmp from SVN applying the pkgsrc patches and 
 I can't seem to figure out why its failing on this error. What's the  
 meaning of this error and how to fix it?

Patches in pkgsrc only apply to DragonFly 1.6 and 1.8. Well, they work
on 1.8 and did work on 1.6 at one point. Please don't break that
upstream...

Joerg


structure has no member named `kp_eproc'

2007-05-14 Thread Petr Janda

Hi,
I'm trying to compile net-snmp from SVN applying the pkgsrc patches and 
I can't seem to figure out why its failing on this error. What's the  
meaning of this error and how to fix it?


Thanks,
Petr


Re: structure has no member named `kp_eproc'

2007-05-14 Thread Erik Wikström

On 2007-05-14 17:48, Petr Janda wrote:

Hi,
I'm trying to compile net-snmp from SVN applying the pkgsrc patches and 
I can't seem to figure out why its failing on this error. What's the  
meaning of this error and how to fix it?


You didn't tell us which struct, that should be included in the error 
message, so it's hard to tell. But my guess is that there's some 
structure that contains information about the system (used to pass data 
between the application and the kernel). That structure looks something 
like this:


struct foo {
  int bar;
  int baz;
  char* forbar;
}

However in some earlier version or on some other system that struct 
looks different (and the application is not aware of this), some thing 
like this:


struct foo {
  int bar;
  int baz;
  int kp_eproc;
  char* foobar;
}

So when you try to compile the code that assumes that the struct has a 
member kp_eproc but in reality it does not you get that error message.


A question: If you applied patches from pkgsrc does that mean that the 
program is in pkgsrc and in that case, why not use it?


--
Erik Wikström


Re: structure has no member named `kp_eproc'

2007-05-14 Thread Petr Janda

Erik Wikström wrote:

On 2007-05-14 17:48, Petr Janda wrote:

Hi,
I'm trying to compile net-snmp from SVN applying the pkgsrc patches 
and I can't seem to figure out why its failing on this error. What's 
the  meaning of this error and how to fix it?


So when you try to compile the code that assumes that the struct has a 
member kp_eproc but in reality it does not you get that error message.


A question: If you applied patches from pkgsrc does that mean that the 
program is in pkgsrc and in that case, why not use it?



Hi Erik,

This is the full message,
host/hr_swrun.c: In function `var_hrswrun':
host/hr_swrun.c:603: error: structure has no member named `kp_eproc'
host/hr_swrun.c:604: error: structure has no member named `kp_eproc'
host/hr_swrun.c:605: error: structure has no member named `kp_eproc'
host/hr_swrun.c:730: error: structure has no member named `kp_proc'
host/hr_swrun.c:928: error: structure has no member named `kp_proc'
host/hr_swrun.c:972: error: structure has no member named `kp_proc'
host/hr_swrun.c:1079: error: structure has no member named `kp_eproc'
host/hr_swrun.c:1080: error: structure has no member named `kp_eproc'
host/hr_swrun.c:1081: error: structure has no member named `kp_eproc'
host/hr_swrun.c:1171: error: structure has no member named `kp_eproc'
host/hr_swrun.c: In function `Init_HR_SWRun':
host/hr_swrun.c:1349: warning: unused variable `bytes'
host/hr_swrun.c: In function `Get_Next_HR_SWRun':
host/hr_swrun.c:1491: error: structure has no member named `kp_proc'
host/hr_swrun.c:1492: error: structure has no member named `kp_proc'
*** Error code 1

Stop in /root/net-snmp_svn/V5-4-patches/agent/mibgroup.

and this is the part of code from around line 1079:

#elif HAVE_KVM_GETPROCS
   #if defined(NOT_DEFINED)  defined(freebsd5)  __FreeBSD_version 
= 500014

   /* XXX: Accessing ki_paddr causes sig10 ...
   long_return = proc_table[LowProcIndex].ki_paddr-p_uticks +
   proc_table[LowProcIndex].ki_paddr-p_sticks +
   proc_table[LowProcIndex].ki_paddr-p_iticks; */
   long_return = 0;
   #elif defined(freebsd5)
   long_return = proc_table[LowProcIndex].ki_runtime / 10;
   #elif defined(dragonfly)
   long_return = proc_table[LowProcIndex].kp_eproc.e_uticks +
   proc_table[LowProcIndex].kp_eproc.e_sticks +
   proc_table[LowProcIndex].kp_eproc.e_iticks;
   #else
   long_return = proc_table[LowProcIndex].kp_proc.p_uticks +
   proc_table[LowProcIndex].kp_proc.p_sticks +
   proc_table[LowProcIndex].kp_proc.p_iticks;
   #endif

The reason I am doing this is because I am trying to get NET-SNMP 
supported upstream (at the moment its broken in pkgsrc stable and current)


Thanks
Petr