EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: POSIX signals in Epics
From: Andrew Johnson <[email protected]>
To: [email protected]
Date: Fri, 10 Jul 2009 11:02:46 -0500
Hi Matthew,

On Friday 10 July 2009 04:22:35 Pearson, MR (Matthew) wrote:
>
> What is the recommended way to install POSIX signal handlers in Epics?
> What I want to do is handle SIGINT and SIGTERM signals, and to perform
> some shutdown tasks before the process terminates. Is there is an Epics
> OSI method I can use? Otherwise I will just use the normal POSIX
> methods.

No, there would be little point in just wrapping the Posix APIs since the 
underlying mechanisms might be rather different on an OS that doesn't provide 
those.

On architectures that support Posix signals we install handlers for SIGHUP and 
SIGPIPE, and for SIGALRM up to R3.14.10 (but that interferes with the 
implementation of the Posix timers API on Linux which is why we're dropping 
it in R3.14.11).  Our code is in base/src/libCom/osi/os/posix/osdSignal.cpp 
but I would caution you against directly copying what we do because we 
register a single argument sa_handler whereas you might prefer to use a 3 
argument sa_sigaction handler instead.

> This is for a linux device driver. It's unlikely that the driver will be
> portable to other platforms (because it relies on a manufacturer Linux
> only SDK). So I'm only asking for good-practice reasons, rather than
> portability reasons.

Good practice would be just to follow the Posix and Linux standards.

- Andrew
-- 
The best FOSS code is written to be read by other humans -- Harold Welte

References:
POSIX signals in Epics Pearson, MR (Matthew)

Navigate by Date:
Prev: POSIX signals in Epics Pearson, MR (Matthew)
Next: RE: [APS Beamline_controls] Access to IO registers from user-spacein recent Linux versions Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: POSIX signals in Epics Pearson, MR (Matthew)
Next: DB CA link to PROC field Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 31 Jan 2014 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·