diff options
-rw-r--r-- | System/Posix/Resource.hsc | 4 | ||||
-rw-r--r-- | System/Posix/Temp.hsc | 2 | ||||
-rw-r--r-- | include/HsUnix.h | 16 |
3 files changed, 19 insertions, 3 deletions
diff --git a/System/Posix/Resource.hsc b/System/Posix/Resource.hsc index 067e5df..ec3c660 100644 --- a/System/Posix/Resource.hsc +++ b/System/Posix/Resource.hsc @@ -59,10 +59,10 @@ data ResourceLimit type RLimit = () -foreign import ccall unsafe "HsBase.h __hscore_getrlimit" +foreign import ccall unsafe "HsUnix.h __hscore_getrlimit" c_getrlimit :: CInt -> Ptr RLimit -> IO CInt -foreign import ccall unsafe "HsBase.h __hscore_setrlimit" +foreign import ccall unsafe "HsUnix.h __hscore_setrlimit" c_setrlimit :: CInt -> Ptr RLimit -> IO CInt getResourceLimit :: Resource -> IO ResourceLimits diff --git a/System/Posix/Temp.hsc b/System/Posix/Temp.hsc index f9ebc68..53eced4 100644 --- a/System/Posix/Temp.hsc +++ b/System/Posix/Temp.hsc @@ -61,6 +61,6 @@ foreign import ccall unsafe "mktemp" c_mktemp :: CString -> IO CString #endif -foreign import ccall unsafe "HsBase.h __hscore_mkstemp" +foreign import ccall unsafe "HsUnix.h __hscore_mkstemp" c_mkstemp :: CString -> IO CInt diff --git a/include/HsUnix.h b/include/HsUnix.h index 2df3932..7aee685 100644 --- a/include/HsUnix.h +++ b/include/HsUnix.h @@ -174,4 +174,20 @@ INLINE int __hsunix_push_module(int fd, const char *module) #endif } +#if !defined(__MINGW32__) +INLINE int __hscore_mkstemp(char *filetemplate) { + return (mkstemp(filetemplate)); +} +#endif + +#if !defined(__MINGW32__) && !defined(irix_HOST_OS) +INLINE int __hscore_getrlimit(int resource, struct rlimit *rlim) { + return (getrlimit(resource, rlim)); +} + +INLINE int __hscore_setrlimit(int resource, struct rlimit *rlim) { + return (setrlimit(resource, rlim)); +} +#endif + #endif |