diff options
-rw-r--r-- | System/Posix/Files.hsc | 4 | ||||
-rw-r--r-- | include/HsUnix.h | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/System/Posix/Files.hsc b/System/Posix/Files.hsc index eee52cb..0c80c07 100644 --- a/System/Posix/Files.hsc +++ b/System/Posix/Files.hsc @@ -394,7 +394,7 @@ getSymbolicLinkStatus path = do throwErrnoPathIfMinus1_ "getSymbolicLinkStatus" path (c_lstat s p) return (FileStatus fp) -foreign import ccall unsafe "lstat" +foreign import ccall unsafe "__hsunix_lstat" c_lstat :: CString -> Ptr CStat -> IO CInt -- | @createNamedPipe fifo mode@ @@ -421,7 +421,7 @@ createDevice path mode dev = withCString path $ \s -> throwErrnoPathIfMinus1_ "createDevice" path (c_mknod s mode dev) -foreign import ccall unsafe "mknod" +foreign import ccall unsafe "__hsunix_mknod" c_mknod :: CString -> CMode -> CDev -> IO CInt -- ----------------------------------------------------------------------------- diff --git a/include/HsUnix.h b/include/HsUnix.h index 8669b30..9b2e697 100644 --- a/include/HsUnix.h +++ b/include/HsUnix.h @@ -118,4 +118,16 @@ INLINE int __hsunix_SIGINFO() { return SIGINFO; } INLINE int __hsunix_SIGWINCH() { return SIGWINCH; } #endif +// lstat is a macro on some platforms, so we need a wrapper: +INLINE int __hsunix_lstat(const char *path, struct stat *buf) +{ + return lstat(path,buf); +} + +// lstat is a macro on some platforms, so we need a wrapper: +INLINE int __hsunix_mknod(const char *pathname, mode_t mode, dev_t dev) +{ + return mknod(pathname,mode,dev); +} + #endif |