while (!requestStop) {
var changes = CreateChangeList (ref newFds);
- int numEvents = kevent_notimeout (ref conn, changes, changes.Length, eventBuffer, eventBuffer.Length);
+ int numEvents = kevent_notimeout (conn, changes, changes.Length, eventBuffer, eventBuffer.Length, IntPtr.Zero);
if (numEvents == -1) {
// Stop () signals us to stop by closing the connection
[DllImport ("libc", EntryPoint="kevent")]
extern static int kevent_notimeout (int kq, [In]kevent[] ev, int nchanges, [Out]kevent[] evtlist, int nevents, IntPtr ptr);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- extern static int kevent_notimeout (ref int kq, [In]kevent[] ev, int nchanges, [Out]kevent[] evtlist, int nevents);
}
class KeventWatcher : IFileWatcher
#include <config.h>
#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_EVENT_H
-#include <sys/event.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-
#include <mono/metadata/appdomain.h>
#include <mono/metadata/exception.h>
#include <mono/metadata/filewatcher.h>
return inotify_rm_watch (fd, watch_descriptor);
}
#endif
-
-#if HAVE_KQUEUE
-
-static void
-interrupt_kevent (gpointer data)
-{
- int *kq_ptr = data;
-
- /* Interrupt the kevent () call by closing the fd */
- close (*kq_ptr);
- /* Signal to managed code that the fd is closed */
- *kq_ptr = -1;
-}
-
-/*
- * ves_icall_System_IO_KqueueMonitor_kevent_notimeout:
- *
- * Call kevent (), while handling runtime interruptions.
- */
-int
-ves_icall_System_IO_KqueueMonitor_kevent_notimeout (int *kq_ptr, gpointer changelist, int nchanges, gpointer eventlist, int nevents)
-{
- int res;
- gboolean interrupted;
-
- mono_thread_info_install_interrupt (interrupt_kevent, kq_ptr, &interrupted);
- if (interrupted) {
- close (*kq_ptr);
- *kq_ptr = -1;
- return -1;
- }
-
- MONO_PREPARE_BLOCKING;
- res = kevent (*kq_ptr, changelist, nchanges, eventlist, nevents, NULL);
- MONO_FINISH_BLOCKING;
-
- mono_thread_info_uninstall_interrupt (&interrupted);
-
- return res;
-}
-
-#else
-
-int
-ves_icall_System_IO_KqueueMonitor_kevent_notimeout (int *kq_ptr, gpointer changelist, int nchanges, gpointer eventlist, int nevents)
-{
- g_assert_not_reached ();
- return -1;
-}
-
-#endif /* #if HAVE_KQUEUE */
int ves_icall_System_IO_InotifyWatcher_AddWatch (int fd, MonoString *directory, gint32 mask);
int ves_icall_System_IO_InotifyWatcher_RemoveWatch (int fd, gint32 watch_descriptor);
-int ves_icall_System_IO_KqueueMonitor_kevent_notimeout (int *kq, gpointer changelist, int nchanges, gpointer eventlist, int nevents);
-
G_END_DECLS
#endif
ICALL(INOW_2, "GetInotifyInstance", ves_icall_System_IO_InotifyWatcher_GetInotifyInstance)
ICALL(INOW_3, "RemoveWatch", ves_icall_System_IO_InotifyWatcher_RemoveWatch)
-ICALL_TYPE(KQUEM, "System.IO.KqueueMonitor", KQUEM_1)
-ICALL(KQUEM_1, "kevent_notimeout", ves_icall_System_IO_KqueueMonitor_kevent_notimeout)
-
ICALL_TYPE(MMAPIMPL, "System.IO.MemoryMappedFiles.MemoryMapImpl", MMAPIMPL_1)
ICALL(MMAPIMPL_1, "CloseMapping", mono_mmap_close)
ICALL(MMAPIMPL_2, "ConfigureHandleInheritability", mono_mmap_configure_inheritability)