using netmap

Steve Read steve.read at netasq.com
Fri Apr 26 08:13:01 UTC 2013


On 26.04.2013 08:23, Sami Halabi wrote:
> Hi Eitan,
> Thank your for your response.
> the ioctl is the example was in Luigi netmap page... maybe Luigi can help
> here???????
>
> can you say why the print's are wrong?
They print the addresses of the variables, not their values.

int i = 1234;

printf("i=%d\n", &i); /* Note the &, prints the address of i, or not, at its whim */

printf("i=%d\n", i);  /* Note no &, prints the value of i */


I say "at its whim" because once you have a mismatch between the type 
requested (%d requests int) and the type provided (&i provides int *), 
you are in the terrain of undefined behaviour, and **ANYTHING** can 
happen.  Be glad you aren't running on the notoriously twitchy 
DeathStation 9000.

-- Steve



More information about the freebsd-net mailing list