Here's number 4 - ENODEV, in addition to EOPNOTSUPP and EINVAL and
ENOTTY.
memset(&req, 0, sizeof(req));
strncpy(req.ifm_name, name, sizeof(req.ifm_name));
if (ioctl(sock, SIOCGIFMEDIA, &req) < 0) {
- if (errno == EOPNOTSUPP || errno == EINVAL || errno == ENOTTY) {
+ if (errno == EOPNOTSUPP || errno == EINVAL || errno == ENOTTY ||
+ errno == ENODEV) {
/*
* Not supported, so we can't provide any
* additional information. Assume that