OS_NS_signal.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file   OS_NS_signal.h
00006  *
00007  *  OS_NS_signal.h,v 1.12 2006/01/23 22:20:25 shuston Exp
00008  *
00009  *  @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
00010  *  @author Jesper S. M|ller<stophph@diku.dk>
00011  *  @author and a cast of thousands...
00012  *
00013  *  Originally in OS.h.
00014  */
00015 //=============================================================================
00016 
00017 #ifndef ACE_OS_NS_SIGNAL_H
00018 # define ACE_OS_NS_SIGNAL_H
00019 
00020 # include /**/ "ace/pre.h"
00021 
00022 # include "ace/config-lite.h"
00023 
00024 # if !defined (ACE_LACKS_PRAGMA_ONCE)
00025 #  pragma once
00026 # endif /* ACE_LACKS_PRAGMA_ONCE */
00027 
00028 #include "ace/os_include/os_signal.h"
00029 #include "ace/ACE_export.h"
00030 
00031 #if defined (ACE_EXPORT_MACRO)
00032 #  undef ACE_EXPORT_MACRO
00033 #endif
00034 #define ACE_EXPORT_MACRO ACE_Export
00035 
00036 # if !defined (SIG_BLOCK)
00037 #   define SIG_BLOCK   1
00038 # endif /* SIG_BLOCK   */
00039 
00040 # if !defined (SIG_UNBLOCK)
00041 #   define SIG_UNBLOCK 2
00042 # endif /* SIG_UNBLOCK */
00043 
00044 # if !defined (SIG_SETMASK)
00045 #   define SIG_SETMASK 3
00046 # endif /* SIG_SETMASK */
00047 
00048 // Create some useful typedefs.
00049 
00050 # if !defined (ACE_HAS_SIGINFO_T)
00051 struct ACE_Export siginfo_t
00052 {
00053   siginfo_t (ACE_HANDLE handle);
00054   siginfo_t (ACE_HANDLE *handles);      // JCEJ 12/23/96
00055 
00056   /// Win32 HANDLE that has become signaled.
00057   ACE_HANDLE si_handle_;
00058 
00059   /// Array of Win32 HANDLEs all of which have become signaled.
00060   ACE_HANDLE *si_handles_;
00061 };
00062 # endif /* ACE_HAS_SIGINFO_T */
00063 
00064 #if !defined (ACE_WIN32)
00065 extern "C"
00066 {
00067   typedef void (*ACE_SIGNAL_C_FUNC)(int, siginfo_t *, void *);
00068 }
00069 #endif /* ACE_WIN32 */
00070 
00071 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00072 
00073 // This hack is needed to get around an odd and hard-to-reproduce problem
00074 // with HP aC++. If struct sigaction is defined extern "C" and the sigaction
00075 // function in namespace ACE_OS, the compiler sometimes gets confused.
00076 // If we help it with this typedef, it's fine. User code should not use
00077 // the ACE typedef - it will be removed without warning as soon as we can
00078 // either drop support for the broken compilers or figure out how to reproduce
00079 // it so it can be reported to HP and fixed.
00080 // There's a similar hack in OS_TLI.h for struct t_optmgmt.
00081 // Also see ChangeLog entries:
00082 // Mon Jan 23 16:35:40 UTC 2006  Steve Huston  <shuston@riverace.com>
00083 // Mon Jan 23 22:08:56 UTC 2006  Steve Huston  <shuston@riverace.com>
00084 #if defined (__HP_aCC) && (__HP_aCC <= 36500)
00085 typedef extern "C" struct sigaction  ACE_SIGACTION;
00086 #else
00087 typedef struct sigaction ACE_SIGACTION;
00088 #endif
00089 
00090 namespace ACE_OS {
00091 
00092   //@{ @name A set of wrappers for Signals.
00093 
00094   ACE_NAMESPACE_INLINE_FUNCTION
00095   int kill (pid_t pid,
00096             int signum);
00097 
00098   ACE_NAMESPACE_INLINE_FUNCTION
00099   int pthread_sigmask (int how,
00100                        const sigset_t *nsp,
00101                        sigset_t *osp);
00102 
00103   ACE_NAMESPACE_INLINE_FUNCTION
00104   int sigaction (int signum,
00105                  const ACE_SIGACTION *nsa,
00106                  ACE_SIGACTION *osa);
00107 
00108   ACE_NAMESPACE_INLINE_FUNCTION
00109   int sigaddset (sigset_t *s,
00110                  int signum);
00111 
00112   ACE_NAMESPACE_INLINE_FUNCTION
00113   int sigdelset (sigset_t *s,
00114                  int signum);
00115 
00116   ACE_NAMESPACE_INLINE_FUNCTION
00117   int sigemptyset (sigset_t *s);
00118 
00119   ACE_NAMESPACE_INLINE_FUNCTION
00120   int sigfillset (sigset_t *s);
00121 
00122   ACE_NAMESPACE_INLINE_FUNCTION
00123   int sigismember (sigset_t *s,
00124                    int signum);
00125 
00126   ACE_NAMESPACE_INLINE_FUNCTION
00127   ACE_SignalHandler signal (int signum,
00128                             ACE_SignalHandler);
00129 
00130   ACE_NAMESPACE_INLINE_FUNCTION
00131   int sigprocmask (int how,
00132                    const sigset_t *nsp,
00133                    sigset_t *osp);
00134 
00135   ACE_NAMESPACE_INLINE_FUNCTION
00136   int sigsuspend (const sigset_t *set);
00137 
00138   //@}
00139 
00140 } /* namespace ACE_OS */
00141 
00142 ACE_END_VERSIONED_NAMESPACE_DECL
00143 
00144 # if defined (ACE_HAS_INLINED_OSCALLS)
00145 #   if defined (ACE_INLINE)
00146 #     undef ACE_INLINE
00147 #   endif /* ACE_INLINE */
00148 #   define ACE_INLINE inline
00149 #   include "ace/OS_NS_signal.inl"
00150 # endif /* ACE_HAS_INLINED_OSCALLS */
00151 
00152 # include /**/ "ace/post.h"
00153 #endif /* ACE_OS_NS_SIGNAL_H */

Generated on Thu Nov 9 09:41:57 2006 for ACE by doxygen 1.3.6