Add some more C wrappers; patch from Krister Walfridsson
authorIan Lynagh <igloo@earth.li>
Fri, 7 Aug 2009 20:06:31 +0000 (20:06 +0000)
committerIan Lynagh <igloo@earth.li>
Fri, 7 Aug 2009 20:06:31 +0000 (20:06 +0000)
Fixes 21 testsuite errors on NetBSD 5.99.

GHC/Conc.lhs
System/Posix/Internals.hs
include/HsBase.h

index e3f5356..b68cd63 100644 (file)
@@ -1251,7 +1251,7 @@ foreign import ccall unsafe "setTimevalTicks"
 
 data CFdSet
 
-foreign import ccall safe "select"
+foreign import ccall safe "__hscore_select"
   c_select :: CInt -> Ptr CFdSet -> Ptr CFdSet -> Ptr CFdSet -> Ptr CTimeVal
            -> IO CInt
 
index ca0253e..126f753 100644 (file)
@@ -457,7 +457,7 @@ foreign import ccall unsafe "HsBase.h tcgetattr"
 foreign import ccall unsafe "HsBase.h tcsetattr"
    c_tcsetattr :: CInt -> CInt -> Ptr CTermios -> IO CInt
 
-foreign import ccall unsafe "HsBase.h utime"
+foreign import ccall unsafe "HsBase.h __hscore_utime"
    c_utime :: CString -> Ptr CUtimbuf -> IO CInt
 
 foreign import ccall unsafe "HsBase.h waitpid"
index 56a660e..9bc5f28 100644 (file)
@@ -201,6 +201,10 @@ __hscore_sigdelset( sigset_t * set, int s )
 INLINE int
 __hscore_sigismember( sigset_t * set, int s )
 { return sigismember(set,s); }
+
+INLINE int
+__hscore_utime( const char *file, const struct utimbuf *timep )
+{ return utime(file,timep); }
 #endif
 
 // This is used by dph:Data.Array.Parallel.Arr.BUArr, and shouldn't be
@@ -620,6 +624,11 @@ INLINE HsInt sizeof_fd_set(void) { return sizeof(fd_set); }
 extern void hsFD_ZERO(fd_set *fds);
 #endif
 
+INLINE int __hscore_select(int nfds, fd_set *readfds, fd_set *writefds,
+                           fd_set *exceptfds, struct timeval *timeout) {
+       return (select(nfds,readfds,writefds,exceptfds,timeout));
+}
+
 // gettimeofday()-related
 
 #if !defined(__MINGW32__)