version 1.17, 2004/10/17 20:39:17
|
version 1.23, 2006/08/09 21:12:42
|
|
|
//%2004//////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development | // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. | // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
|
// IBM Corp.; EMC Corporation, The Open Group. | // IBM Corp.; EMC Corporation, The Open Group. |
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; | // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; |
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. | // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
#define Pegasus_Signal_h | #define Pegasus_Signal_h |
| |
#include <Pegasus/Common/Linkage.h> | #include <Pegasus/Common/Linkage.h> |
#include <Pegasus/Common/IPC.h> |
#include <Pegasus/Common/Mutex.h> |
| |
// // Ensure Unix 98 | // // Ensure Unix 98 |
// #ifdef PEGASUS_PLATFORM_LINUX_IX86_GNU | // #ifdef PEGASUS_PLATFORM_LINUX_IX86_GNU |
|
|
| |
// these functions should throw exceptions | // these functions should throw exceptions |
| |
void registerHandler(Uint32 signum, signal_handler _sighandler); |
void registerHandler(unsigned signum, signal_handler _sighandler); |
| |
void activate(Uint32 signum); |
void activate(unsigned signum); |
| |
//void activateAll(); | //void activateAll(); |
| |
void deactivate(Uint32 signum); |
void deactivate(unsigned signum); |
| |
void deactivateAll(); | void deactivateAll(); |
| |
static void ignore(Uint32 signum); |
static void ignore(unsigned signum); |
| |
private: | private: |
| |
#ifdef PEGASUS_HAS_SIGNALS | #ifdef PEGASUS_HAS_SIGNALS |
|
enum |
|
{ |
|
PEGASUS_NSIG = 32 |
|
}; |
|
|
|
static void verifySignum(unsigned signum); |
|
|
typedef struct { | typedef struct { |
|
int signum; |
int active; | int active; |
signal_handler sh; | signal_handler sh; |
struct sigaction oldsa; | struct sigaction oldsa; |
} register_handler; | } register_handler; |
| |
register_handler reg_handler[32]; |
register_handler reg_handler[PEGASUS_NSIG + 1]; |
Mutex reg_mutex; | Mutex reg_mutex; |
| |
void deactivate_i(Uint32 signum); |
void deactivate_i(register_handler &rh); |
|
|
|
register_handler &getHandler(unsigned sigum); |
#endif | #endif |
| |
}; | }; |