diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2012-10-03 17:10:47 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2012-10-03 17:10:47 -0700 |
commit | 2b794d6940aa7dc58e297b3649b7799190d71f64 (patch) | |
tree | d0ec1a7864e6198e0c7ea764e8477cd0e48d12c7 /src/syssignal.h | |
parent | a1a9f411ab644cb191442ea1de4bc1370341cc88 (diff) | |
download | emacs-2b794d6940aa7dc58e297b3649b7799190d71f64.tar.gz |
Port timers to OpenBSD, plus check for timer failures.
OpenBSD problem reported by Han Boetes.
* profiler.c (setup_cpu_timer): Check for failure of timer_settime
and/or setitimer.
(Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
* syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
like OpenBSD, which has timer_settime but does not declare it.
OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
whether to use itimerspec-related primitives. All uses of
HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
Diffstat (limited to 'src/syssignal.h')
-rw-r--r-- | src/syssignal.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/syssignal.h b/src/syssignal.h index 66538aad100..83ab19698dd 100644 --- a/src/syssignal.h +++ b/src/syssignal.h @@ -29,8 +29,12 @@ extern void init_signals (bool); #define FORWARD_SIGNAL_TO_MAIN_THREAD #endif -#if (defined SIGPROF && (defined HAVE_TIMER_SETTIME || defined HAVE_SETITIMER) \ - && !defined PROFILING) +#if defined HAVE_TIMER_SETTIME && defined SIGEV_SIGNAL +# define HAVE_ITIMERSPEC +#endif + +#if (defined SIGPROF && !defined PROFILING \ + && (defined HAVE_SETITIMER || defined HAVE_ITIMERSPEC)) # define PROFILER_CPU_SUPPORT #endif |