Did you try to run your program as root, with su or sudo?
eg:
~ sudo yourprogram
or
~ su
~ yourprogram


On Fri, May 30, 2014 at 10:58 AM, A P <[email protected]> wrote:
>
>
> Hi,
>
> System setup :
>
> Beaglebone Black with Debian from SD card, Ethernet and Wifi. Cross
> compiling on Windows 7 machine.
> Running program in debug mode via Eclipse (Win7) using gdb as debugger
>
> Problem:
> I am writing an application that requires ethernet and wifi (via usb) on the
> beaglebone black. My problem is that I need to point some TCP sockets to the
> Ethernet port but by default Linux os decides what is best so chooses wifi!
> So to get around this I use
>
> struct ifreq ifr;
> memset(&ifr, 0, sizeof(ifr));
> snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), interface);
>
> ioctl(TsocketId, SIOCGIFINDEX, &ifr);
> error = setsockopt(socketId, SOL_SOCKET, SO_BINDTODEVICE,  (void*)&ifr,
> sizeof(ifr));
>
>
> However setsockopt always returns an error EPERM which is Operation Not
> Permitted (or similar). I have tried the simpler form of passing 'eth0' in,
> also with the same results.
>
> After much reading on the internet it appears that I need extra rights to
> run this command.
>
> I am struggling at this point
>
> I have set the file permissions to include chmod u+s           --- made no
> difference
> I have edited sudoers to give admin users sudo privileges  (I believe my
> debian user is one as now I don't have to enter a password everytime I type
> sudo..)
>
> # Members of the admin group may gain root privileges
> %admin  ALL=(ALL) NOPASSWD:ALL
>
> This also made no difference.
>
> My application is running under the debian user
>
> Any help much appreciated..
>
> A P
>
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to