-#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);
-}
-
-double ldso_stub__asinh(double x)
-{
- return asin(x);
-}
-
-double ldso_stub__atanh(double x)
-{
- return atanh(x);
-}
-
-
-int ldso_stub__chdir(const char *path)
-{
- return chdir(path);
-}
-
-int ldso_stub__close(int d)
-{
- return close(d);
-}
-
-int ldso_stub__closedir(DIR *dirp)
-{
- return closedir(dirp);
-}
-
-double ldso_stub__cosh(double x)
-{
- return cosh(x);
-}
-
-void ldso_stub__exit(int status)
-{
- exit(status);
-}
-
-void ldso_stub__free(void *ptr)
-{
- free(ptr);
-}
-
-int ldso_stub__fstat(int fd, struct stat *sb)
-{
- return fstat(fd, sb);