3
|
1 // utils.cc -*- C++ -*- |
|
2 /* |
|
3 |
|
4 Copyright (C) 1992, 1993 John W. Eaton |
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
238
|
24 #ifdef HAVE_CONFIG_H |
|
25 #include "config.h" |
|
26 #endif |
|
27 |
3
|
28 #include <sys/types.h> |
|
29 #include <unistd.h> |
|
30 #include <signal.h> |
|
31 #include <stdlib.h> |
|
32 |
|
33 #include "f77-uscore.h" |
|
34 |
|
35 /* |
|
36 * All the STOP statements in the Fortran routines have been replaced |
|
37 * with a call to XSTOPX, defined in the file libcruft/misc/xstopx.f. |
|
38 * |
|
39 * The XSTOPX function calls this function, which will send a SIGINT |
|
40 * signal to the program that invoked it. |
|
41 * |
|
42 * Octave\'s SIGINT signal handler calls jump_to_top_level(), and the |
|
43 * user will end up at the top level instead of the shell prompt. |
|
44 * |
|
45 * Programs that don\'t handle SIGINT will be interrupted. |
|
46 */ |
|
47 |
|
48 extern "C" |
|
49 { |
|
50 |
|
51 volatile void |
|
52 #if defined (F77_APPEND_UNDERSCORE) |
|
53 do_stop_ (void) |
|
54 #else |
|
55 do_stop (void) |
|
56 #endif |
|
57 { |
|
58 kill (getpid (), SIGINT); |
|
59 abort (); |
|
60 } |
|
61 } |
|
62 |
|
63 /* |
|
64 ;;; Local Variables: *** |
|
65 ;;; mode: C++ *** |
|
66 ;;; page-delimiter: "^/\\*" *** |
|
67 ;;; End: *** |
|
68 */ |