Commit 2ea50a1b authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

Use CAPI to make the C wrapper for kevent

parent e2fec979
...@@ -305,7 +305,7 @@ foreign import ccall safe "kevent64" ...@@ -305,7 +305,7 @@ foreign import ccall safe "kevent64"
c_kevent64 :: QueueFd -> Ptr Event -> CInt -> Ptr Event -> CInt -> CUInt c_kevent64 :: QueueFd -> Ptr Event -> CInt -> Ptr Event -> CInt -> CUInt
-> Ptr TimeSpec -> IO CInt -> Ptr TimeSpec -> IO CInt
#elif defined(HAVE_KEVENT) #elif defined(HAVE_KEVENT)
foreign import ccall safe "__hscore_kevent" foreign import capi safe "sys/event.h kevent"
c_kevent :: QueueFd -> Ptr Event -> CInt -> Ptr Event -> CInt c_kevent :: QueueFd -> Ptr Event -> CInt -> Ptr Event -> CInt
-> Ptr TimeSpec -> IO CInt -> Ptr TimeSpec -> IO CInt
#else #else
......
...@@ -155,10 +155,6 @@ extern HsWord64 getMonotonicUSec(void); ...@@ -155,10 +155,6 @@ extern HsWord64 getMonotonicUSec(void);
#include <sys/select.h> #include <sys/select.h>
#endif #endif
#if HAVE_SYS_EVENT_H
#include <sys/event.h>
#endif
/* in inputReady.c */ /* in inputReady.c */
extern int fdReady(int fd, int write, int msecs, int isSock); extern int fdReady(int fd, int write, int msecs, int isSock);
...@@ -545,15 +541,6 @@ INLINE int __hscore_open(char *file, int how, mode_t mode) { ...@@ -545,15 +541,6 @@ INLINE int __hscore_open(char *file, int how, mode_t mode) {
} }
#endif #endif
#ifdef HAVE_KEVENT
INLINE int __hscore_kevent(int kq, const struct kevent *changelist,
size_t nchanges, struct kevent *eventlist,
size_t nevents, const struct timespec *timeout) {
return kevent(kq, changelist, nchanges, eventlist, nevents, timeout);
}
#endif
#if darwin_HOST_OS #if darwin_HOST_OS
// You should not access _environ directly on Darwin in a bundle/shared library. // You should not access _environ directly on Darwin in a bundle/shared library.
// See #2458 and http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man7/environ.7.html // See #2458 and http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man7/environ.7.html
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment