summaryrefslogtreecommitdiff
path: root/libguile/scmsigs.c
AgeCommit message (Collapse)AuthorFilesLines
2013-11-22Remove tests and shims for pre-7.2 bdw-gc.Andy Wingo1-22/+0
* configure.ac: Remove checks for symbols present in bdw-gc 7.2. * libguile/finalizers.c: * libguile/gc-malloc.c: * libguile/gc.c: * libguile/guardians.c: * libguile/scmsigs.c: * libguile/threads.c: Remove shims.
2013-03-28Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver1-20/+14
Conflicts: configure.ac libguile/deprecated.c libguile/deprecated.h libguile/filesys.h libguile/fluids.c libguile/fports.c libguile/gc.c libguile/guile.c libguile/numbers.c libguile/objcodes.c libguile/r6rs-ports.c libguile/smob.c libguile/socket.c libguile/threads.h module/language/scheme/decompile-tree-il.scm module/language/tree-il/peval.scm test-suite/tests/syncase.test
2013-03-09portability simplification with scmsigs.c and alarmAndy Wingo1-20/+14
* configure.ac (alarm): Check for decl. * libguile/scmsigs.c: Reorder includes to put system includes first. Fixes include order on mingw. Remove #define for alarm, as we will use HAVE_DECL_ALARM. Remove #defines for sleep and usleep, as they are not used. (scm_alarm): Only define if HAVE_DECL_ALARM.
2011-07-25fix GC_get_suspend_signal on Mac OSAndy Wingo1-1/+3
* libguile/scmsigs.c (GC_get_suspend_signal): Fix the back-compatibility shim for this function to work on some other cases; I hadn't realized that gcconfig.h could set SIG_SUSPEND. Thanks to Aleix Conchillo Flaqué for the report.
2011-06-23allow gc <= 7.1 to stop the signal delivery threadAndy Wingo1-0/+25
* configure.ac: Add a check for GC_get_suspend_signal(). * libguile/scmsigs.c (GC_get_suspend_signal): Define a fallback implementation if one isn't available. (signal_delivery_thread): Unmask the suspend signal so that GC can stop the world. Fixes test-pthread-create on libgc 7.1 and earlier. Thanks to Frank Terbeck <ft@bewatermyfriend.org> for the report.
2011-06-16O_CLOEXEC usageAndy Wingo1-6/+1
* libguile/objcodes.c (scm_load_objcode): * libguile/scmsigs.c (start_signal_delivery_thread): * libguile/threads.c (guilify_self_1): Use O_CLOEXEC.
2011-05-26leave guile when reading signal pipeAndy Wingo1-8/+28
* libguile/scmsigs.c (read_signal_pipe_data, signal_delivery_thread): Leave guile when reading from the signal pipe. Hopefully that lets GC know not to wake up this thread.
2009-12-05remove a bunch of needless scm_permanent_object callsAndy Wingo1-4/+2
* libguile/array-handle.c: * libguile/bytevectors.c: * libguile/deprecated.c: * libguile/eval.c: * libguile/feature.c: * libguile/filesys.c: * libguile/gc.c: * libguile/gdbint.c: * libguile/goops.c: * libguile/instructions.c: * libguile/load.c: * libguile/modules.c: * libguile/numbers.c: * libguile/options.c: * libguile/ports.c: * libguile/scmsigs.c: * libguile/srcprop.c: * libguile/srfi-4.c: * libguile/stacks.c: * libguile/threads.c: * libguile/vm.c: Remove calls to scm_permanent_object, as they are no longer needed with the BDW GC.
2009-09-30Avoid throw from critical section, given invalid sigaction callNeil Jerram1-1/+4
* libguile/scmsigs.c (scm_sigaction_for_thread): Exit critical section before raising out-of-range error. * test-suite/Makefile.am (SCM_TESTS): Add signals.test. * test-suite/tests/signals.test: New file.
2009-08-19Remove unneeded `scm_without_guile ()' call.Ludovic Courtès1-28/+2
* libguile/scmsigs.c (read_without_guile_data, do_read_without_guile, read_without_guile): Remove. (signal_delivery_thread): Use read(2) instead of `read_without_guile ()'.
2009-06-23Remove AC_SYS_RESTARTABLE_SYSCALLS and related codeNeil Jerram1-34/+2
As the Autoconf documentation says, "These days portable programs [...] should not rely on `HAVE_RESTARTABLE_SYSCALLS', since nowadays whether a system call is restartable is a dynamic issue, not a configuration-time issue." In other words, if we ever rely on HAVE_RESTARTABLE_SYSCALLS, we are at the mercy of any code that Guile happens to be linked with, because that code could install a signal handler without the SA_RESTART flag, and then a Guile system call could unexpectedly return EINTR. The readline part of this goes back to this problem report: http://sources.redhat.com/ml/guile/2000-05/msg00177.html; and is an excellent example of the above paragraph. It was noted during the discussion that undefining HAVE_RESTARTABLE_SYSCALLS would fix the problem, but that solution wasn't adopted - I guess because Guile was still using cooperative threads then (not pthreads) and so there was a significant concern (whether founded or not) that not using restartable syscalls (where available) could lead to a loss of performance. Now Guile's default mode of operation is with pthreads, where we already don't assume that HAVE_RESTARTABLE_SYSCALLS is reliable, so there is no possible further performance loss. And in any case we really have no choice, if we want correct operation. Thanks to Sylvain Beucler for reporting this and suggesting the fix. * configure.in (AC_SYS_RESTARTABLE_SYSCALLS): Removed. * doc/ref/posix.texi (Signals): Remove statement that Guile always sets SA_RESTART flag. * guile-readline/configure.in (GUILE_SIGWINCH_SA_RESTART_CLEARED): Remove this setting, together with its test code. (HAVE_RL_PRE_INPUT_HOOK): Remove this setting and its code, as no longer needed. * guile-readline/readline.c (sigwinch_enable_restart): Removed. (scm_init_readline): Remove setting of rl_pre_input_hook. * libguile/_scm.h (SCM_SYSCALL): Remove the definition that relies on HAVE_RESTARTABLE_SYSCALLS. * libguile/scmsigs.c (scm_sigaction_for_thread): Don't always set the SA_RESTART flag if available. Update docstring accordingly. (scm_init_scmsigs): Remove code that sets SA_RESTART flag for all signals. * THANKS: Add Sylvain.
2009-06-17Change Guile license to LGPLv3+Neil Jerram1-6/+7
(Not quite finished, the following will be done tomorrow. module/srfi/*.scm module/rnrs/*.scm module/scripts/*.scm testsuite/*.scm guile-readline/* )
2008-11-30Check the return value of libc's functions to make `_FORTIFY_SOURCE=2' work.Ludovic Courtès1-1/+4
This fixes bug #24009 reported by Martin Pitt. * libguile/threads.c (guilify_self_1): Check the return value of pipe(2). (scm_std_select): Use `full_read ()' instead of `read ()' when reading from WAKEUP_FD. * libguile/async.c (scm_i_queue_async_cell): Use `full_write ()' instead of write(2) when writing to SLEEP_FD. * libguile/fports.c (fport_flush): Likewise. * libguile/posix.c (getgroups): Use the return value of getgroups(2) as NGROUPS. (scm_nice): Get the return value of nice(2) to make glibc happy. * libguile/scmsigs.c (take_signal): Use `full_write ()' instead of write(2).
2008-09-13Include <config.h> in all C files; use `#ifdef HAVE_CONFIG_H' rather than `#if'.Ludovic Courtès1-1/+1
2008-08-27Fix builds `--without-threads'.Ludovic Courtès1-1/+3
2007-10-20Changes from arch/CVS synchronizationLudovic Courtès1-8/+42
2007-03-07merge from 1.8 branchKevin Ryde1-3/+15
2007-01-15merge from 1.8Kevin Ryde1-4/+20
2006-04-17merge from 1.8 branchKevin Ryde1-1/+1
2005-12-14(do_read_without_guile): Use the "raw_data" passed inNeil Jerram1-1/+1
(rather than an uninitialized pointer on the stack).
2005-12-06(read_without_guile): New.Marius Vollmer1-4/+27
(signal_delivery_thread): Use it instead of scm_leave_guile/read/scm_enter_guile.
2005-05-23The FSF has a new address.Marius Vollmer1-1/+1
2005-05-10(signal_delivery_thread): Return a value, to avoidNeil Jerram1-0/+2
compile warning reported by Werner Scheinast.
2005-03-02See ChangeLog from 2005-03-02.Marius Vollmer1-141/+110
2005-01-24(scm_sigaction_for_thread): Use scm_to_long forKevin Ryde1-1/+1
sa_handler, needs to be a long on 64-bit systems where int is only 32 bits.
2005-01-02Use new vector elements API or simple vector API, as appropriate.Marius Vollmer1-16/+16
Removed SCM_HAVE_ARRAYS ifdefery. Replaced all uses of SCM_HASHTABLE_BUCKETS with SCM_HASHTABLE_BUCKET.
2004-09-22*** empty log message ***Marius Vollmer1-2/+2
2004-08-02* numbers.h, numbers.c, discouraged.h, discouraged.c (scm_short2num,Marius Vollmer1-16/+16
scm_ushort2num, scm_int2num, scm_uint2num, scm_long2num, scm_ulong2num, scm_size2num, scm_ptrdiff2num, scm_num2short, scm_num2ushort, scm_num2int, scm_num2uint, scm_num2long, scm_num2ulong, scm_num2size, scm_num2ptrdiff, scm_long_long2num, scm_ulong_long2num, scm_num2long_long, scm_num2ulong_long): Discouraged by moving to discouraged.h and discouraged.c and reimplementing in terms of scm_from_* and scm_to_*. Changed all uses to the new scm_from_* and scm_to_* functions.
2004-07-27* tags.h, deprecated.h (SCM_EQ_P): Deprecated by moving it intoMarius Vollmer1-2/+2
deprecated.h. Replaced all uses with scm_is_eq.
2004-07-23* deprecated.h, deprecated.c, numbers.h (SCM_INUMP, SCM_NINUMP,Marius Vollmer1-8/+8
SCM_INUM): Deprecated by reenaming them to SCM_I_INUMP, SCM_I_NINUMP and SCM_I_INUM, respectively and adding deprecated versions to deprecated.h and deprecated.c. Changed all uses to either use the SCM_I_ variants or scm_is_*, scm_to_*, or scm_from_*, as appropriate.
2004-07-10* validate.h, deprecated.h (SCM_VALIDATE_INUM, SCM_VALIDATE_INUM_COPY,Marius Vollmer1-25/+8
SCM_VALIDATE_BIGINT, SCM_VALIDATE_INUM_MIN, SCM_VALIDATE_INUM_MIN_COPY, SCM_VALIDATE_INUM_MIN_DEF_COPY,SCM_VALIDATE_INUM_DEF, SCM_VALIDATE_INUM_DEF_COPY, SCM_VALIDATE_INUM_RANGE, SCM_VALIDATE_INUM_RANGE_COPY): Deprecated because they make the fixnum/bignum distinction visible. Changed all uses to scm_to_size_t or similar.
2004-07-08* numbers.h (SCM_MAKINUM, SCM_I_MAKINUM): Renamed SCM_MAKINUM toMarius Vollmer1-6/+6
SCM_I_MAKINUM and changed all uses.
2004-07-06* deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,Marius Vollmer1-7/+7
SCM_NEGATE_BOOL, SCM_BOOLP): Deprecated by moving into "deprecated.h". Replaced all uses with scm_is_false, scm_is_true, scm_from_bool, and scm_is_bool, respectively.
2004-05-10(scm_sigaction_for_thread): Validate that the handler is indeed aMarius Vollmer1-1/+1
procedure when it isn't a number.
2004-04-05(scm_sigaction_for_thread): Correction to signum rangeKevin Ryde1-2/+2
test, avoids SCM_VECTOR_REF outside bounds of signal_handlers on calling (sigaction NSIG).
2003-04-05Changed license terms to the plain LGPL thru-out.Marius Vollmer1-35/+11
2003-03-25* scmsigs.c: #include <config.h> if HAVE_CONFIG_H.Rob Browning1-0/+4
2002-11-03* __scm.h (USE_THREADS, GUILE_ISELECT): Define whenMarius Vollmer1-41/+3
SCM_DEBUG_DEPRECATED. Removed their use thru-out Guile.
2002-10-27(signal_cell_handlers, install_handler_data,Marius Vollmer1-20/+153
scm_delq_spine_x, really_install_handler, install_handler): New scheme for triggering signal handlers, to simplify take_signal. (take_signal): Simplified, to avoid race conditions. (scm_sigaction_for_thread): Use new Scheme. Validate that thread hasn't exited yet.
2002-10-16(scm_sigaction_for_thread): It's "USE_THREADS" not "USE_THREAD".Marius Vollmer1-1/+1
2002-10-11* async.c (s_scm_system_async_mark_for_thread): Only callMarius Vollmer1-0/+11
scm_i_thread_root when USE_THREADS is defined. Use scm_root otherwise. * scmsigs.c (take_signal): Only call scm_i_thread_root when USE_THREADS is defined. Use scm_root otherwise. (scm_sigaction_for_thread): Ignore THREAD argument when USE_THREADS is not defined. Also, move THREAD argument defaulting out of HAVE_SIGACTION section, which was a bug.
2002-10-10(scm_sigaction_for_thread): Store original handler in signal_handlers,Marius Vollmer1-2/+1
not the closure that is used as the async. The closure is stored in signal_handler_cells, as previously.
2002-10-05* async.c (scm_async_click): Set the cdr of a executed handlerMarius Vollmer1-1/+1
cell to SCM_BOOL_F, not SCM_EOL. (scm_i_queue_async_cell): Queue the cell at the end of the list, and only if the handler procedure is not already present. (scm_system_async_mark_for_thread): Initialize cdr of handler cell with SCM_BOOL_F. * scmsigs.c (scm_sigaction_for_thread): Likewise.
2002-10-04* scmsigs.h (scm_sigaction_for_thread): New prototype.Marius Vollmer1-47/+55
* scmsigs.c (got_signal): Removed. (signal_handler_cells, signal_handler_threads): New. (take_signal): Queue the cell of the signal for the specified thread. Reset the signal handler on systems that don't have sigaction. (sys_deliver_signals): Removed. (close_1): New. (scm_sigaction_for_thread): Renamed from scm_sigaction and extended to also set the thread of a signal and allocate a cell for it. Keep the Scheme name "sigaction". Check that signum is within range. Also, use SCM_VECTOR_REF instead of SCM_VELTS. (scm_sigaction): Implement in terms of scm_sigaction_for_thread. (scm_init_scmsigs): Allocate signal_handler_cells and signal_handler_threads vectors.
2002-07-202002-07-20 Han-Wen <hanwen@cs.uu.nl>Han-Wen Nienhuys1-17/+16
* *.c: add space after commas everywhere. * *.c: use SCM_VECTOR_SET everywhere, where a vector is written. Document cases where SCM_WRITABLE_VELTS() is used. * vectors.h (SCM_VELTS): prepare for write barrier, and let SCM_VELTS() return a const pointer (SCM_VECTOR_SET): add macro. * autogen.sh (mscripts): find and check version number of autoconf. Complain if 2.53 is not found.
2002-03-14Retire inclusion guard macro SCM_MAGIC_SNARFER.Thien-Thi Nguyen1-2/+0
2002-01-282002-01-28 Stefan Jahn <stefan@lkcc.org>Stefan Jahn1-1/+1
* configure.in (guile_cv_have_uint32_t): Look also in `stdint.h' for uint32_t. 2002-01-28 Stefan Jahn <stefan@lkcc.org> * symbols.c (scm_c_symbol2str): New function, replacement for `gh_scm2newsymbol()'. * strings.c (scm_c_substring2str): New function. Proper replacement for `gh_get_substr()'. * socket.c: Include `stdint.h' if available for the `uint32_t' declaration. * scmsigs.c (s_scm_sigaction): Initialize `chandler' (inhibits compiler warning). * backtrace.c: Include `lang.h' for GUILE_DEBUG conditional.
2001-11-25(scm_take_signal): Removed all code that assumes that signal handlersMarius Vollmer1-30/+1
are allowed to divert the flow of control. Call scm_system_async_mark_from_signal_handler instead of scm_system_async_mark.
2001-11-11* Documentation work.Neil Jerram1-4/+4
2001-11-02Made `usleep()' avalable on MinGW.Marius Vollmer1-2/+3