Browse files

Add patches from Aymeric Vincent to fix sb-posix on recentish NetBSD.

There is some possibility that this will break one of the sb-posix tests on FreeBSD:

  The "rmdir" patch needs some input from FreeBSD users.
  "rmdir /" returns EBUSY on NetBSD. Given the recent commit
  2a9b33f on october, 17. 2011, it looks
  like OpenBSD and Darwin return EISDIR, but it's clearly not the case of
  NetBSD with a (usual) FFS file system.

  In short, either sbcl is currently broken on FreeBSD wrt the rmdir test
  and my patch will fix it, or my patch will break it and we need to include
  freebsd in the list of OSes producing EISDIR upon "rmdir /".
  • Loading branch information...
1 parent abb03f9 commit 6548750bc1ca4d832afed1744cdc7133b232c6f2 @jimwise jimwise committed Jan 17, 2012
Showing with 12 additions and 4 deletions.
  1. +3 −2 contrib/sb-posix/interface.lisp
  2. +2 −2 contrib/sb-posix/posix-tests.lisp
  3. +7 −0 src/runtime/bsd-os.c
5 contrib/sb-posix/interface.lisp
@@ -743,8 +743,9 @@ not supported."
(export 'utime :sb-posix)
(defun utime (filename &optional access-time modification-time)
- (let ((fun (extern-alien "utime" (function int (c-string :not-null t)
- (* alien-utimbuf))))
+ (let ((fun (extern-alien #-netbsd "utime" #+netbsd "_utime"
+ (function int (c-string :not-null t)
+ (* alien-utimbuf))))
(name (filename filename)))
(if (not (and access-time modification-time))
(alien-funcall fun name nil)
4 contrib/sb-posix/posix-tests.lisp
@@ -174,15 +174,15 @@
(sb-posix:syscall-errno c)
- #+bsd
+ #+(or darwin openbsd)
- #-(or bsd win32 sunos)
+ #-(or darwin openbsd win32 sunos) t)
(deftest rmdir.error.4
7 src/runtime/bsd-os.c
@@ -22,6 +22,7 @@
#include <sys/param.h>
#include <sys/file.h>
#include <unistd.h>
+#include <utime.h>
#include <assert.h>
#include <errno.h>
#include "sbcl.h"
@@ -342,6 +343,12 @@ _readdir(DIR *dirp)
return readdir(dirp);
+_utime(const char *file, const struct utimbuf *timep)
+ return utime(file, timep);
/* Used in sb-bsd-sockets. */
_socket(int domain, int type, int protocol)

0 comments on commit 6548750

Please sign in to comment.