First of all, thanks for all replies.
I had tried ethwireck, but it cannot detect my ethernet cable. It gives me the error as follow:
Code:
christyyim@christyyim-laptop:~/Desktop/ethwireck-1.2$ ./ethwireck -v
ETHTOOL_GLINK failed: Operation not permitted
SIOCGMIIPHY on eth0 failed: Operation not permitted
SIOCDEVPRIVATE on eth0 failed: Operation not supported
eth0: could not determine status
Besides that, I had tried ethtool in the terminal, but I need to type sudo to get the information:
PHP Code:
sudo ethtool eth0
and this will require my password and i cannot use the "popen" command in my C program in this case. And for your information, I am a beginner in programming
, quite a big task for me to port the source code from ethtool into my program since when I tried just now, I cannot link some of their header files and libraries, keep giving me a lot of error
So I wonder is there other method for me to detect the Ethernet cable?
Thanks in advance.
Christyyim