diff --git a/src/libCom/log/logClient.c b/src/libCom/log/logClient.c index 73664ff76..9a09ef7b7 100644 --- a/src/libCom/log/logClient.c +++ b/src/libCom/log/logClient.c @@ -21,6 +21,7 @@ #include #include +#define EPICS_PRIVATE_API #define epicsExportSharedSymbols #include "dbDefs.h" #include "epicsEvent.h" diff --git a/src/libCom/osi/os/Darwin/osdSockUnsentCount.c b/src/libCom/osi/os/Darwin/osdSockUnsentCount.c index 00ef550bd..20bd82b14 100644 --- a/src/libCom/osi/os/Darwin/osdSockUnsentCount.c +++ b/src/libCom/osi/os/Darwin/osdSockUnsentCount.c @@ -3,6 +3,7 @@ * in file LICENSE that is included with this distribution. \*************************************************************************/ +#define EPICS_PRIVATE_API #include "osiSock.h" /* @@ -11,7 +12,8 @@ */ int epicsSocketUnsentCount(SOCKET sock) { int unsent; - if (getsockopt(sock, SOL_SOCKET, SO_NWRITE, &unsent) == 0) + socklen_t len = sizeof(unsent); + if (getsockopt(sock, SOL_SOCKET, SO_NWRITE, &unsent, &len) == 0) return unsent; return -1; } diff --git a/src/libCom/osi/os/Linux/osdSockUnsentCount.c b/src/libCom/osi/os/Linux/osdSockUnsentCount.c index 6f6cbf0fe..3c0a8f915 100644 --- a/src/libCom/osi/os/Linux/osdSockUnsentCount.c +++ b/src/libCom/osi/os/Linux/osdSockUnsentCount.c @@ -4,6 +4,7 @@ \*************************************************************************/ #include +#define EPICS_PRIVATE_API #include "osiSock.h" /* diff --git a/src/libCom/osi/os/WIN32/osdSockUnsentCount.c b/src/libCom/osi/os/WIN32/osdSockUnsentCount.c index c2045bc79..fe68ead01 100644 --- a/src/libCom/osi/os/WIN32/osdSockUnsentCount.c +++ b/src/libCom/osi/os/WIN32/osdSockUnsentCount.c @@ -4,6 +4,7 @@ \*************************************************************************/ #define epicsExportSharedSymbols +#define EPICS_PRIVATE_API #include "osiSock.h" #include diff --git a/src/libCom/osi/os/default/osdSockUnsentCount.c b/src/libCom/osi/os/default/osdSockUnsentCount.c index 61094c710..ef01e9b24 100644 --- a/src/libCom/osi/os/default/osdSockUnsentCount.c +++ b/src/libCom/osi/os/default/osdSockUnsentCount.c @@ -3,6 +3,7 @@ * in file LICENSE that is included with this distribution. \*************************************************************************/ +#define EPICS_PRIVATE_API #include "osiSock.h" /* diff --git a/src/libCom/osi/os/iOS/osdSockUnsentCount.c b/src/libCom/osi/os/iOS/osdSockUnsentCount.c index 00ef550bd..20bd82b14 100644 --- a/src/libCom/osi/os/iOS/osdSockUnsentCount.c +++ b/src/libCom/osi/os/iOS/osdSockUnsentCount.c @@ -3,6 +3,7 @@ * in file LICENSE that is included with this distribution. \*************************************************************************/ +#define EPICS_PRIVATE_API #include "osiSock.h" /* @@ -11,7 +12,8 @@ */ int epicsSocketUnsentCount(SOCKET sock) { int unsent; - if (getsockopt(sock, SOL_SOCKET, SO_NWRITE, &unsent) == 0) + socklen_t len = sizeof(unsent); + if (getsockopt(sock, SOL_SOCKET, SO_NWRITE, &unsent, &len) == 0) return unsent; return -1; } diff --git a/src/libCom/osi/osiSock.h b/src/libCom/osi/osiSock.h index e1c2de881..6e3b053c5 100644 --- a/src/libCom/osi/osiSock.h +++ b/src/libCom/osi/osiSock.h @@ -52,12 +52,14 @@ enum epicsSocketSystemCallInterruptMechanismQueryInfo { epicsShareFunc enum epicsSocketSystemCallInterruptMechanismQueryInfo epicsSocketSystemCallInterruptMechanismQuery (); +#ifdef EPICS_PRIVATE_API /* * Some systems (e.g Linux and Windows 10) allow to check the amount * of unsent data in the output queue. * Returns -1 if the information is not available. */ epicsShareFunc int epicsSocketUnsentCount(SOCKET sock); +#endif /* * convert socket address to ASCII in this order