From: simonmar Date: Wed, 18 Feb 2004 15:07:04 +0000 (+0000) Subject: [project @ 2004-02-18 15:07:03 by simonmar] X-Git-Tag: nhc98-1-18-release~373 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=3b49c6c0b4f4a638e773dbd978dbdd8d238de067;p=haskell-directory.git [project @ 2004-02-18 15:07:03 by simonmar] stat() needs to be wrapped too --- diff --git a/System/Posix/Internals.hs b/System/Posix/Internals.hs index 989a082..e5dbaaf 100644 --- a/System/Posix/Internals.hs +++ b/System/Posix/Internals.hs @@ -377,7 +377,7 @@ foreign import ccall unsafe "HsBase.h rewinddir" foreign import ccall unsafe "HsBase.h rmdir" c_rmdir :: CString -> IO CInt -foreign import ccall unsafe "HsBase.h stat" +foreign import ccall unsafe "HsBase.h __hscore_stat" c_stat :: CString -> Ptr CStat -> IO CInt foreign import ccall unsafe "HsBase.h umask" diff --git a/include/HsBase.h b/include/HsBase.h index b131841..3f0426c 100644 --- a/include/HsBase.h +++ b/include/HsBase.h @@ -675,7 +675,7 @@ INLINE int __hsposix_SIG_UNBLOCK() { return SIG_UNBLOCK; } INLINE int __hsposix_SIG_SETMASK() { return SIG_SETMASK; } #endif /* mingw32_TARGET_OS */ -// These three are wrapped because on some OSs (eg. Linux) they are +// These are wrapped because on some OSs (eg. Linux) they are // macros which redirect to the 64-bit-off_t versions when large file // support is enabled. // @@ -687,6 +687,10 @@ INLINE off_t __hscore_lseek(int fd, off_t off, int whence) { return (lseek(fd,off,whence)); } +INLINE int __hscore_stat(char *file, struct stat *buf) { + return (stat(file,buf)); +} + INLINE int __hscore_fstat(int fd, struct stat *buf) { return (fstat(fd,buf)); }