Meino Christian Cramer wrote:
Hi,
sorry for being off topic, but I think, folks of this list have the
knowledge to answer my question and I have no idea who to ask else...
I need to check from within a C-program whether the computer, the
program is running on (OS: Linux), is connected to the ethernet. The
program is running under root privilege. Before doing anything else
with eth0, I want to check the link-LED of the ethernet card...so to
say.
I sthere any "legal" way to do such things under Linux?
Thank you very much for any help and your understanding for my
situation.
Kind regards,
mcc
mii-tool can detect the status of an ethernet link, though last I
checked it did not work for 1Gbps connections. Perhaps you can look at
its source, and figure out how it is doing it.
--
gentoo-user@gentoo.org mailing list