+= epicsSignalInstallSigHupIgnore (libCom/osi)

This commit is contained in:
Ralph Lange
2008-04-17 18:57:07 +00:00
parent 7e31cb0db3
commit 60449e20b0
6 changed files with 78 additions and 44 deletions

View File

@@ -1,13 +1,11 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifdef __cplusplus
@@ -23,6 +21,12 @@ extern "C" {
struct epicsThreadOSD;
/*
* Required to avoid problems with soft IOCs getting SIGHUPs when a
* Channel Access client disconnects
*/
epicsShareFunc void epicsShareAPI epicsSignalInstallSigHupIgnore ( void );
/*
* Required to avoid terminating a process which is blocking in a
* socket send() call when the SIGPIPE signal is generated by the OS.

View File

@@ -1,11 +1,11 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#define epicsExportSharedSymbols
@@ -14,6 +14,7 @@
/*
* All NOOPs if the os isnt POSIX
*/
epicsShareFunc void epicsShareAPI epicsSignalInstallSigHupIgnore ( void ) {}
epicsShareFunc void epicsShareAPI epicsSignalInstallSigPipeIgnore ( void ) {}
epicsShareFunc void epicsShareAPI epicsSignalInstallSigAlarmIgnore ( void ) {}
epicsShareFunc void epicsShareAPI epicsSignalRaiseSigAlarm ( struct epicsThreadOSD * /* threadId */ ) {}

View File

@@ -1,11 +1,11 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#define epicsExportSharedSymbols
@@ -14,6 +14,7 @@
/*
* NOOP
*/
epicsShareFunc void epicsShareAPI epicsSignalInstallSigHupIgnore ( void ) {}
epicsShareFunc void epicsShareAPI epicsSignalInstallSigPipeIgnore ( void ) {}
epicsShareFunc void epicsShareAPI epicsSignalInstallSigAlarmIgnore ( void ) {}
epicsShareFunc void epicsShareAPI epicsSignalRaiseSigAlarm ( struct epicsThreadOSD * /* threadid */ ) {}

View File

@@ -1,11 +1,11 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#define epicsExportSharedSymbols
@@ -14,6 +14,7 @@
/*
* All NOOPs if the os isnt POSIX
*/
epicsShareFunc void epicsShareAPI epicsSignalInstallSigHupIgnore ( void ) {}
epicsShareFunc void epicsShareAPI epicsSignalInstallSigPipeIgnore ( void ) {}
epicsShareFunc void epicsShareAPI epicsSignalInstallSigAlarmIgnore ( void ) {}
epicsShareFunc void epicsShareAPI epicsSignalRaiseSigAlarm ( struct epicsThreadOSD * /* threadId */ ) {}

View File

@@ -1,11 +1,11 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -26,6 +26,7 @@ extern "C" {
typedef void ( *pSigFunc ) ( int );
}
static pSigFunc pReplacedSigHupFunc = 0;
static pSigFunc pReplacedSigPipeFunc = 0;
static pSigFunc pReplacedSigAlarmFunc = 0;
@@ -63,6 +64,22 @@ static void localInstallSigHandler ( int signalIn, pSigFunc pNewFunc,
assert ( ! status );
}
/*
* ignoreSigHup ()
*/
extern "C" {
static void ignoreSigHup ( int signal )
{
static volatile int reentered = 1;
if (--reentered == 0) {
if ( pReplacedSigHupFunc ) {
( *pReplacedSigHupFunc ) ( signal );
}
}
}
}
/*
* ignoreSigPipe ()
*/
@@ -96,6 +113,15 @@ static void ignoreSigAlarm ( int signal )
}
}
/*
* epicsSignalInstallSigHupIgnore ()
*/
epicsShareFunc void epicsShareAPI epicsSignalInstallSigHupIgnore (void)
{
localInstallSigHandler ( SIGHUP,
ignoreSigHup, & pReplacedSigHupFunc );
}
/*
* epicsSignalInstallSigPipeIgnore ()
*/

View File

@@ -1,11 +1,11 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#define epicsExportSharedSymbols
@@ -14,6 +14,7 @@
/*
* NOOP
*/
epicsShareFunc void epicsShareAPI epicsSignalInstallSigHupIgnore ( void ) {}
epicsShareFunc void epicsShareAPI epicsSignalInstallSigPipeIgnore ( void ) {}
epicsShareFunc void epicsShareAPI epicsSignalInstallSigAlarmIgnore ( void ) {}
epicsShareFunc void epicsShareAPI epicsSignalRaiseSigAlarm ( struct epicsThreadOSD * /* threadId */ ) {}