Skip to content
Snippets Groups Projects
Commit 36460403 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel :man_dancing:
Browse files

Replace `__hscore_{set,get}rlimit` wrappers with CApiFFI

parent 2ddf4b2b
No related branches found
No related tags found
No related merge requests found
{-# LANGUAGE CApiFFI #-}
#if __GLASGOW_HASKELL__ >= 709 #if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-} {-# LANGUAGE Safe #-}
#else #else
...@@ -57,10 +58,10 @@ data ResourceLimit ...@@ -57,10 +58,10 @@ data ResourceLimit
data {-# CTYPE "struct rlimit" #-} RLimit data {-# CTYPE "struct rlimit" #-} RLimit
foreign import ccall unsafe "HsUnix.h __hscore_getrlimit" foreign import capi unsafe "HsUnix.h getrlimit"
c_getrlimit :: CInt -> Ptr RLimit -> IO CInt c_getrlimit :: CInt -> Ptr RLimit -> IO CInt
foreign import ccall unsafe "HsUnix.h __hscore_setrlimit" foreign import capi unsafe "HsUnix.h setrlimit"
c_setrlimit :: CInt -> Ptr RLimit -> IO CInt c_setrlimit :: CInt -> Ptr RLimit -> IO CInt
getResourceLimit :: Resource -> IO ResourceLimits getResourceLimit :: Resource -> IO ResourceLimits
......
...@@ -81,17 +81,6 @@ char *__hscore_mkdtemp(char *filetemplate) { ...@@ -81,17 +81,6 @@ char *__hscore_mkdtemp(char *filetemplate) {
} }
#endif #endif
#if !defined(irix_HOST_OS)
int __hscore_getrlimit(int resource, struct rlimit *rlim) {
return (getrlimit(resource, rlim));
}
int __hscore_setrlimit(int resource, struct rlimit *rlim) {
return (setrlimit(resource, rlim));
}
#endif
#ifdef HAVE_UNSETENV #ifdef HAVE_UNSETENV
int __hsunix_unsetenv(const char *name) int __hsunix_unsetenv(const char *name)
{ {
......
...@@ -144,11 +144,6 @@ int __hscore_mkstemps(char *filetemplate, int suffixlen); ...@@ -144,11 +144,6 @@ int __hscore_mkstemps(char *filetemplate, int suffixlen);
char *__hscore_mkdtemp(char *filetemplate); char *__hscore_mkdtemp(char *filetemplate);
#endif #endif
#if !defined(irix_HOST_OS)
int __hscore_getrlimit(int resource, struct rlimit *rlim);
int __hscore_setrlimit(int resource, struct rlimit *rlim);
#endif
int __hsunix_unsetenv(const char *name); int __hsunix_unsetenv(const char *name);
/* A size that will contain many path names, but not necessarily all /* A size that will contain many path names, but not necessarily all
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment