How to detect the network cable status with c programming on AIX

Hello,

Is there any API or any other approach to detect whether the network cable is connected to the network adapter, say, en0, en1 or en2?

The OS is AIX6.1.

Thank you.

Often, the man page for a command will refer to the system call that got the information. If all else fails, popen() your favorite network status command and parse the output.

Disclaimer: I have absolutely no experience with AIX.

Most systems provide this type of information via ioctl on a socket fd.

Regards,
Alister

Running a command that gets what you want through strace/truss/tusc can tell you what it called.

I am not sure about API but you could entstat command
like entstat -d ent0 |grep Status