(syscall-error))
(alien-to-stat a-stat stat)))))))
-(define-stat-call #-win32 "stat" #+win32 "_stat" pathname filename
+;; Note: _stat, _lstat, and _fstat for NetBSD are provided in
+;; src/runtime/bsd-os.c. See comments in that file
+;; for an explanation. -- RMK 2006-10-15
+(define-stat-call #-(or win32 netbsd) "stat" #+(or win32 netbsd) "_stat"
+ pathname filename
(function int c-string (* alien-stat)))
#-win32
-(define-stat-call "lstat" pathname filename
+(define-stat-call #-netbsd "lstat" #+netbsd "_lstat" pathname filename
(function int c-string (* alien-stat)))
;;; No symbolic links on Windows, so use stat
#+win32
(export (defun lstat (filename &optional stat)
(if stat (stat filename stat) (stat filename)))))
-(define-stat-call #-win32 "fstat" #+win32 "_fstat" fd file-descriptor
+(define-stat-call #-(or win32 netbsd) "fstat" #+(or win32 netbsd) "_fstat"
+ fd file-descriptor
(function int int (* alien-stat)))
#include <sys/resource.h>
#include <sys/sysctl.h>
#include <string.h>
+#include <sys/stat.h> /* For the stat-family wrappers. */
static void netbsd_init();
#endif /* __NetBSD__ */
strerror(errno));
}
}
+
+/* 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));
+}
+
+int _lstat(const char *path, struct stat *sb) {
+ return (lstat(path, sb));
+}
+
+int _fstat(int fd, struct stat *sb) {
+ return (fstat(fd, sb));
+}
+
+
#endif /* __NetBSD__ */
#ifdef __FreeBSD__
;;; 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.9.18.22"
+"0.9.18.23"