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

Replace `__hsunix_nanosleep` wrapper with CApiFFI

parent 944b05c4
No related branches found
No related tags found
No related merge requests found
...@@ -181,9 +181,9 @@ nanosleep nsecs = do ...@@ -181,9 +181,9 @@ nanosleep nsecs = do
else throwErrno "nanosleep" else throwErrno "nanosleep"
loop (fromIntegral tv_sec0 :: CTime) (fromIntegral tv_nsec0 :: CTime) loop (fromIntegral tv_sec0 :: CTime) (fromIntegral tv_nsec0 :: CTime)
data CTimeSpec data {-# CTYPE "struct timespec" #-} CTimeSpec
foreign import ccall safe "__hsunix_nanosleep" foreign import capi safe "HsUnix.h nanosleep"
c_nanosleep :: Ptr CTimeSpec -> Ptr CTimeSpec -> IO CInt c_nanosleep :: Ptr CTimeSpec -> Ptr CTimeSpec -> IO CInt
#endif #endif
......
...@@ -34,14 +34,6 @@ int __hsunix_getpwuid_r(uid_t uid, struct passwd *pw, char *buffer, ...@@ -34,14 +34,6 @@ int __hsunix_getpwuid_r(uid_t uid, struct passwd *pw, char *buffer,
} }
#endif #endif
#ifdef HAVE_NANOSLEEP
// nanosleep is a macro on some platforms, so we need a wrapper:
int __hsunix_nanosleep(const struct timespec *rqtp, struct timespec *rmtp)
{
return nanosleep(rqtp, rmtp);
}
#endif
#ifdef HAVE_PTSNAME #ifdef HAVE_PTSNAME
// I cannot figure out how to make the definitions of the following // I cannot figure out how to make the definitions of the following
// functions visible in <stdlib.h> on Linux. But these definitions // functions visible in <stdlib.h> on Linux. But these definitions
......
...@@ -125,11 +125,6 @@ int __hsunix_getpwuid_r(uid_t, struct passwd *, char *, size_t, ...@@ -125,11 +125,6 @@ int __hsunix_getpwuid_r(uid_t, struct passwd *, char *, size_t,
struct passwd **); struct passwd **);
#endif #endif
#ifdef HAVE_NANOSLEEP
// nanosleep is a macro on some platforms, so we need a wrapper:
int __hsunix_nanosleep(const struct timespec *, struct timespec *);
#endif
#ifdef HAVE_PTSNAME #ifdef HAVE_PTSNAME
// I cannot figure out how to make the definitions of the following // I cannot figure out how to make the definitions of the following
// functions visible in <stdlib.h> on Linux. But these definitions // functions visible in <stdlib.h> on Linux. But these definitions
......
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