~ubuntu-branches/ubuntu/trusty/mit-scheme/trusty-proposed

« back to all changes in this revision

Viewing changes to src/microcode/uxsig.c

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2007-05-09 10:57:57 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070509105757-p8focimovgqxaaed
Tags: 7.7.90+20070205-1ubuntu1
* Merge from debian unstable, remaining changes:
  * Bootstrapping done via supplied binary package. See log entry for
    7.7.90+20060906-3ubuntu1 for details.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*-C-*-
2
2
 
3
 
$Id: uxsig.c,v 1.45 2006/03/11 04:15:45 cph Exp $
 
3
$Id: uxsig.c,v 1.48 2007/01/05 21:19:25 cph Exp $
4
4
 
5
 
Copyright 1990,1991,1992,1993,1994,1996 Massachusetts Institute of Technology
6
 
Copyright 2000,2001,2005 Massachusetts Institute of Technology
 
5
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
 
6
    1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 
7
    2006, 2007 Massachusetts Institute of Technology
7
8
 
8
9
This file is part of MIT/GNU Scheme.
9
10
 
19
20
 
20
21
You should have received a copy of the GNU General Public License
21
22
along with MIT/GNU Scheme; if not, write to the Free Software
22
 
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 
23
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
23
24
USA.
24
25
 
25
26
*/
63
64
  return (SIGACT_HANDLER (&act));
64
65
}
65
66
 
 
67
/* Work-around for 64-bit environment bug on Mac OSX */
 
68
 
 
69
#if defined(__APPLE__) && defined(__LP64__)
 
70
#define SA_SIGINFO_EXTRA SA_64REGSET
 
71
#endif
 
72
 
 
73
#ifndef SA_SIGINFO_EXTRA
 
74
#define SA_SIGINFO_EXTRA 0
 
75
#endif
 
76
 
66
77
void
67
78
DEFUN (INSTALL_HANDLER, (signo, handler),
68
79
       int signo AND
78
89
  else
79
90
    {
80
91
      (SIGACT_HANDLER (&act)) = handler;
81
 
      (act . sa_flags) = SA_SIGINFO;
 
92
      (act . sa_flags) = (SA_SIGINFO | SA_SIGINFO_EXTRA);
82
93
    }
83
94
  UX_sigemptyset (& (act . sa_mask));
84
95
  UX_sigaddset ((& (act . sa_mask)), signo);
328
339
  defsignal (SIGTRAP, "SIGTRAP",        dfl_terminate,  CORE_DUMP);
329
340
  defsignal (SIGIOT, "SIGIOT",          dfl_terminate,  CORE_DUMP);
330
341
  defsignal (SIGEMT, "SIGEMT",          dfl_terminate,  CORE_DUMP);
 
342
#ifndef __APPLE__
331
343
  defsignal (SIGFPE, "SIGFPE",          dfl_terminate,  CORE_DUMP);
 
344
#endif /* __APPLE__ */
332
345
  defsignal (SIGKILL, "SIGKILL",        dfl_terminate,  (NOIGNORE | NOBLOCK | NOCATCH));
333
346
  defsignal (SIGBUS, "SIGBUS",          dfl_terminate,  CORE_DUMP);
334
347
  defsignal (SIGSEGV, "SIGSEGV",        dfl_terminate,  CORE_DUMP);
676
689
  initialize_signal_descriptors ();
677
690
  initialize_signal_debugging ();
678
691
  bind_handler (SIGINT,         sighnd_control_g);
 
692
#ifndef __APPLE__
679
693
  bind_handler (SIGFPE,         sighnd_fpe);
 
694
#endif /* __APPLE__ */
680
695
  bind_handler (SIGALRM,        sighnd_timer);
681
696
  bind_handler (SIGVTALRM,      sighnd_timer);
682
697
  bind_handler (SIGUSR1,        sighnd_save_then_terminate);