* async.c (s_scm_system_async_mark_for_thread): Only call
[bpt/guile.git] / libguile / scmsigs.c
1 /* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2002 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 usleep(usec) (Sleep ((usec) / 1000), 0)
85 #define kill(pid, sig) raise (sig)
86 #endif
87
88 \f
89
90 /* SIGRETTYPE is the type that signal handlers return. See <signal.h> */
91
92 #ifdef RETSIGTYPE
93 # define SIGRETTYPE RETSIGTYPE
94 #else
95 # ifdef STDC_HEADERS
96 # define SIGRETTYPE void
97 # else
98 # define SIGRETTYPE int
99 # endif
100 #endif
101
102 \f
103
104 /* take_signal is installed as the C signal handler whenever a Scheme
105 handler is set. when a signal arrives, take_signal will queue the
106 Scheme handler procedure for its thread. */
107
108
109 /* Scheme vectors with information about a signal. signal_handlers
110 contains the handler procedure or #f, signal_handler_cells contains
111 preallocated cells for queuing the handler in take_signal since we
112 can't allocate during signal delivery, signal_handler_threads
113 points to the thread that a signal should be delivered to.
114 */
115 static SCM *signal_handlers;
116 static SCM signal_handler_cells;
117 static SCM signal_handler_threads;
118
119 /* saves the original C handlers, when a new handler is installed.
120 set to SIG_ERR if the original handler is installed. */
121 #ifdef HAVE_SIGACTION
122 static struct sigaction orig_handlers[NSIG];
123 #else
124 static SIGRETTYPE (*orig_handlers[NSIG])(int);
125 #endif
126
127 static SIGRETTYPE
128 take_signal (int signum)
129 {
130 if (signum >= 0 && signum < NSIG)
131 {
132 #ifdef USE_THREADS
133 SCM thread = SCM_VECTOR_REF (signal_handler_threads, signum);
134 scm_i_queue_async_cell (SCM_VECTOR_REF(signal_handler_cells, signum),
135 scm_i_thread_root (thread));
136 #else
137 scm_i_queue_async_cell (SCM_VECTOR_REF(signal_handler_cells, signum),
138 scm_root);
139 #endif
140 }
141 #ifndef HAVE_SIGACTION
142 signal (signum, take_signal);
143 #endif
144 }
145
146 SCM
147 scm_sigaction (SCM signum, SCM handler, SCM flags)
148 {
149 return scm_sigaction_for_thread (signum, handler, flags, SCM_UNDEFINED);
150 }
151
152 static SCM
153 close_1 (SCM proc, SCM arg)
154 {
155 return scm_primitive_eval_x (scm_list_3 (scm_sym_lambda, SCM_EOL,
156 scm_list_2 (proc, arg)));
157 }
158
159 /* user interface for installation of signal handlers. */
160 SCM_DEFINE (scm_sigaction_for_thread, "sigaction", 1, 3, 0,
161 (SCM signum, SCM handler, SCM flags, SCM thread),
162 "Install or report the signal handler for a specified signal.\n\n"
163 "@var{signum} is the signal number, which can be specified using the value\n"
164 "of variables such as @code{SIGINT}.\n\n"
165 "If @var{handler} is omitted, @code{sigaction} returns a pair: the\n"
166 "CAR is the current\n"
167 "signal hander, which will be either an integer with the value @code{SIG_DFL}\n"
168 "(default action) or @code{SIG_IGN} (ignore), or the Scheme procedure which\n"
169 "handles the signal, or @code{#f} if a non-Scheme procedure handles the\n"
170 "signal. The CDR contains the current @code{sigaction} flags for the handler.\n\n"
171 "If @var{handler} is provided, it is installed as the new handler for\n"
172 "@var{signum}. @var{handler} can be a Scheme procedure taking one\n"
173 "argument, or the value of @code{SIG_DFL} (default action) or\n"
174 "@code{SIG_IGN} (ignore), or @code{#f} to restore whatever signal handler\n"
175 "was installed before @code{sigaction} was first used. When\n"
176 "a scheme procedure has been specified, that procedure will run\n"
177 "in the given @var{thread}. When no thread has been given, the\n"
178 "thread that made this call to @code{sigaction} is used.\n"
179 "Flags can "
180 "optionally be specified for the new handler (@code{SA_RESTART} will\n"
181 "always be added if it's available and the system is using restartable\n"
182 "system calls.) The return value is a pair with information about the\n"
183 "old handler as described above.\n\n"
184 "This interface does not provide access to the \"signal blocking\"\n"
185 "facility. Maybe this is not needed, since the thread support may\n"
186 "provide solutions to the problem of consistent access to data\n"
187 "structures.")
188 #define FUNC_NAME s_scm_sigaction_for_thread
189 {
190 int csig;
191 #ifdef HAVE_SIGACTION
192 struct sigaction action;
193 struct sigaction old_action;
194 #else
195 SIGRETTYPE (* chandler) (int) = SIG_DFL;
196 SIGRETTYPE (* old_chandler) (int);
197 #endif
198 int query_only = 0;
199 int save_handler = 0;
200
201 SCM old_handler;
202
203 SCM_VALIDATE_INUM_COPY (1, signum, csig);
204 if (csig < 0 || csig > NSIG)
205 SCM_OUT_OF_RANGE (1, signum);
206 #if defined(HAVE_SIGACTION)
207 #if defined(SA_RESTART) && defined(HAVE_RESTARTABLE_SYSCALLS)
208 /* don't allow SA_RESTART to be omitted if HAVE_RESTARTABLE_SYSCALLS
209 is defined, since libguile would be likely to produce spurious
210 EINTR errors. */
211 action.sa_flags = SA_RESTART;
212 #else
213 action.sa_flags = 0;
214 #endif
215 if (!SCM_UNBNDP (flags))
216 {
217 SCM_VALIDATE_INUM (3, flags);
218 action.sa_flags |= SCM_INUM (flags);
219 }
220 sigemptyset (&action.sa_mask);
221 #endif
222
223 #ifdef USE_THREAD
224 if (SCM_UNBNDP (thread))
225 thread = scm_current_thread ();
226 else
227 SCM_VALIDATE_THREAD (4, thread);
228 #else
229 thread = SCM_BOOL_F;
230 #endif
231
232 SCM_DEFER_INTS;
233 old_handler = SCM_VECTOR_REF(*signal_handlers, csig);
234 if (SCM_UNBNDP (handler))
235 query_only = 1;
236 else if (SCM_EQ_P (scm_integer_p (handler), SCM_BOOL_T))
237 {
238 if (SCM_NUM2LONG (2, handler) == (long) SIG_DFL
239 || SCM_NUM2LONG (2, handler) == (long) SIG_IGN)
240 {
241 #ifdef HAVE_SIGACTION
242 action.sa_handler = (SIGRETTYPE (*) (int)) SCM_INUM (handler);
243 #else
244 chandler = (SIGRETTYPE (*) (int)) SCM_INUM (handler);
245 #endif
246 SCM_VECTOR_SET (*signal_handlers, csig, SCM_BOOL_F);
247 }
248 else
249 SCM_OUT_OF_RANGE (2, handler);
250 }
251 else if (SCM_FALSEP (handler))
252 {
253 /* restore the default handler. */
254 #ifdef HAVE_SIGACTION
255 if (orig_handlers[csig].sa_handler == SIG_ERR)
256 query_only = 1;
257 else
258 {
259 action = orig_handlers[csig];
260 orig_handlers[csig].sa_handler = SIG_ERR;
261 SCM_VECTOR_SET (*signal_handlers, csig, SCM_BOOL_F);
262
263 }
264 #else
265 if (orig_handlers[csig] == SIG_ERR)
266 query_only = 1;
267 else
268 {
269 chandler = orig_handlers[csig];
270 orig_handlers[csig] = SIG_ERR;
271 SCM_VECTOR_SET (*signal_handlers, csig, SCM_BOOL_F);
272 }
273 #endif
274 }
275 else
276 {
277 SCM_VALIDATE_NIM (2, handler);
278 #ifdef HAVE_SIGACTION
279 action.sa_handler = take_signal;
280 if (orig_handlers[csig].sa_handler == SIG_ERR)
281 save_handler = 1;
282 #else
283 chandler = take_signal;
284 if (orig_handlers[csig] == SIG_ERR)
285 save_handler = 1;
286 #endif
287 SCM_VECTOR_SET (*signal_handlers, csig, handler);
288 SCM_VECTOR_SET (signal_handler_cells, csig,
289 scm_cons (close_1 (handler, signum), SCM_BOOL_F));
290 SCM_VECTOR_SET (signal_handler_threads, csig, thread);
291 }
292
293 /* XXX - Silently ignore setting handlers for `program error signals'
294 because they can't currently be handled by Scheme code.
295 */
296
297 switch (csig)
298 {
299 /* This list of program error signals is from the GNU Libc
300 Reference Manual */
301 case SIGFPE:
302 case SIGILL:
303 case SIGSEGV:
304 #ifdef SIGBUS
305 case SIGBUS:
306 #endif
307 case SIGABRT:
308 #if defined(SIGIOT) && (SIGIOT != SIGABRT)
309 case SIGIOT:
310 #endif
311 #ifdef SIGTRAP
312 case SIGTRAP:
313 #endif
314 #ifdef SIGEMT
315 case SIGEMT:
316 #endif
317 #ifdef SIGSYS
318 case SIGSYS:
319 #endif
320 query_only = 1;
321 }
322
323 #ifdef HAVE_SIGACTION
324 if (query_only)
325 {
326 if (sigaction (csig, 0, &old_action) == -1)
327 SCM_SYSERROR;
328 }
329 else
330 {
331 if (sigaction (csig, &action , &old_action) == -1)
332 SCM_SYSERROR;
333 if (save_handler)
334 orig_handlers[csig] = old_action;
335 }
336 if (old_action.sa_handler == SIG_DFL || old_action.sa_handler == SIG_IGN)
337 old_handler = scm_long2num ((long) old_action.sa_handler);
338 SCM_ALLOW_INTS;
339 return scm_cons (old_handler, SCM_MAKINUM (old_action.sa_flags));
340 #else
341 if (query_only)
342 {
343 if ((old_chandler = signal (csig, SIG_IGN)) == SIG_ERR)
344 SCM_SYSERROR;
345 if (signal (csig, old_chandler) == SIG_ERR)
346 SCM_SYSERROR;
347 }
348 else
349 {
350 if ((old_chandler = signal (csig, chandler)) == SIG_ERR)
351 SCM_SYSERROR;
352 if (save_handler)
353 orig_handlers[csig] = old_chandler;
354 }
355 if (old_chandler == SIG_DFL || old_chandler == SIG_IGN)
356 old_handler = scm_long2num ((long) old_chandler);
357 SCM_ALLOW_INTS;
358 return scm_cons (old_handler, SCM_MAKINUM (0));
359 #endif
360 }
361 #undef FUNC_NAME
362
363 SCM_DEFINE (scm_restore_signals, "restore-signals", 0, 0, 0,
364 (void),
365 "Return all signal handlers to the values they had before any call to\n"
366 "@code{sigaction} was made. The return value is unspecified.")
367 #define FUNC_NAME s_scm_restore_signals
368 {
369 int i;
370 for (i = 0; i < NSIG; i++)
371 {
372 #ifdef HAVE_SIGACTION
373 if (orig_handlers[i].sa_handler != SIG_ERR)
374 {
375 if (sigaction (i, &orig_handlers[i], NULL) == -1)
376 SCM_SYSERROR;
377 orig_handlers[i].sa_handler = SIG_ERR;
378 SCM_VECTOR_SET (*signal_handlers, i, SCM_BOOL_F);
379 }
380 #else
381 if (orig_handlers[i] != SIG_ERR)
382 {
383 if (signal (i, orig_handlers[i]) == SIG_ERR)
384 SCM_SYSERROR;
385 orig_handlers[i] = SIG_ERR;
386 SCM_VECTOR_SET (*signal_handlers, i, SCM_BOOL_F);
387 }
388 #endif
389 }
390 return SCM_UNSPECIFIED;
391 }
392 #undef FUNC_NAME
393
394 SCM_DEFINE (scm_alarm, "alarm", 1, 0, 0,
395 (SCM i),
396 "Set a timer to raise a @code{SIGALRM} signal after the specified\n"
397 "number of seconds (an integer). It's advisable to install a signal\n"
398 "handler for\n"
399 "@code{SIGALRM} beforehand, since the default action is to terminate\n"
400 "the process.\n\n"
401 "The return value indicates the time remaining for the previous alarm,\n"
402 "if any. The new value replaces the previous alarm. If there was\n"
403 "no previous alarm, the return value is zero.")
404 #define FUNC_NAME s_scm_alarm
405 {
406 unsigned int j;
407 SCM_VALIDATE_INUM (1, i);
408 j = alarm (SCM_INUM (i));
409 return SCM_MAKINUM (j);
410 }
411 #undef FUNC_NAME
412
413 #ifdef HAVE_SETITIMER
414 SCM_DEFINE (scm_setitimer, "setitimer", 5, 0, 0,
415 (SCM which_timer,
416 SCM interval_seconds, SCM interval_microseconds,
417 SCM value_seconds, SCM value_microseconds),
418 "Set the timer specified by @var{which_timer} according to the given\n"
419 "@var{interval_seconds}, @var{interval_microseconds},\n"
420 "@var{value_seconds}, and @var{value_microseconds} values.\n"
421 "\n"
422 "Return information about the timer's previous setting."
423 "\n"
424 "Errors are handled as described in the guile info pages under ``POSIX\n"
425 "Interface Conventions''.\n"
426 "\n"
427 "The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL},\n"
428 "and @code{ITIMER_PROF}.\n"
429 "\n"
430 "The return value will be a list of two cons pairs representing the\n"
431 "current state of the given timer. The first pair is the seconds and\n"
432 "microseconds of the timer @code{it_interval}, and the second pair is\n"
433 "the seconds and microseconds of the timer @code{it_value}.")
434 #define FUNC_NAME s_scm_setitimer
435 {
436 int rv;
437 int c_which_timer;
438 struct itimerval new_timer;
439 struct itimerval old_timer;
440
441 c_which_timer = SCM_NUM2INT(1, which_timer);
442 new_timer.it_interval.tv_sec = SCM_NUM2LONG(2, interval_seconds);
443 new_timer.it_interval.tv_usec = SCM_NUM2LONG(3, interval_microseconds);
444 new_timer.it_value.tv_sec = SCM_NUM2LONG(4, value_seconds);
445 new_timer.it_value.tv_usec = SCM_NUM2LONG(5, value_microseconds);
446
447 SCM_SYSCALL(rv = setitimer(c_which_timer, &new_timer, &old_timer));
448
449 if(rv != 0)
450 SCM_SYSERROR;
451
452 return scm_list_2(scm_cons(scm_long2num(old_timer.it_interval.tv_sec),
453 scm_long2num(old_timer.it_interval.tv_usec)),
454 scm_cons(scm_long2num(old_timer.it_value.tv_sec),
455 scm_long2num(old_timer.it_value.tv_usec)));
456 }
457 #undef FUNC_NAME
458 #endif /* HAVE_SETITIMER */
459
460 #ifdef HAVE_GETITIMER
461 SCM_DEFINE (scm_getitimer, "getitimer", 1, 0, 0,
462 (SCM which_timer),
463 "Return information about the timer specified by @var{which_timer}"
464 "\n"
465 "Errors are handled as described in the guile info pages under ``POSIX\n"
466 "Interface Conventions''.\n"
467 "\n"
468 "The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL},\n"
469 "and @code{ITIMER_PROF}.\n"
470 "\n"
471 "The return value will be a list of two cons pairs representing the\n"
472 "current state of the given timer. The first pair is the seconds and\n"
473 "microseconds of the timer @code{it_interval}, and the second pair is\n"
474 "the seconds and microseconds of the timer @code{it_value}.")
475 #define FUNC_NAME s_scm_getitimer
476 {
477 int rv;
478 int c_which_timer;
479 struct itimerval old_timer;
480
481 c_which_timer = SCM_NUM2INT(1, which_timer);
482
483 SCM_SYSCALL(rv = getitimer(c_which_timer, &old_timer));
484
485 if(rv != 0)
486 SCM_SYSERROR;
487
488 return scm_list_2(scm_cons(scm_long2num(old_timer.it_interval.tv_sec),
489 scm_long2num(old_timer.it_interval.tv_usec)),
490 scm_cons(scm_long2num(old_timer.it_value.tv_sec),
491 scm_long2num(old_timer.it_value.tv_usec)));
492 }
493 #undef FUNC_NAME
494 #endif /* HAVE_GETITIMER */
495
496 #ifdef HAVE_PAUSE
497 SCM_DEFINE (scm_pause, "pause", 0, 0, 0,
498 (),
499 "Pause the current process (thread?) until a signal arrives whose\n"
500 "action is to either terminate the current process or invoke a\n"
501 "handler procedure. The return value is unspecified.")
502 #define FUNC_NAME s_scm_pause
503 {
504 pause ();
505 return SCM_UNSPECIFIED;
506 }
507 #undef FUNC_NAME
508 #endif
509
510 SCM_DEFINE (scm_sleep, "sleep", 1, 0, 0,
511 (SCM i),
512 "Wait for the given number of seconds (an integer) or until a signal\n"
513 "arrives. The return value is zero if the time elapses or the number\n"
514 "of seconds remaining otherwise.")
515 #define FUNC_NAME s_scm_sleep
516 {
517 unsigned long j;
518 SCM_VALIDATE_INUM_MIN (1, i,0);
519 #ifdef USE_THREADS
520 j = scm_thread_sleep (SCM_INUM(i));
521 #else
522 j = sleep (SCM_INUM(i));
523 #endif
524 return scm_ulong2num (j);
525 }
526 #undef FUNC_NAME
527
528 #if defined(USE_THREADS) || defined(HAVE_USLEEP) || defined(__MINGW32__)
529 SCM_DEFINE (scm_usleep, "usleep", 1, 0, 0,
530 (SCM i),
531 "Sleep for I microseconds. @code{usleep} is not available on\n"
532 "all platforms.")
533 #define FUNC_NAME s_scm_usleep
534 {
535 SCM_VALIDATE_INUM_MIN (1, i,0);
536
537 #ifdef USE_THREADS
538 /* If we have threads, we use the thread system's sleep function. */
539 {
540 unsigned long j = scm_thread_usleep (SCM_INUM (i));
541 return scm_ulong2num (j);
542 }
543 #else
544 #ifdef USLEEP_RETURNS_VOID
545 usleep (SCM_INUM (i));
546 return SCM_INUM0;
547 #else
548 {
549 int j = usleep (SCM_INUM (i));
550 return SCM_MAKINUM (j);
551 }
552 #endif
553 #endif
554 }
555 #undef FUNC_NAME
556 #endif /* USE_THREADS || HAVE_USLEEP || __MINGW32__ */
557
558 SCM_DEFINE (scm_raise, "raise", 1, 0, 0,
559 (SCM sig),
560 "Sends a specified signal @var{sig} to the current process, where\n"
561 "@var{sig} is as described for the kill procedure.")
562 #define FUNC_NAME s_scm_raise
563 {
564 SCM_VALIDATE_INUM (1, sig);
565 SCM_DEFER_INTS;
566 if (kill (getpid (), (int) SCM_INUM (sig)) != 0)
567 SCM_SYSERROR;
568 SCM_ALLOW_INTS;
569 return SCM_UNSPECIFIED;
570 }
571 #undef FUNC_NAME
572
573 \f
574
575 void
576 scm_init_scmsigs ()
577 {
578 int i;
579
580 signal_handlers =
581 SCM_VARIABLE_LOC (scm_c_define ("signal-handlers",
582 scm_c_make_vector (NSIG, SCM_BOOL_F)));
583 signal_handler_cells =
584 scm_permanent_object (scm_c_make_vector (NSIG, SCM_BOOL_F));
585 signal_handler_threads =
586 scm_permanent_object (scm_c_make_vector (NSIG, SCM_BOOL_F));
587
588 for (i = 0; i < NSIG; i++)
589 {
590 #ifdef HAVE_SIGACTION
591 orig_handlers[i].sa_handler = SIG_ERR;
592
593 #else
594 orig_handlers[i] = SIG_ERR;
595 #endif
596
597 #ifdef HAVE_RESTARTABLE_SYSCALLS
598 /* If HAVE_RESTARTABLE_SYSCALLS is defined, it's important that
599 signals really are restartable. don't rely on the same
600 run-time that configure got: reset the default for every signal.
601 */
602 #ifdef HAVE_SIGINTERRUPT
603 siginterrupt (i, 0);
604 #elif defined(SA_RESTART)
605 {
606 struct sigaction action;
607
608 sigaction (i, NULL, &action);
609 if (!(action.sa_flags & SA_RESTART))
610 {
611 action.sa_flags |= SA_RESTART;
612 sigaction (i, &action, NULL);
613 }
614 }
615 #endif
616 /* if neither siginterrupt nor SA_RESTART are available we may
617 as well assume that signals are always restartable. */
618 #endif
619 }
620
621 scm_c_define ("NSIG", scm_long2num (NSIG));
622 scm_c_define ("SIG_IGN", scm_long2num ((long) SIG_IGN));
623 scm_c_define ("SIG_DFL", scm_long2num ((long) SIG_DFL));
624 #ifdef SA_NOCLDSTOP
625 scm_c_define ("SA_NOCLDSTOP", scm_long2num (SA_NOCLDSTOP));
626 #endif
627 #ifdef SA_RESTART
628 scm_c_define ("SA_RESTART", scm_long2num (SA_RESTART));
629 #endif
630
631 #if defined(HAVE_SETITIMER) || defined(HAVE_GETITIMER)
632 /* Stuff needed by setitimer and getitimer. */
633 scm_c_define ("ITIMER_REAL", SCM_MAKINUM (ITIMER_REAL));
634 scm_c_define ("ITIMER_VIRTUAL", SCM_MAKINUM (ITIMER_VIRTUAL));
635 scm_c_define ("ITIMER_PROF", SCM_MAKINUM (ITIMER_PROF));
636 #endif /* defined(HAVE_SETITIMER) || defined(HAVE_GETITIMER) */
637
638 #include "libguile/scmsigs.x"
639 }
640
641
642 /*
643 Local Variables:
644 c-file-style: "gnu"
645 End:
646 */