[MacPorts] #21088: sysutils/ifstat compiles but do not work on snow leopard

MacPorts noreply at macports.org
Fri Sep 4 10:53:34 PDT 2009


#21088: sysutils/ifstat compiles but do not work on snow leopard
---------------------------------+------------------------------------------
 Reporter:  mpapamanz@…          |       Owner:  macports-tickets@…                   
     Type:  defect               |      Status:  new                                  
 Priority:  Normal               |   Milestone:                                       
Component:  ports                |     Version:  1.8.0                                
 Keywords:                       |        Port:  ifstat                               
---------------------------------+------------------------------------------
Changes (by snc@…):

  * port:  => ifstat


Old description:

> When compiled on snow leopard there are just two warning:
> gcc -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
> drivers.c: In function ‘get_ifcount’:
> drivers.c:599: warning: passing argument 4 of ‘sysctl’ from incompatible
> pointer type
> drivers.c: In function ‘get_ifdata’:
> drivers.c:612: warning: passing argument 4 of ‘sysctl’ from incompatible
> pointer type
>
> but, once installed, the program gives the following error
> $ ./ifstat
> ifstat: sysctl(net.link.generic.ifmib.ifcount): Bad address
> ifstat: no interfaces to monitor!
>
> The 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).

New description:

 When compiled on snow leopard there are just two warning:
 {{{
 gcc -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
 drivers.c: In function ‘get_ifcount’:
 drivers.c:599: warning: passing argument 4 of ‘sysctl’ from incompatible
 pointer type
 drivers.c: In function ‘get_ifdata’:
 drivers.c:612: warning: passing argument 4 of ‘sysctl’ from incompatible
 pointer type
 }}}

 but, once installed, the program gives the following error
 {{{
 $ ./ifstat
 ifstat: sysctl(net.link.generic.ifmib.ifcount): Bad address
 ifstat: no interfaces to monitor!
 }}}

 The 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).

--

-- 
Ticket URL: <http://trac.macports.org/ticket/21088#comment:1>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list