diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2016-01-30 18:17:00 +0100 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2016-01-30 18:17:00 +0100 |
commit | cca358b86edc72bcb641fca362960917783b599e (patch) | |
tree | 432fd9ba92f757134ec698e188feab3b3de4e3a9 | |
parent | 7a2f3f41b4492c9d2e846ebd832ba7ddbaf063ac (diff) |
Replace `__hsunix_mknod` wrapper with CApiFFI
-rw-r--r-- | System/Posix/Files.hsc | 2 | ||||
-rw-r--r-- | System/Posix/Files/ByteString.hsc | 2 | ||||
-rw-r--r-- | cbits/HsUnix.c | 6 | ||||
-rw-r--r-- | include/HsUnix.h | 3 |
4 files changed, 2 insertions, 11 deletions
diff --git a/System/Posix/Files.hsc b/System/Posix/Files.hsc index 2df973d..d0ff4bf 100644 --- a/System/Posix/Files.hsc +++ b/System/Posix/Files.hsc @@ -215,7 +215,7 @@ createDevice path mode dev = withFilePath path $ \s -> throwErrnoPathIfMinus1_ "createDevice" path (c_mknod s mode dev) -foreign import ccall unsafe "__hsunix_mknod" +foreign import capi unsafe "HsUnix.h mknod" c_mknod :: CString -> CMode -> CDev -> IO CInt -- ----------------------------------------------------------------------------- diff --git a/System/Posix/Files/ByteString.hsc b/System/Posix/Files/ByteString.hsc index e560500..12bd39a 100644 --- a/System/Posix/Files/ByteString.hsc +++ b/System/Posix/Files/ByteString.hsc @@ -221,7 +221,7 @@ createDevice path mode dev = withFilePath path $ \s -> throwErrnoPathIfMinus1_ "createDevice" path (c_mknod s mode dev) -foreign import ccall unsafe "__hsunix_mknod" +foreign import capi unsafe "HsUnix.h mknod" c_mknod :: CString -> CMode -> CDev -> IO CInt -- ----------------------------------------------------------------------------- diff --git a/cbits/HsUnix.c b/cbits/HsUnix.c index 74112c0..dc42098 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 -// mknod is a macro on some platforms, so we need a wrapper: -int __hsunix_mknod(const char *pathname, mode_t mode, dev_t dev) -{ - return mknod(pathname,mode,dev); -} - #ifdef HAVE_GETPWENT // getpwent is a macro on some platforms, so we need a wrapper: struct passwd *__hsunix_getpwent(void) diff --git a/include/HsUnix.h b/include/HsUnix.h index def34ca..87ac3e6 100644 --- a/include/HsUnix.h +++ b/include/HsUnix.h @@ -113,9 +113,6 @@ fall back to O_FSYNC, which should be the same */ # define WCOREDUMP(s) 0 #endif -// 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 // getpwent is a macro on some platforms, so we need a wrapper: struct passwd *__hsunix_getpwent(void); |