Changes between Initial Version and Version 1 of Ticket #21088


Ignore:
Timestamp:
Sep 4, 2009, 5:53:34 PM (15 years ago)
Author:
nerdling (Jeremy Lavergne)
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #21088

    • Property Port ifstat added
  • Ticket #21088 – Description

    initial v1  
    11When compiled on snow leopard there are just two warning:
     2{{{
    23gcc -I. -g -O2 -DHAVE_CONFIG_H  -DNETSNMP_ENABLE_IPV6 -g -Os -pipe -DBUILD=127 -DMACOSX_DEPLOYMENT_TARGET=10.6 -F/System/Library/PrivateFrameworks/ -F/System/Library/Frameworks/ -Udarwin10 -Ddarwin10=darwin10 -I/usr/local/include -c drivers.c -o drivers.o
    34drivers.c: In function ‘get_ifcount’:
     
    56drivers.c: In function ‘get_ifdata’:
    67drivers.c:612: warning: passing argument 4 of ‘sysctl’ from incompatible pointer type
     8}}}
    79
    810but, once installed, the program gives the following error
     11{{{
    912$ ./ifstat
    1013ifstat: sysctl(net.link.generic.ifmib.ifcount): Bad address
    1114ifstat: no interfaces to monitor!
     15}}}
    1216
    1317The issue seems related to a wrong use of sysctl syscall: they pass an integer instead of a size_t, with 32 bit gcc the two types have the same size, but with 64 bit gcc the size_t variables are 64bit long (instead of 32bit).