(file) Return to Signal.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

  1 kumpf 1.5 //%/////////////////////////////////////////////////////////////////////////////
  2           //
  3           // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
  4           // The Open Group, Tivoli Systems
  5 mike  1.2 //
  6           // Permission is hereby granted, free of charge, to any person obtaining a copy
  7           // of this software and associated documentation files (the "Software"), to
  8           // deal in the Software without restriction, including without limitation the
  9           // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 10           // sell copies of the Software, and to permit persons to whom the Software is
 11           // furnished to do so, subject to the following conditions:
 12 kumpf 1.5 // 
 13 mike  1.2 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 14           // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 15           // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 16           // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 17           // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 18           // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 19           // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 20           // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 21           //
 22           //==============================================================================
 23           //
 24           // Author: Markus Mueller (markus_mueller@de.ibm.com
 25           //
 26           // Modified By: 
 27           //
 28           //%/////////////////////////////////////////////////////////////////////////////
 29           
 30           
 31           #ifndef Pegasus_SignalHandler_h
 32           #define Pegasus_SignalHandler_h
 33           
 34 mike  1.3 // REVIEW: Where is this signal handling code used?
 35           
 36           // REVIEW: Is there an equivalent implementation for Windows?
 37           
 38           
 39 mike  1.2 // // Ensure Unix 98
 40           // #ifdef PEGASUS_PLATFORM_LINUX_IX86_GNU
 41           //    #ifndef _GNU_SOURCE
 42           //       #define _GNU_SOURCE
 43           //    #endif
 44           // #else
 45           //    #ifdef _XOPEN_SOURCE
 46           //       #undef _XOPEN_SOURCE
 47           //    #endif
 48           //    #define _XOPEN_SOURCE 600
 49           // #endif
 50           
 51           #include <signal.h>
 52           
 53 sage  1.6 #if defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)
 54           extern "C" {
 55           #endif
 56           
 57 mike  1.2 typedef void (* signal_handler)(int,siginfo_t *,void *);
 58           
 59           typedef struct {
 60               int active;
 61               signal_handler sh;
 62               struct sigaction oldsa;
 63           } register_handler;
 64 sage  1.6 
 65           #if defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)
 66           }
 67           #endif
 68 mike  1.2 
 69           #include <Pegasus/Common/Thread.h>
 70           #include <Pegasus/Common/DQueue.h>
 71 kumpf 1.8 #include <Pegasus/Common/InternalException.h>
 72 kumpf 1.7 #include <Pegasus/Common/Linkage.h>
 73 mike  1.2 
 74           // used locally as standard response to stop the failing thread normally
 75           void sig_act(int s_n, siginfo_t * s_info, void * sig);
 76           // test routine, that just causes a segmentation fault
 77           void * segmentation_faulter(void * parm);
 78           
 79           PEGASUS_NAMESPACE_BEGIN
 80           
 81           class PEGASUS_COMMON_LINKAGE SignalHandler
 82           {
 83              public:
 84                 SignalHandler();
 85           
 86                 ~SignalHandler(); // deactivate all registered handlers
 87           
 88                 // these functions should throw exceptions
 89           
 90                 void registerHandler(Uint32 signum, signal_handler _sighandler);
 91           
 92                 void activate(Uint32 signum);
 93           
 94 mike  1.2       //void activateAll();
 95           
 96                 void deactivate(Uint32 signum);
 97           
 98                 void deactivateAll();
 99           
100                 static void ignore(Uint32 signum);
101           
102              private:
103           
104                 register_handler reg_handler[32];
105                 Mutex reg_mutex;
106           
107                 void deactivate_i(Uint32 signum);
108           
109           };
110           
111           SignalHandler * getSigHandle();
112           
113           PEGASUS_NAMESPACE_END
114           
115 mike  1.2 #endif // Pegasus_SignalHandler_h

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2