use EPICS_PRIVATE_API macro and fix bug with darwin/ios

This commit is contained in:
2019-10-04 14:32:07 +02:00
committed by Martin Konrad
parent 6f193242e0
commit d2d8674cb9
7 changed files with 12 additions and 2 deletions

View File

@@ -21,6 +21,7 @@
#include <string.h>
#include <stdio.h>
#define EPICS_PRIVATE_API
#define epicsExportSharedSymbols
#include "dbDefs.h"
#include "epicsEvent.h"

View File

@@ -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;
}

View File

@@ -4,6 +4,7 @@
\*************************************************************************/
#include <linux/sockios.h>
#define EPICS_PRIVATE_API
#include "osiSock.h"
/*

View File

@@ -4,6 +4,7 @@
\*************************************************************************/
#define epicsExportSharedSymbols
#define EPICS_PRIVATE_API
#include "osiSock.h"
#include <mstcpip.h>

View File

@@ -3,6 +3,7 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#define EPICS_PRIVATE_API
#include "osiSock.h"
/*

View File

@@ -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;
}

View File

@@ -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