-static void
-memory_fault_handler(int signal, siginfo_t *siginfo, void *void_context)
-{
- /* The way that we extract low level information like the fault
- * address is not specified by POSIX. */
-#if defined __FreeBSD__
- void *fault_addr = siginfo->si_addr;
-#elif defined __OpenBSD__
- void *fault_addr = siginfo->si_addr;
-#else
-#error unsupported BSD variant
-#endif
- if (!gencgc_handle_wp_violation(fault_addr)) {
- interrupt_handle_now(signal, siginfo, void_context);
- }
-}
-void
-os_install_interrupt_handlers(void)
-{
-#if defined __FreeBSD__
- interrupt_install_low_level_handler(SIGBUS, memory_fault_handler);
-#elif defined __OpenBSD__
- interrupt_install_low_level_handler(SIGSEGV, memory_fault_handler);
-#else
-#error unsupported BSD variant
-#endif
-}
-
-#endif /* !defined GENCGC */
-
-/* feh!
- *
- * DL_WORKAROUND enables "stubbing" of various functions from libc et
- * al. This is necessary when using dynamic linking in FreeBSD, as the
- * symbols in the dynamic libraries will not have known addresses (in
- * sbcl.nm).
- *
- * FIXME: This flag should be set in Config.bsd */
-#define DL_WORKAROUND 1
-
-#if DL_WORKAROUND
-#include <unistd.h>
-#include <dlfcn.h>
-#include <math.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <time.h>
-#include <sys/resource.h>
-#include <signal.h>
-#include <fcntl.h>
-
-void *ldso_stub__dlopen(const char *path, int mode)
-{
- return dlopen(path, mode);
-}
-
-void *ldso_stub__dlsym(void *handle, const char *symbol)
-{
- return dlsym(handle, symbol);
-}
-
-const char *ldso_stub__dlerror(void)
-{
- return dlerror();
-}
-int ldso_stub__access(const char *path, int mode)
-{
- return access(path, mode);
-}
-
-double ldso_stub__acos(double x)
-{
- return acos(x);
-}
-
-double ldso_stub__acosh(double x)
-{
- return acosh(x);
-}
-
-double ldso_stub__asin(double x)
-{
- return asin(x);
-}