X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fbsd-os.c;h=dffa492417dc3b184b2c3167321ab01112e199dd;hb=43764bd6f6d471d361d96dc3bcbd06bd51bc9788;hp=6d1679007b29091401a6d9ac0d7cb6958af10c17;hpb=17ae4361ba5f4c1062d510f3951b0cc10e0bcd8e;p=sbcl.git diff --git a/src/runtime/bsd-os.c b/src/runtime/bsd-os.c index 6d16790..dffa492 100644 --- a/src/runtime/bsd-os.c +++ b/src/runtime/bsd-os.c @@ -52,7 +52,8 @@ os_vm_size_t os_vm_page_size; #include #include #include /* For the stat-family wrappers. */ - +#include /* For the opendir()/readdir() wrappers */ +#include /* For the socket() wrapper */ static void netbsd_init(); #endif /* __NetBSD__ */ @@ -206,7 +207,7 @@ memory_fault_handler(int signal, siginfo_t *siginfo, void *void_context #ifdef LISP_FEATURE_C_STACK_IS_CONTROL_STACK lisp_memory_fault_error(context, fault_addr); #else - if (!interrupt_maybe_gc_int(signal, siginfo, context)) { + if (!maybe_gc(context)) { interrupt_handle_now(signal, siginfo, context); } #if defined(LISP_FEATURE_DARWIN) @@ -268,9 +269,9 @@ sigsegv_handler(int signal, siginfo_t *info, void* void_context) unsigned int pc = (unsigned int *)(*os_context_pc_addr(context)); os_vm_address_t addr; - addr = arch_get_bad_addr(signal,info,context); - if(!interrupt_maybe_gc(signal, info, context)) - if(!handle_guard_page_triggered(context,addr)) + addr = arch_get_bad_addr(signal, info, context); + if (!cheneygc_handle_wp_violation(context, addr)) + if (!handle_guard_page_triggered(context, addr)) interrupt_handle_now(signal, info, context); /* Work around G5 bug; fix courtesy gbyers */ DARWIN_FIX_CONTEXT(context); @@ -327,24 +328,44 @@ The system may fail to start.\n", } } -/* The stat() routines in NetBSD's C library are compatibility - wrappers for some very old version of the stat buffer structure. - Programs must be processed by the C toolchain in order to get an - up-to-date definition of the stat() routine. These wrappers are - used only in sb-posix, as of 2006-10-15. -- RMK */ -int _stat(const char *path, struct stat *sb) { - return (stat(path, sb)); +/* Various routines in NetBSD's C library are compatibility wrappers + for old versions. Programs must be processed by the C toolchain in + order to get up-to-date definitions of such routines. */ +/* The stat-family, opendir, and readdir are used only in sb-posix, as + of 2007-01-16. -- RMK */ +int +_stat(const char *path, struct stat *sb) +{ + return stat(path, sb); } - -int _lstat(const char *path, struct stat *sb) { - return (lstat(path, sb)); +int +_lstat(const char *path, struct stat *sb) +{ + return lstat(path, sb); } - -int _fstat(int fd, struct stat *sb) { - return (fstat(fd, sb)); +int +_fstat(int fd, struct stat *sb) +{ + return fstat(fd, sb); } +DIR * +_opendir(const char *filename) +{ + return opendir(filename); +} +struct dirent * +_readdir(DIR *dirp) +{ + return readdir(dirp); +} +/* Used in sb-bsd-sockets. */ +int +_socket(int domain, int type, int protocol) +{ + return socket(domain, type, protocol); +} #endif /* __NetBSD__ */ #ifdef __FreeBSD__