* scmsigs.c: include sys/time.h for itimer stuff.
[bpt/guile.git] / libguile / scmsigs.c
1 /* Copyright (C) 1995,1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2, or (at your option)
6 * any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this software; see the file COPYING. If not, write to
15 * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
16 * Boston, MA 02111-1307 USA
17 *
18 * As a special exception, the Free Software Foundation gives permission
19 * for additional uses of the text contained in its release of GUILE.
20 *
21 * The exception is that, if you link the GUILE library with other files
22 * to produce an executable, this does not by itself cause the
23 * resulting executable to be covered by the GNU General Public License.
24 * Your use of that executable is in no way restricted on account of
25 * linking the GUILE library code into it.
26 *
27 * This exception does not however invalidate any other reasons why
28 * the executable file might be covered by the GNU General Public License.
29 *
30 * This exception applies only to the code released by the
31 * Free Software Foundation under the name GUILE. If you copy
32 * code from other Free Software Foundation releases into a copy of
33 * GUILE, as the General Public License permits, the exception does
34 * not apply to the code that you add in this way. To avoid misleading
35 * anyone as to the status of such modified files, you must delete
36 * this exception notice from them.
37 *
38 * If you write modifications of your own for GUILE, it is your choice
39 * whether to permit this exception to apply to your modifications.
40 * If you do not wish that, delete this exception notice. */
41
42
43 \f
44
45 #include <signal.h>
46 #include <errno.h>
47
48 #include "libguile/_scm.h"
49
50 #include "libguile/async.h"
51 #include "libguile/eval.h"
52 #include "libguile/root.h"
53 #include "libguile/vectors.h"
54
55 #include "libguile/validate.h"
56 #include "libguile/scmsigs.h"
57
58 #ifdef HAVE_UNISTD_H
59 #include <unistd.h>
60 #endif
61
62 #ifdef HAVE_SYS_TIME_H
63 #include <sys/time.h>
64 #endif
65
66 /* The thread system has its own sleep and usleep functions. */
67 #ifndef USE_THREADS
68
69 #if defined(MISSING_SLEEP_DECL)
70 int sleep ();
71 #endif
72
73 #if defined(HAVE_USLEEP) && defined(MISSING_USLEEP_DECL)
74 int usleep ();
75 #endif
76
77 #endif
78
79 #ifdef __MINGW32__
80 #include <windows.h>
81 #define alarm(sec) (0)
82 /* This weird comma expression is because Sleep is void under Windows. */
83 #define sleep(sec) (Sleep ((sec) * 1000), 0)
84 #define kill(pid, sig) raise (sig)
85 #endif
86
87 \f
88
89 /* SIGRETTYPE is the type that signal handlers return. See <signal.h> */
90
91 #ifdef RETSIGTYPE
92 # define SIGRETTYPE RETSIGTYPE
93 #else
94 # ifdef STDC_HEADERS
95 # define SIGRETTYPE void
96 # else
97 # define SIGRETTYPE int
98 # endif
99 #endif
100
101 \f
102
103 /* take_signal is installed as the C signal handler whenever a Scheme
104 handler is set. when a signal arrives, take_signal marks the corresponding
105 element of got_signal and marks signal_async. the thunk in signal_async
106 (sys_deliver_signals) will be run at the next opportunity, outside a
107 critical section. sys_deliver_signals runs each Scheme handler for
108 which got_signal is set. */
109
110 static SCM signal_async;
111
112 static char got_signal[NSIG];
113
114 /* a Scheme vector of handler procedures. */
115 static SCM *signal_handlers;
116
117 /* saves the original C handlers, when a new handler is installed.
118 set to SIG_ERR if the original handler is installed. */
119 #ifdef HAVE_SIGACTION
120 static struct sigaction orig_handlers[NSIG];
121 #else
122 static SIGRETTYPE (*orig_handlers[NSIG])(int);
123 #endif
124
125 static SIGRETTYPE
126 take_signal (int signum)
127 {
128 int saved_errno = errno;
129 SCM ignored;
130
131 if (!scm_ints_disabled)
132 {
133 /* For reasons of speed, the SCM_NEWCELL macro doesn't defer
134 interrupts. Instead, it first sets its argument to point to
135 the first cell in the list, and then advances the freelist
136 pointer to the next cell. Now, if this procedure is
137 interrupted, the only anomalous state possible is to have
138 both SCM_NEWCELL's argument and scm_freelist pointing to the
139 same cell. To deal with this case, we always throw away the
140 first cell in scm_freelist here.
141
142 At least, that's the theory. I'm not convinced that that's
143 the only anomalous path we need to worry about. */
144 SCM_NEWCELL (ignored);
145 }
146 got_signal[signum] = 1;
147 #if HAVE_SIGACTION
148 /* unblock the signal before the scheme handler gets to run, since
149 it may use longjmp to escape (i.e., throw an exception). */
150 {
151 sigset_t set;
152 sigemptyset (&set);
153 sigaddset (&set, signum);
154 sigprocmask (SIG_UNBLOCK, &set, NULL);
155 }
156 #endif
157 scm_system_async_mark (signal_async);
158 errno = saved_errno;
159 }
160
161 static SCM
162 sys_deliver_signals (void)
163 {
164 int i;
165
166 for (i = 0; i < NSIG; i++)
167 {
168 if (got_signal[i])
169 {
170 /* The flag is reset before calling the handler in case the
171 handler doesn't return. If the handler doesn't return
172 but leaves other signals flagged, they their handlers
173 will be applied some time later when the async is checked
174 again. It would probably be better to reset the flags
175 after doing a longjmp. */
176 got_signal[i] = 0;
177 #ifndef HAVE_SIGACTION
178 signal (i, take_signal);
179 #endif
180 scm_call_1 (SCM_VELTS (*signal_handlers)[i], SCM_MAKINUM (i));
181 }
182 }
183 return SCM_UNSPECIFIED;
184 }
185
186 /* user interface for installation of signal handlers. */
187 SCM_DEFINE (scm_sigaction, "sigaction", 1, 2, 0,
188 (SCM signum, SCM handler, SCM flags),
189 "Install or report the signal handler for a specified signal.\n\n"
190 "@var{signum} is the signal number, which can be specified using the value\n"
191 "of variables such as @code{SIGINT}.\n\n"
192 "If @var{action} is omitted, @code{sigaction} returns a pair: the\n"
193 "CAR is the current\n"
194 "signal hander, which will be either an integer with the value @code{SIG_DFL}\n"
195 "(default action) or @code{SIG_IGN} (ignore), or the Scheme procedure which\n"
196 "handles the signal, or @code{#f} if a non-Scheme procedure handles the\n"
197 "signal. The CDR contains the current @code{sigaction} flags for the handler.\n\n"
198 "If @var{action} is provided, it is installed as the new handler for\n"
199 "@var{signum}. @var{action} can be a Scheme procedure taking one\n"
200 "argument, or the value of @code{SIG_DFL} (default action) or\n"
201 "@code{SIG_IGN} (ignore), or @code{#f} to restore whatever signal handler\n"
202 "was installed before @code{sigaction} was first used. Flags can\n"
203 "optionally be specified for the new handler (@code{SA_RESTART} will\n"
204 "always be added if it's available and the system is using restartable\n"
205 "system calls.) The return value is a pair with information about the\n"
206 "old handler as described above.\n\n"
207 "This interface does not provide access to the \"signal blocking\"\n"
208 "facility. Maybe this is not needed, since the thread support may\n"
209 "provide solutions to the problem of consistent access to data\n"
210 "structures.")
211 #define FUNC_NAME s_scm_sigaction
212 {
213 int csig;
214 #ifdef HAVE_SIGACTION
215 struct sigaction action;
216 struct sigaction old_action;
217 #else
218 SIGRETTYPE (* chandler) (int);
219 SIGRETTYPE (* old_chandler) (int);
220 #endif
221 int query_only = 0;
222 int save_handler = 0;
223 SCM *scheme_handlers = SCM_VELTS (*signal_handlers);
224 SCM old_handler;
225
226 SCM_VALIDATE_INUM_COPY (1,signum,csig);
227 #if defined(HAVE_SIGACTION)
228 #if defined(SA_RESTART) && defined(HAVE_RESTARTABLE_SYSCALLS)
229 /* don't allow SA_RESTART to be omitted if HAVE_RESTARTABLE_SYSCALLS
230 is defined, since libguile would be likely to produce spurious
231 EINTR errors. */
232 action.sa_flags = SA_RESTART;
233 #else
234 action.sa_flags = 0;
235 #endif
236 if (!SCM_UNBNDP (flags))
237 {
238 SCM_VALIDATE_INUM (3,flags);
239 action.sa_flags |= SCM_INUM (flags);
240 }
241 sigemptyset (&action.sa_mask);
242 #endif
243 SCM_DEFER_INTS;
244 old_handler = scheme_handlers[csig];
245 if (SCM_UNBNDP (handler))
246 query_only = 1;
247 else if (SCM_EQ_P (scm_integer_p (handler), SCM_BOOL_T))
248 {
249 if (SCM_NUM2LONG (2, handler) == (long) SIG_DFL
250 || SCM_NUM2LONG (2, handler) == (long) SIG_IGN)
251 {
252 #ifdef HAVE_SIGACTION
253 action.sa_handler = (SIGRETTYPE (*) (int)) SCM_INUM (handler);
254 #else
255 chandler = (SIGRETTYPE (*) (int)) SCM_INUM (handler);
256 #endif
257 scheme_handlers[csig] = SCM_BOOL_F;
258 }
259 else
260 SCM_OUT_OF_RANGE (2, handler);
261 }
262 else if (SCM_FALSEP (handler))
263 {
264 /* restore the default handler. */
265 #ifdef HAVE_SIGACTION
266 if (orig_handlers[csig].sa_handler == SIG_ERR)
267 query_only = 1;
268 else
269 {
270 action = orig_handlers[csig];
271 orig_handlers[csig].sa_handler = SIG_ERR;
272 scheme_handlers[csig] = SCM_BOOL_F;
273 }
274 #else
275 if (orig_handlers[csig] == SIG_ERR)
276 query_only = 1;
277 else
278 {
279 chandler = orig_handlers[csig];
280 orig_handlers[csig] = SIG_ERR;
281 scheme_handlers[csig] = SCM_BOOL_F;
282 }
283 #endif
284 }
285 else
286 {
287 SCM_VALIDATE_NIM (2,handler);
288 #ifdef HAVE_SIGACTION
289 action.sa_handler = take_signal;
290 if (orig_handlers[csig].sa_handler == SIG_ERR)
291 save_handler = 1;
292 #else
293 chandler = take_signal;
294 if (orig_handlers[csig] == SIG_ERR)
295 save_handler = 1;
296 #endif
297 scheme_handlers[csig] = handler;
298 }
299
300 /* XXX - Silently ignore setting handlers for `program error signals'
301 because they can't currently be handled by Scheme code.
302 */
303
304 switch (csig)
305 {
306 /* This list of program error signals is from the GNU Libc
307 Reference Manual */
308 case SIGFPE:
309 case SIGILL:
310 case SIGSEGV:
311 #ifdef SIGBUS
312 case SIGBUS:
313 #endif
314 case SIGABRT:
315 #if defined(SIGIOT) && (SIGIOT != SIGABRT)
316 case SIGIOT:
317 #endif
318 #ifdef SIGTRAP
319 case SIGTRAP:
320 #endif
321 #ifdef SIGEMT
322 case SIGEMT:
323 #endif
324 #ifdef SIGSYS
325 case SIGSYS:
326 #endif
327 query_only = 1;
328 }
329
330 #ifdef HAVE_SIGACTION
331 if (query_only)
332 {
333 if (sigaction (csig, 0, &old_action) == -1)
334 SCM_SYSERROR;
335 }
336 else
337 {
338 if (sigaction (csig, &action , &old_action) == -1)
339 SCM_SYSERROR;
340 if (save_handler)
341 orig_handlers[csig] = old_action;
342 }
343 if (old_action.sa_handler == SIG_DFL || old_action.sa_handler == SIG_IGN)
344 old_handler = scm_long2num ((long) old_action.sa_handler);
345 SCM_ALLOW_INTS;
346 return scm_cons (old_handler, SCM_MAKINUM (old_action.sa_flags));
347 #else
348 if (query_only)
349 {
350 if ((old_chandler = signal (csig, SIG_IGN)) == SIG_ERR)
351 SCM_SYSERROR;
352 if (signal (csig, old_chandler) == SIG_ERR)
353 SCM_SYSERROR;
354 }
355 else
356 {
357 if ((old_chandler = signal (csig, chandler)) == SIG_ERR)
358 SCM_SYSERROR;
359 if (save_handler)
360 orig_handlers[csig] = old_chandler;
361 }
362 if (old_chandler == SIG_DFL || old_chandler == SIG_IGN)
363 old_handler = scm_long2num ((long) old_chandler);
364 SCM_ALLOW_INTS;
365 return scm_cons (old_handler, SCM_MAKINUM (0));
366 #endif
367 }
368 #undef FUNC_NAME
369
370 SCM_DEFINE (scm_restore_signals, "restore-signals", 0, 0, 0,
371 (void),
372 "Return all signal handlers to the values they had before any call to\n"
373 "@code{sigaction} was made. The return value is unspecified.")
374 #define FUNC_NAME s_scm_restore_signals
375 {
376 int i;
377 SCM *scheme_handlers = SCM_VELTS (*signal_handlers);
378
379 for (i = 0; i < NSIG; i++)
380 {
381 #ifdef HAVE_SIGACTION
382 if (orig_handlers[i].sa_handler != SIG_ERR)
383 {
384 if (sigaction (i, &orig_handlers[i], NULL) == -1)
385 SCM_SYSERROR;
386 orig_handlers[i].sa_handler = SIG_ERR;
387 scheme_handlers[i] = SCM_BOOL_F;
388 }
389 #else
390 if (orig_handlers[i] != SIG_ERR)
391 {
392 if (signal (i, orig_handlers[i]) == SIG_ERR)
393 SCM_SYSERROR;
394 orig_handlers[i] = SIG_ERR;
395 scheme_handlers[i] = SCM_BOOL_F;
396 }
397 #endif
398 }
399 return SCM_UNSPECIFIED;
400 }
401 #undef FUNC_NAME
402
403 SCM_DEFINE (scm_alarm, "alarm", 1, 0, 0,
404 (SCM i),
405 "Set a timer to raise a @code{SIGALRM} signal after the specified\n"
406 "number of seconds (an integer). It's advisable to install a signal\n"
407 "handler for\n"
408 "@code{SIGALRM} beforehand, since the default action is to terminate\n"
409 "the process.\n\n"
410 "The return value indicates the time remaining for the previous alarm,\n"
411 "if any. The new value replaces the previous alarm. If there was\n"
412 "no previous alarm, the return value is zero.")
413 #define FUNC_NAME s_scm_alarm
414 {
415 unsigned int j;
416 SCM_VALIDATE_INUM (1,i);
417 j = alarm (SCM_INUM (i));
418 return SCM_MAKINUM (j);
419 }
420 #undef FUNC_NAME
421
422 #ifdef HAVE_SETITIMER
423 SCM_DEFINE (scm_setitimer, "setitimer", 5, 0, 0,
424 (SCM which_timer,
425 SCM interval_seconds, SCM interval_microseconds,
426 SCM value_seconds, SCM value_microseconds),
427 "Set the timer specified by @var{which_timer} according to the given\n"
428 "@var{interval_seconds}, @var{interval_microseconds},\n"
429 "@var{value_seconds}, and @var{value_microseconds} values.\n"
430 "\n"
431 "Return information about the timer's previous setting."
432 "\n"
433 "Errors are handled as described in the guile info pages under ``POSIX\n"
434 "Interface Conventions''.\n"
435 "\n"
436 "The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL}, \n"
437 "and @code{ITIMER_PROF}.\n"
438 "\n"
439 "The return value will be a list of two cons pairs representing the\n"
440 "current state of the given timer. The first pair is the seconds and\n"
441 "microseconds of the timer @code{it_interval}, and the second pair is\n"
442 "the seconds and microseconds of the timer @code{it_value}.\n")
443 #define FUNC_NAME s_scm_setitimer
444 {
445 int rv;
446 int c_which_timer;
447 struct itimerval new_timer;
448 struct itimerval old_timer;
449
450 c_which_timer = SCM_NUM2INT(1, which_timer);
451 new_timer.it_interval.tv_sec = SCM_NUM2LONG(2, interval_seconds);
452 new_timer.it_interval.tv_usec = SCM_NUM2LONG(3, interval_microseconds);
453 new_timer.it_value.tv_sec = SCM_NUM2LONG(4, value_seconds);
454 new_timer.it_value.tv_usec = SCM_NUM2LONG(5, value_microseconds);
455
456 SCM_SYSCALL(rv = setitimer(c_which_timer, &new_timer, &old_timer));
457
458 if(rv != 0)
459 SCM_SYSERROR;
460
461 return scm_list_2(scm_cons(scm_long2num(old_timer.it_interval.tv_sec),
462 scm_long2num(old_timer.it_interval.tv_usec)),
463 scm_cons(scm_long2num(old_timer.it_value.tv_sec),
464 scm_long2num(old_timer.it_value.tv_usec)));
465 }
466 #undef FUNC_NAME
467 #endif /* HAVE_SETITIMER */
468
469 #ifdef HAVE_GETITIMER
470 SCM_DEFINE (scm_getitimer, "getitimer", 1, 0, 0,
471 (SCM which_timer),
472 "Return information about the timer specified by @var{which_timer}"
473 "\n"
474 "Errors are handled as described in the guile info pages under ``POSIX\n"
475 "Interface Conventions''.\n"
476 "\n"
477 "The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL}, \n"
478 "and @code{ITIMER_PROF}.\n"
479 "\n"
480 "The return value will be a list of two cons pairs representing the\n"
481 "current state of the given timer. The first pair is the seconds and\n"
482 "microseconds of the timer @code{it_interval}, and the second pair is\n"
483 "the seconds and microseconds of the timer @code{it_value}.\n")
484 #define FUNC_NAME s_scm_getitimer
485 {
486 int rv;
487 int c_which_timer;
488 struct itimerval old_timer;
489
490 c_which_timer = SCM_NUM2INT(1, which_timer);
491
492 SCM_SYSCALL(rv = getitimer(c_which_timer, &old_timer));
493
494 if(rv != 0)
495 SCM_SYSERROR;
496
497 return scm_list_2(scm_cons(scm_long2num(old_timer.it_interval.tv_sec),
498 scm_long2num(old_timer.it_interval.tv_usec)),
499 scm_cons(scm_long2num(old_timer.it_value.tv_sec),
500 scm_long2num(old_timer.it_value.tv_usec)));
501 }
502 #undef FUNC_NAME
503 #endif /* HAVE_GETITIMER */
504
505 #ifdef HAVE_PAUSE
506 SCM_DEFINE (scm_pause, "pause", 0, 0, 0,
507 (),
508 "Pause the current process (thread?) until a signal arrives whose\n"
509 "action is to either terminate the current process or invoke a\n"
510 "handler procedure. The return value is unspecified.")
511 #define FUNC_NAME s_scm_pause
512 {
513 pause ();
514 return SCM_UNSPECIFIED;
515 }
516 #undef FUNC_NAME
517 #endif
518
519 SCM_DEFINE (scm_sleep, "sleep", 1, 0, 0,
520 (SCM i),
521 "Wait for the given number of seconds (an integer) or until a signal\n"
522 "arrives. The return value is zero if the time elapses or the number\n"
523 "of seconds remaining otherwise.")
524 #define FUNC_NAME s_scm_sleep
525 {
526 unsigned long j;
527 SCM_VALIDATE_INUM_MIN (1,i,0);
528 #ifdef USE_THREADS
529 j = scm_thread_sleep (SCM_INUM(i));
530 #else
531 j = sleep (SCM_INUM(i));
532 #endif
533 return scm_ulong2num (j);
534 }
535 #undef FUNC_NAME
536
537 #if defined(USE_THREADS) || defined(HAVE_USLEEP)
538 SCM_DEFINE (scm_usleep, "usleep", 1, 0, 0,
539 (SCM i),
540 "Sleep for I microseconds. @code{usleep} is not available on\n"
541 "all platforms.")
542 #define FUNC_NAME s_scm_usleep
543 {
544 SCM_VALIDATE_INUM_MIN (1,i,0);
545
546 #ifdef USE_THREADS
547 /* If we have threads, we use the thread system's sleep function. */
548 {
549 unsigned long j = scm_thread_usleep (SCM_INUM (i));
550 return scm_ulong2num (j);
551 }
552 #else
553 #ifdef USLEEP_RETURNS_VOID
554 usleep (SCM_INUM (i));
555 return SCM_INUM0;
556 #else
557 {
558 int j = usleep (SCM_INUM (i));
559 return SCM_MAKINUM (j);
560 }
561 #endif
562 #endif
563 }
564 #undef FUNC_NAME
565 #endif /* GUILE_ISELECT || HAVE_USLEEP */
566
567 SCM_DEFINE (scm_raise, "raise", 1, 0, 0,
568 (SCM sig),
569 "Sends a specified signal @var{sig} to the current process, where\n"
570 "@var{sig} is as described for the kill procedure.")
571 #define FUNC_NAME s_scm_raise
572 {
573 SCM_VALIDATE_INUM (1,sig);
574 SCM_DEFER_INTS;
575 if (kill (getpid (), (int) SCM_INUM (sig)) != 0)
576 SCM_SYSERROR;
577 SCM_ALLOW_INTS;
578 return SCM_UNSPECIFIED;
579 }
580 #undef FUNC_NAME
581
582 \f
583
584 void
585 scm_init_scmsigs ()
586 {
587 SCM thunk;
588 int i;
589
590 signal_handlers =
591 SCM_VARIABLE_LOC (scm_c_define ("signal-handlers",
592 scm_c_make_vector (NSIG, SCM_BOOL_F)));
593 /* XXX - use scm_c_make_gsubr here instead of `define'? */
594 thunk = scm_c_define_gsubr ("%deliver-signals", 0, 0, 0,
595 sys_deliver_signals);
596 signal_async = scm_system_async (thunk);
597
598 for (i = 0; i < NSIG; i++)
599 {
600 got_signal[i] = 0;
601 #ifdef HAVE_SIGACTION
602 orig_handlers[i].sa_handler = SIG_ERR;
603
604 #else
605 orig_handlers[i] = SIG_ERR;
606 #endif
607
608 #ifdef HAVE_RESTARTABLE_SYSCALLS
609 /* If HAVE_RESTARTABLE_SYSCALLS is defined, it's important that
610 signals really are restartable. don't rely on the same
611 run-time that configure got: reset the default for every signal.
612 */
613 #ifdef HAVE_SIGINTERRUPT
614 siginterrupt (i, 0);
615 #elif defined(SA_RESTART)
616 {
617 struct sigaction action;
618
619 sigaction (i, NULL, &action);
620 if (!(action.sa_flags & SA_RESTART))
621 {
622 action.sa_flags |= SA_RESTART;
623 sigaction (i, &action, NULL);
624 }
625 }
626 #endif
627 /* if neither siginterrupt nor SA_RESTART are available we may
628 as well assume that signals are always restartable. */
629 #endif
630 }
631
632 scm_c_define ("NSIG", scm_long2num (NSIG));
633 scm_c_define ("SIG_IGN", scm_long2num ((long) SIG_IGN));
634 scm_c_define ("SIG_DFL", scm_long2num ((long) SIG_DFL));
635 #ifdef SA_NOCLDSTOP
636 scm_c_define ("SA_NOCLDSTOP", scm_long2num (SA_NOCLDSTOP));
637 #endif
638 #ifdef SA_RESTART
639 scm_c_define ("SA_RESTART", scm_long2num (SA_RESTART));
640 #endif
641
642 #if defined(HAVE_SETITIMER) || defined(HAVE_GETITIMER)
643 /* Stuff needed by setitimer and getitimer. */
644 scm_c_define ("ITIMER_REAL", SCM_MAKINUM (ITIMER_REAL));
645 scm_c_define ("ITIMER_VIRTUAL", SCM_MAKINUM (ITIMER_VIRTUAL));
646 scm_c_define ("ITIMER_PROF", SCM_MAKINUM (ITIMER_PROF));
647 #endif /* defined(HAVE_SETITIMER) || defined(HAVE_GETITIMER) */
648
649 #ifndef SCM_MAGIC_SNARFER
650 #include "libguile/scmsigs.x"
651 #endif
652 }
653
654
655 /*
656 Local Variables:
657 c-file-style: "gnu"
658 End:
659 */