From owner-freebsd-net@FreeBSD.ORG Fri Apr 26 08:13:01 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CBE94CE7 for ; Fri, 26 Apr 2013 08:13:01 +0000 (UTC) (envelope-from steve.read@netasq.com) Received: from work.netasq.com (gwlille.netasq.com [91.212.116.1]) by mx1.freebsd.org (Postfix) with ESMTP id 959BB14F6 for ; Fri, 26 Apr 2013 08:13:01 +0000 (UTC) Received: from work.netasq.com (localhost [127.0.0.1]) by work.netasq.com (Postfix) with ESMTP id 43B6B27063A8 for ; Fri, 26 Apr 2013 10:07:25 +0200 (CEST) Received: from stever.netasq.com (unknown [10.2.0.1]) by work.netasq.com (Postfix) with ESMTPA id 0760327045DF for ; Fri, 26 Apr 2013 10:07:25 +0200 (CEST) Message-ID: <517A35BC.4060305@netasq.com> Date: Fri, 26 Apr 2013 10:07:24 +0200 From: Steve Read User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130305 Thunderbird/17.0.3 MIME-Version: 1.0 To: freebsd-net@freebsd.org Subject: Re: using netmap References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 08:13:01 -0000 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