From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1921) id 786E9385414D; Mon, 11 Jul 2022 11:52:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 786E9385414D Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Sebastian Huber To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] add SIOCGIFDATA ioctl X-Act-Checkin: newlib-cygwin X-Git-Author: Ed Maste X-Git-Refname: refs/heads/master X-Git-Oldrev: 7b30b9f648a25f3b615730864ddc86a433a93333 X-Git-Newrev: 9dd91a8330a968aaf970d32dd3a72f1e5dd72b43 Message-Id: <20220711115244.786E9385414D@sourceware.org> Date: Mon, 11 Jul 2022 11:52:44 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2022 11:52:44 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D9dd91a8330a= 968aaf970d32dd3a72f1e5dd72b43 commit 9dd91a8330a968aaf970d32dd3a72f1e5dd72b43 Author: Ed Maste Date: Mon Sep 28 16:54:39 2020 +0000 add SIOCGIFDATA ioctl =20 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. =20 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. =20 Submitted by: Roy Marples Reviewed by: markj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D26538 Diff: --- 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/r= tems/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 */=20 #define SIOCGIFDESCR _IOWR('i', 42, struct ifreq) /* get ifnet descr */=20 #define SIOCAIFADDR _IOW('i', 43, struct ifaliasreq)/* add/chg IF alias */ +#define SIOCGIFDATA _IOW('i', 44, struct ifreq) /* get if_data */ =20 #define SIOCADDMULTI _IOW('i', 49, struct ifreq) /* add m'cast addr */ #define SIOCDELMULTI _IOW('i', 50, struct ifreq) /* del m'cast addr */