/[MITgcm]/MITgcm/eesupp/src/sigreg.c
ViewVC logotype

Diff of /MITgcm/eesupp/src/sigreg.c

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.6 by ce107, Tue Jul 31 22:48:34 2007 UTC revision 1.7 by jahn, Wed Aug 10 22:33:32 2011 UTC
# Line 26  Line 26 
26  #include <errno.h>  #include <errno.h>
27  #include <ucontext.h>  #include <ucontext.h>
28    
29  int * ip;  int * sigreg_ip;
30    
31  static void killhandler(  static void killhandler(
32      unsigned int sn, siginfo_t  si, struct ucontext *sc )      unsigned int sn, siginfo_t  si, struct ucontext *sc )
33  {  {
34      *ip = *ip + 1;      *sigreg_ip = *sigreg_ip + 1;
35      return;      return;
36  }  }
37  #endif  #endif
# Line 41  void FC_NAMEMANGLE(sigreg) (int * aip) Line 41  void FC_NAMEMANGLE(sigreg) (int * aip)
41  {  {
42  #ifdef HAVE_SIGREG  #ifdef HAVE_SIGREG
43      struct sigaction s;      struct sigaction s;
44      ip = aip;      sigreg_ip = aip;
45      s.sa_flags = SA_SIGINFO;      s.sa_flags = SA_SIGINFO;
46      s.sa_sigaction = (void *)killhandler;      s.sa_sigaction = (void *)killhandler;
47      if(sigaction (SIGTERM,&s,(struct sigaction *)NULL)) {      if(sigaction (SIGTERM,&s,(struct sigaction *)NULL)) {

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.22