From 3598e49d52236b3992d4785605a732aa52776f85 Mon Sep 17 00:00:00 2001 From: Thiemo Seufer Date: Wed, 12 Oct 2005 15:12:17 +0000 Subject: [PATCH] 0.9.5.49: Add mips-specific ugliness to stat(2) wrapper handling. --- src/code/unix.lisp | 15 ++++++++++++--- src/runtime/wrap.c | 10 +++++++++- version.lisp-expr | 2 +- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/code/unix.lisp b/src/code/unix.lisp index f411a38..e6dfddf 100644 --- a/src/code/unix.lisp +++ b/src/code/unix.lisp @@ -573,14 +573,23 @@ SYSCALL-FORM. Repeat evaluation of SYSCALL-FORM if it is interrupted." ;;; longer than 32 bits anyway, right?":-| (define-alien-type nil (struct wrapped_stat + #!-mips (st-dev unsigned-int) ; would be dev-t in a real stat + #!+mips + (st-dev unsigned-long) ; this is _not_ a dev-t on mips (st-ino ino-t) (st-mode mode-t) - (st-nlink nlink-t) - (st-uid uid-t) - (st-gid gid-t) + (st-nlink nlink-t) + (st-uid uid-t) + (st-gid gid-t) + #!-mips (st-rdev unsigned-int) ; would be dev-t in a real stat + #!+mips + (st-rdev unsigned-long) ; this is _not_ a dev-t on mips + #!-mips (st-size unsigned-int) ; would be off-t in a real stat + #!+mips + (st-size off-t) (st-blksize unsigned-long) (st-blocks unsigned-long) (st-atime time-t) diff --git a/src/runtime/wrap.c b/src/runtime/wrap.c index 2b90248..365d895 100644 --- a/src/runtime/wrap.c +++ b/src/runtime/wrap.c @@ -155,9 +155,17 @@ wrapped_readlink(char *path) * actual 64-bit values instead. In fact, we probably have by now * (2003-10-03) on all working platforms except MIPS and HPPA; if some * motivated spark would simply fix those, this hack could go away. - * -- CSR, 2003-10-03 */ + * -- CSR, 2003-10-03 + * + * Some motivated spark fixed MIPS. -- ths, 2005-10-06 */ + +#ifdef LISP_FEATURE_MIPS +typedef unsigned long ffi_dev_t; /* Linux/MIPS struct stat doesn't use dev_t */ +typedef off_t ffi_off_t; +#else typedef u32 ffi_dev_t; /* since Linux dev_t can be 64 bits */ typedef u32 ffi_off_t; /* since OpenBSD 2.8 st_size is 64 bits */ +#endif /* a representation of stat(2) results which doesn't depend on CPU or OS */ struct stat_wrapper { diff --git a/version.lisp-expr b/version.lisp-expr index c61f131..1368416 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; 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.5.48" +"0.9.5.49" -- 1.7.10.4