From 1af30b1d4864b2d140186b3828d02bacb7f8313b Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 23 Oct 2002 22:17:11 +0000 Subject: [PATCH] interrupted system call interface --- src/libCom/osi/osiSock.c | 12 ++++++++++++ src/libCom/osi/osiSock.h | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/libCom/osi/osiSock.c b/src/libCom/osi/osiSock.c index c37488582..939ef53c5 100644 --- a/src/libCom/osi/osiSock.c +++ b/src/libCom/osi/osiSock.c @@ -21,6 +21,7 @@ #define epicsExportSharedSymbols #include "epicsAssert.h" +#include "epicsSignal.h" #include "osiSock.h" #define nDigitsDottedIP 4u @@ -167,3 +168,14 @@ void epicsShareAPI ipAddrToDottedIP } } +epicsShareFunc void epicsShareAPI epicsSocketEnableInterruptedSystemCall () +{ + epicsSignalInstallSigUrgIgnore (); +} + +epicsShareFunc void epicsShareAPI epicsSocketInterruptSystemCall + ( struct epicsThreadOSD * threadId ) +{ + epicsSignalRaiseSigUrg ( threadId ); +} + diff --git a/src/libCom/osi/osiSock.h b/src/libCom/osi/osiSock.h index cab9ca944..93070f06a 100644 --- a/src/libCom/osi/osiSock.h +++ b/src/libCom/osi/osiSock.h @@ -166,6 +166,16 @@ epicsShareFunc void epicsShareAPI osiSockDiscoverBroadcastAddresses */ epicsShareFunc osiSockAddr epicsShareAPI osiLocalAddr (SOCKET socket); + +/* + * Certain os, such as HPUX, do not unblock a socket system call + * when another thread asynchronously calls both shutdown() and + * close(). To solve this problem we need to employ OS specific + * mechanisms. + */ +epicsShareFunc void epicsShareAPI epicsSocketEnableInterruptedSystemCall (); +epicsShareFunc void epicsShareAPI epicsSocketInterruptSystemCall ( struct epicsThreadOSD * ); + #ifdef __cplusplus } #endif