Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.


  Search this Thread
Old 02-16-2004, 12:47 PM   #1
LQ Newbie
Registered: Feb 2004
Posts: 2

Rep: Reputation: 0
Ioctl() call fails


When I'm trying to use an ioctl()-call with a definition of the wireless extension (eg. SIOCGIWSTATS or SIOCGIWESSID) I allways get an errormessage saying "Operation not supported". But an outpout from /proc/net/wireless gives resonable results.
Furthermore, Iwpriv returns a list of private ioctls supported by my wavelan turbo 11Mb silver, so it doesn't seemt to be a driver problem?!

Anyone got an Idea what the pb is? Below is the code I use for testing.

//------------------ CODE ----------------------//
#include <stdio.h>
#include <string.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <linux/netdevice.h>
#include <linux/wireless.h>
#include <sys/ioctl.h>

struct iw_statistics stats;
static int skfd = 0;

int wlanStats()
struct iwreq wrq;
if(skfd == 0) {
if((skfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
return -1;
} = (caddr_t) &stats; = 0; = 1;
strncpy(wrq.ifr_name, "eth0", 16);

if(ioctl(skfd, SIOCGIWSTATS, &wrq) < 0) {
perror("iotcl call");
return -1;
return 0;

main() {



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wvdial failing on ioctl call as regular user mugwump84 Linux - Software 3 11-27-2005 01:01 PM
dm driver ioctl call tantrix Programming 0 05-16-2005 06:50 PM
What do you call your remote control? I call mine... RHLinuxGUY General 19 10-18-2004 06:23 AM
Sockets : Getaddrinfo call fails abrb220 Programming 2 06-06-2004 11:26 PM
Samba 2.2.7a fails to call add user script on Red Hat 9 DrFooMod2 Linux - Networking 4 07-17-2003 09:33 PM > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 09:46 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration