From 21368dc7b4e3e9b5c8dd13ba5d2964ec523a070e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira?= Date: Fri, 24 Nov 2023 08:46:25 -0300 Subject: [PATCH] Don't include linux/ header in osdSockUnsentCount. Per the manpage in the file's comment, SIOCOUTQ is equivalent to the TIOCOUTQ ioctl, whose value can be obtained by including , which allows us to avoid including any system-specific headers. This is desirable so that, on a musl system, it won't be necessary to install kernel headers in order to build epics-base. Since it's first been checked into Git, the Linux kernel has defined SIOCOUTQ to be TIOCOUTQ [1]. From the three main libc options on Linux: glibc and uclibc use the kernel headers, so both ioctls are available; and musl defines only TIOCOUTQ in their own headers. [1] https://github.com/torvalds/linux/commit/1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 --- modules/libcom/src/osi/os/Linux/osdSockUnsentCount.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/libcom/src/osi/os/Linux/osdSockUnsentCount.c b/modules/libcom/src/osi/os/Linux/osdSockUnsentCount.c index 532b08b4e..36d10cc3a 100644 --- a/modules/libcom/src/osi/os/Linux/osdSockUnsentCount.c +++ b/modules/libcom/src/osi/os/Linux/osdSockUnsentCount.c @@ -4,7 +4,6 @@ * in file LICENSE that is included with this distribution. \*************************************************************************/ -#include #define EPICS_PRIVATE_API #include "osiSock.h" @@ -14,7 +13,7 @@ */ int epicsSocketUnsentCount(SOCKET sock) { int unsent; - if (ioctl(sock, SIOCOUTQ, &unsent) == 0) + if (ioctl(sock, TIOCOUTQ, &unsent) == 0) return unsent; return -1; }