From 9dd91a8330a968aaf970d32dd3a72f1e5dd72b43 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Mon, 28 Sep 2020 16:54:39 +0000 Subject: [PATCH] add SIOCGIFDATA ioctl For interfaces that do not support SIOCGIFMEDIA (for which there are quite a few) the only fallback is to query the interface for if_data->ifi_link_state. While it's possible to get at if_data for an interface via getifaddrs(3) or sysctl, both are heavy weight mechanisms. SIOCGIFDATA is a simple ioctl to retrieve this fast with very little resource use in comparison. This implementation mirrors that of other similar ioctls in FreeBSD. Submitted by: Roy Marples Reviewed by: markj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D26538 --- newlib/libc/sys/rtems/include/sys/sockio.h | 1 + 1 file changed, 1 insertion(+) diff --git a/newlib/libc/sys/rtems/include/sys/sockio.h b/newlib/libc/sys/rtems/include/sys/sockio.h index 447e2c884..03502d770 100644 --- a/newlib/libc/sys/rtems/include/sys/sockio.h +++ b/newlib/libc/sys/rtems/include/sys/sockio.h @@ -83,6 +83,7 @@ #define SIOCSIFDESCR _IOW('i', 41, struct ifreq) /* set ifnet descr */ #define SIOCGIFDESCR _IOWR('i', 42, struct ifreq) /* get ifnet descr */ #define SIOCAIFADDR _IOW('i', 43, struct ifaliasreq)/* add/chg IF alias */ +#define SIOCGIFDATA _IOW('i', 44, struct ifreq) /* get if_data */ #define SIOCADDMULTI _IOW('i', 49, struct ifreq) /* add m'cast addr */ #define SIOCDELMULTI _IOW('i', 50, struct ifreq) /* del m'cast addr */