From 4c84f2e80a87643acf19fa315c84fcd21f60b14d Mon Sep 17 00:00:00 2001 From: Cyrus Harmon Date: Thu, 5 Apr 2007 00:33:21 +0000 Subject: [PATCH] 1.0.4.26: fix wrapped stat struct for darwin * st-size should be on off-t on darwin, instead of unsigned-int and st-blksize should be an unsigned-int instead of an unsigned-long * use dev_t and off_t on darwin to figure out the size of st_rdev and st_size * add ffi_blksize_t for wrapped_st_blksize --- src/code/unix.lisp | 7 +++++-- src/runtime/wrap.c | 11 ++++++++++- version.lisp-expr | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/code/unix.lisp b/src/code/unix.lisp index 26fae5c..5147726 100644 --- a/src/code/unix.lisp +++ b/src/code/unix.lisp @@ -641,8 +641,11 @@ SYSCALL-FORM. Repeat evaluation of SYSCALL-FORM if it is interrupted." (st-rdev #!-(or mips largefile) unsigned-int #!+mips unsigned-long #!+largefile dev-t) - (st-size #!-(or mips largefile) unsigned-int - #!+(or mips largefile) off-t) + (st-size #!-(or darwin mips largefile) unsigned-int + #!+(or darwin mips largefile) off-t) + #!+(and darwin) + (st-blksize unsigned-int) + #!-(and darwin) (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 f0e5746..93c6bcf 100644 --- a/src/runtime/wrap.c +++ b/src/runtime/wrap.c @@ -173,11 +173,20 @@ typedef off_t ffi_off_t; #elif defined(LISP_FEATURE_MIPS) typedef unsigned long ffi_dev_t; /* Linux/MIPS struct stat doesn't use dev_t */ typedef off_t ffi_off_t; +#elif defined(LISP_FEATURE_DARWIN) +typedef dev_t ffi_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 +#if defined(LISP_FEATURE_DARWIN) +typedef blksize_t ffi_blksize_t; +#else +typedef unsigned long ffi_blksize_t; +#endif + /* a representation of stat(2) results which doesn't depend on CPU or OS */ struct stat_wrapper { /* KLUDGE: The verbose wrapped_st_ prefixes are to protect us from @@ -204,7 +213,7 @@ struct stat_wrapper { #endif ffi_dev_t wrapped_st_rdev; /* device type (if inode device) */ ffi_off_t wrapped_st_size; /* total size, in bytes */ - unsigned long wrapped_st_blksize; /* blocksize for filesystem I/O */ + ffi_blksize_t wrapped_st_blksize; /* blocksize for filesystem I/O */ unsigned long wrapped_st_blocks; /* number of blocks allocated */ time_t wrapped_st_atime; /* time_t of last access */ time_t wrapped_st_mtime; /* time_t of last modification */ diff --git a/version.lisp-expr b/version.lisp-expr index bbf73fd..256af82 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".) -"1.0.4.25" +"1.0.4.26" -- 1.7.10.4