From 967e5ae6b4b87d6fccbc9f0532ecf69e7c4a36e0 Mon Sep 17 00:00:00 2001 From: Philipp Matthias Schaefer Date: Sat, 19 Dec 2015 11:12:26 +0100 Subject: [PATCH] Move only locally used function from header to source --- src/runtime/interrupt.c | 22 ++++++++++++++++++++++ src/runtime/interrupt.h | 22 ---------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/runtime/interrupt.c b/src/runtime/interrupt.c index b5b69abd9..91a282b7c 100644 --- a/src/runtime/interrupt.c +++ b/src/runtime/interrupt.c @@ -68,6 +68,28 @@ #include "genesis/simple-fun.h" #include "genesis/cons.h" +/* + * This is a workaround for some slightly silly Linux/GNU Libc + * behaviour: glibc defines sigset_t to support 1024 signals, which is + * more than the kernel. This is usually not a problem, but becomes + * one when we want to save a signal mask from a ucontext, and restore + * it later into another ucontext: the ucontext is allocated on the + * stack by the kernel, so copying a libc-sized sigset_t into it will + * overflow and cause other data on the stack to be corrupted */ +/* FIXME: do not rely on NSIG being a multiple of 8 */ + +#ifdef LISP_FEATURE_WIN32 +# define REAL_SIGSET_SIZE_BYTES (4) +#else +# define REAL_SIGSET_SIZE_BYTES ((NSIG/8)) +#endif + +static inline void +sigcopyset(sigset_t *new, sigset_t *old) +{ + memcpy(new, old, REAL_SIGSET_SIZE_BYTES); +} + /* When we catch an internal error, should we pass it back to Lisp to * be handled in a high-level way? (Early in cold init, the answer is * 'no', because Lisp is still too brain-dead to handle anything. diff --git a/src/runtime/interrupt.h b/src/runtime/interrupt.h index a4c277114..291da305e 100644 --- a/src/runtime/interrupt.h +++ b/src/runtime/interrupt.h @@ -15,28 +15,6 @@ #include "runtime.h" #include -/* - * This is a workaround for some slightly silly Linux/GNU Libc - * behaviour: glibc defines sigset_t to support 1024 signals, which is - * more than the kernel. This is usually not a problem, but becomes - * one when we want to save a signal mask from a ucontext, and restore - * it later into another ucontext: the ucontext is allocated on the - * stack by the kernel, so copying a libc-sized sigset_t into it will - * overflow and cause other data on the stack to be corrupted */ -/* FIXME: do not rely on NSIG being a multiple of 8 */ - -#ifdef LISP_FEATURE_WIN32 -# define REAL_SIGSET_SIZE_BYTES (4) -#else -# define REAL_SIGSET_SIZE_BYTES ((NSIG/8)) -#endif - -static inline void -sigcopyset(sigset_t *new, sigset_t *old) -{ - memcpy(new, old, REAL_SIGSET_SIZE_BYTES); -} - extern void get_current_sigmask(sigset_t *sigset); /* Set all deferrable signals into *s. */ -- 2.11.4.GIT