While searching for ways to obtain various WiFi information, I found
/sys/class/net/wlan7/speed file. Problem is, even though all read permissions are granted, I can't read it.
$ ls -l /sys/class/net/wlan7/speed -r--r--r-- 1 root root 4096 3月 24 15:08 /sys/class/net/wlan7/speed $ sudo cat /sys/class/net/wlan7/speed [sudo] password for xieerqi: cat: /sys/class/net/wlan7/speed: Invalid argument
I can stat the file, I can list with
ls, but every time I try to read it ( with
cat, with Python in binary reading mode, etc. ) it shows invalid argument error.
strace shows that error apparently occurs at this point:
read(3, 0x7f6ad6b44000, 131072) = -1 EINVAL (Invalid argument) write(2, "cat: ", 5cat: ) = 5 write(2, "/sys/class/net/wlan7/speed", 26/sys/class/net/wlan7/speed) = 26 open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 4
( link to full trace paste: http://paste.ubuntu.com/24252504/ )
By contrast , the corresponding file for the ethernet interface works:
$ cat /sys/class/net/eth3/speed 10
So basically my question is this: how do I read this file ?
OS: Ubuntu 16.04 LTS, kernel 4.4.0-67-generic , AR9565 WiFi adapter