aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Herbert Valerio Riedel <hvr@gnu.org>2016-01-30 18:13:39 +0100
committerGravatar Herbert Valerio Riedel <hvr@gnu.org>2016-01-30 18:13:39 +0100
commit7a2f3f41b4492c9d2e846ebd832ba7ddbaf063ac (patch)
tree85461dd3b5a6c27ac48c3edefe8ec696261f6ce3
parent2b47647ebef1499ceb5e77d7e19c4c8745b473c7 (diff)
Replace `__hsunix_lstat` wrapper with CApiFFI
-rw-r--r--System/Posix/Files.hsc2
-rw-r--r--System/Posix/Files/ByteString.hsc2
-rw-r--r--cbits/HsUnix.c6
-rw-r--r--include/HsUnix.h5
4 files changed, 3 insertions, 12 deletions
diff --git a/System/Posix/Files.hsc b/System/Posix/Files.hsc
index b18a8df..2df973d 100644
--- a/System/Posix/Files.hsc
+++ b/System/Posix/Files.hsc
@@ -187,7 +187,7 @@ getSymbolicLinkStatus path = do
throwErrnoPathIfMinus1_ "getSymbolicLinkStatus" path (c_lstat s p)
return (FileStatus fp)
-foreign import ccall unsafe "__hsunix_lstat"
+foreign import capi unsafe "HsUnix.h lstat"
c_lstat :: CString -> Ptr CStat -> IO CInt
-- | @createNamedPipe fifo mode@
diff --git a/System/Posix/Files/ByteString.hsc b/System/Posix/Files/ByteString.hsc
index 3f26f73..e560500 100644
--- a/System/Posix/Files/ByteString.hsc
+++ b/System/Posix/Files/ByteString.hsc
@@ -193,7 +193,7 @@ getSymbolicLinkStatus path = do
throwErrnoPathIfMinus1_ "getSymbolicLinkStatus" path (c_lstat s p)
return (FileStatus fp)
-foreign import ccall unsafe "__hsunix_lstat"
+foreign import capi unsafe "HsUnix.h lstat"
c_lstat :: CString -> Ptr CStat -> IO CInt
-- | @createNamedPipe fifo mode@
diff --git a/cbits/HsUnix.c b/cbits/HsUnix.c
index a0b15e9..74112c0 100644
--- a/cbits/HsUnix.c
+++ b/cbits/HsUnix.c
@@ -16,12 +16,6 @@ void *__hsunix_rtldNext (void) {return RTLD_NEXT;}
void *__hsunix_rtldDefault (void) {return RTLD_DEFAULT;}
#endif
-// lstat is a macro on some platforms, so we need a wrapper:
-int __hsunix_lstat(const char *path, struct stat *buf)
-{
- return lstat(path,buf);
-}
-
// mknod is a macro on some platforms, so we need a wrapper:
int __hsunix_mknod(const char *pathname, mode_t mode, dev_t dev)
{
diff --git a/include/HsUnix.h b/include/HsUnix.h
index a6bba9a..def34ca 100644
--- a/include/HsUnix.h
+++ b/include/HsUnix.h
@@ -113,10 +113,7 @@ fall back to O_FSYNC, which should be the same */
# define WCOREDUMP(s) 0
#endif
-// lstat is a macro on some platforms, so we need a wrapper:
-int __hsunix_lstat(const char *path, struct stat *buf);
-
-// lstat is a macro on some platforms, so we need a wrapper:
+// mknod is a macro on some platforms, so we need a wrapper:
int __hsunix_mknod(const char *pathname, mode_t mode, dev_t dev);
#ifdef HAVE_GETPWENT