Changes between Initial Version and Version 1 of Ticket #21088
- Timestamp:
- Sep 4, 2009, 5:53:34 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #21088
- Property Port ifstat added
-
Ticket #21088 – Description
initial v1 1 1 When compiled on snow leopard there are just two warning: 2 {{{ 2 3 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 3 4 drivers.c: In function ‘get_ifcount’: … … 5 6 drivers.c: In function ‘get_ifdata’: 6 7 drivers.c:612: warning: passing argument 4 of ‘sysctl’ from incompatible pointer type 8 }}} 7 9 8 10 but, once installed, the program gives the following error 11 {{{ 9 12 $ ./ifstat 10 13 ifstat: sysctl(net.link.generic.ifmib.ifcount): Bad address 11 14 ifstat: no interfaces to monitor! 15 }}} 12 16 13 17 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).