:export (;; Information about how the program was invoked is
;; nonstandard but very useful.
"*POSIX-ARGV*" "POSIX-GETENV" "POSIX-ENVIRON"
-
+
;; People have various good reasons to mess with the GC.
"*AFTER-GC-HOOKS*" "*BEFORE-GC-HOOKS*"
"*GC-NOTIFY-AFTER*" "*GC-NOTIFY-BEFORE*" "*GC-NOTIFY-STREAM*"
;; miscellaneous useful supported extensions
"QUIT"
"*MODULE-PROVIDER-FUNCTIONS*"
+ "WITH-TIMEOUT" "TIMEOUT"
;; RUN-PROGRAM is not only useful for users, but also
;; useful to implement parts of SBCL itself, so we're
(reader-error-format-arguments condition)
(reader-impossible-number-error-error condition))))))
-;;; should this inherit from error? good question
-(define-condition timeout (error) ())
+(define-condition sb!ext::timeout (serious-condition) ())
\f
(defun sigalrm-handler (signal info context)
(declare (ignore signal info context))
(declare (type system-area-pointer context))
- (cerror "Continue" 'sb!kernel::timeout))
-
+ (cerror "Continue" 'sb!ext::timeout))
(defun sigquit-handler (signal code context)
(declare (ignore signal code context))
(slot (slot itvo 'it-value) 'tv-usec))
which (alien-sap (addr itvn))(alien-sap (addr itvo))))))
-(defmacro with-timeout (expires &body body)
+(defmacro sb!ext::with-timeout (expires &body body)
"Execute the body, interrupting it with a SIGALRM after at least
EXPIRES seconds have passed. Uses Unix setitimer(), restoring any
previous timer after the body has finished executing"
#include <sys/time.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <linux/version.h>
#include "validate.h"
#include "thread.h"
#include "gc.h"
\f
+int linux_sparc_siginfo_bug = 0;
-#ifdef sparc
-int early_kernel = 0;
-#endif
void os_init(void)
{
- /* Early versions of Linux don't support the mmap(..) functionality
- * that we need. */
+ /* Conduct various version checks: do we have enough mmap(), is
+ * this a sparc running 2.2, can we do threads? */
{
struct utsname name;
int major_version;
-#ifdef sparc
int minor_version;
-#endif
+ char *p;
uname(&name);
- major_version = atoi(name.release);
- if (major_version < 2) {
- lose("linux major version=%d (can't run in version < 2.0.0)",
+ p=name.release;
+ major_version = atoi(p);
+ p=strchr(p,'.')+1;
+ minor_version = atoi(p);
+ if (major_version<2) {
+ lose("linux kernel version too old: major version=%d (can't run in version < 2.0.0)",
major_version);
}
-#ifdef sparc
- /* KLUDGE: This will break if Linux moves to a uname() version number
- * that has more than one digit initially -- CSR, 2002-02-12 */
- minor_version = atoi(name.release+2);
- if (minor_version < 4) {
- FSHOW((stderr,"linux minor version=%d;\n enabling workarounds for SPARC kernel bugs in signal handling.\n", minor_version));
- early_kernel = 1;
+#ifdef LISP_FEATURE_SB_THREAD
+ if ((major_version <2) || (major_version==2 && minor_version < 4)) {
+ lose("linux kernel 2.4 required for thread-enabled SBCL");
+ }
+#endif
+#ifdef LISP_FEATURE_SPARC
+ if ((major_version <2) || (major_version==2 && minor_version < 4)) {
+ FSHOW((stderr,"linux kernel %d.%d predates 2.4;\n enabling workarounds for SPARC kernel bugs in signal handling.\n", minor_version));
+ linux_sparc_siginfo_bug = 1;
}
#endif
}
#include "monitor.h"
#ifdef LISP_FEATURE_LINUX
-extern int early_kernel;
+extern int linux_sparc_siginfo_bug;
#endif
void arch_init(void)
if ((siginfo->si_code) == ILL_ILLOPC
#ifdef LISP_FEATURE_LINUX
- || (early_kernel && (siginfo->si_code == 2))
+ || (linux_sparc_siginfo_bug && (siginfo->si_code == 2))
#endif
) {
int trap;
}
else if ((siginfo->si_code) == ILL_ILLTRP
#ifdef LISP_FEATURE_LINUX
- || (early_kernel && (siginfo->si_code) == 192)
+ || (linux_sparc_siginfo_bug && (siginfo->si_code) == 192)
#endif
) {
if (pseudo_atomic_trap_p(context)) {
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.pre8.108"
+"0.pre8.109"