Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Apr 2013 10:07:24 +0200
From:      Steve Read <steve.read@netasq.com>
To:        freebsd-net@freebsd.org
Subject:   Re: using netmap
Message-ID:  <517A35BC.4060305@netasq.com>
In-Reply-To: <CAEW%2Boga-KRRtNmKOGQGwXhJLva1BQp%2BQ3WJ0TpXoEotRTapTag@mail.gmail.com>
References:  <CAEW%2BogbOG1E8i88v%2B9ChJGHbstx6JQXMg82cEPqbbFvfDztM4A@mail.gmail.com> <CAPS9%2BSufmM7MM2wVs6hM8xipEess2PB3t-i39_S1XUo7aCosEA@mail.gmail.com> <CAEW%2BogZo7Se1CcGz%2BXwK5v80ns0vrUif=WTwNwTGxv2jVaY1=Q@mail.gmail.com> <CAF6rxg=dQ_-MNNwtMBT%2BR=jjo5SN350d6hVAM0hecPceod8F-Q@mail.gmail.com> <CAEW%2Boga-KRRtNmKOGQGwXhJLva1BQp%2BQ3WJ0TpXoEotRTapTag@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?517A35BC.4060305>