uv: Cherry-pick joyent/libuv@3c41597
authorisaacs <i@izs.me>
Tue, 17 Apr 2012 22:45:48 +0000 (15:45 -0700)
committerisaacs <i@izs.me>
Tue, 17 Apr 2012 22:45:48 +0000 (15:45 -0700)
deps/uv/include/uv-private/uv-unix.h
deps/uv/src/unix/ev/ev_kqueue.c
deps/uv/src/unix/internal.h
deps/uv/src/unix/kqueue.c

index 798be5e0e7e213d5ee390d13ca50101552db466f..bb8e5d6b9bc36c7de981f19a1085a913afa81a67 100644 (file)
@@ -223,7 +223,7 @@ typedef void* uv_lib_t;
   ev_io read_watcher;                 \
   uv_fs_event_cb cb;
 
-#elif (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) \
+#elif defined(__APPLE__)  \
   || defined(__FreeBSD__) \
   || defined(__OpenBSD__) \
   || defined(__NetBSD__)
index f03cb8083d7c96f4b7a6b4442bb8bf2cb0586505..871e771bc209e9fabf869df1d0c55ced491be77e 100644 (file)
 #include <string.h>
 #include <errno.h>
 
+/* These are the same on OS X and the BSDs. */
+#ifndef NOTE_DELETE
+# define NOTE_DELETE  0x01
+#endif
+#ifndef NOTE_WRITE
+# define NOTE_WRITE    0x02
+#endif
+#ifndef NOTE_EXTEND
+# define NOTE_EXTEND  0x04
+#endif
+#ifndef NOTE_ATTRIB
+# define NOTE_ATTRIB  0x08
+#endif
+#ifndef NOTE_LINK
+# define NOTE_LINK    0x10
+#endif
+#ifndef NOTE_RENAME
+# define NOTE_RENAME  0x20
+#endif
+#ifndef NOTE_REVOKE
+# define NOTE_REVOKE  0x40
+#endif
+
+
 extern void
 uv__kqueue_hack (EV_P_ int fflags, ev_io *w);
 
index 3cc086f2651eefb4c07b09f175b7c5a75b2a038b..bd2ee0ffd3973e359acf0d5c1a16f8a05728a4ae 100644 (file)
@@ -125,7 +125,7 @@ inline static int sys_accept4(int fd,
 #endif
 
 /* FIXME exact copy of the #ifdef guard in uv-unix.h */
-#if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) \
+#if defined(__APPLE__)  \
   || defined(__FreeBSD__) \
   || defined(__OpenBSD__) \
   || defined(__NetBSD__)
index 58988f9d1bb2b4e0384f024c543fcc18ccb68ae1..ec3ba32e823c3048522d3780131d540a7c8d71f8 100644 (file)
@@ -26,8 +26,6 @@
 #include <string.h>
 #include <errno.h>
 
-#if HAVE_KQUEUE
-
 #include <sys/sysctl.h>
 #include <sys/types.h>
 #include <sys/event.h>
@@ -127,28 +125,3 @@ void uv__fs_event_destroy(uv_fs_event_t* handle) {
   close(handle->fd);
   handle->fd = -1;
 }
-
-#else /* !HAVE_KQUEUE */
-
-int uv_fs_event_init(uv_loop_t* loop,
-                     uv_fs_event_t* handle,
-                     const char* filename,
-                     uv_fs_event_cb cb,
-                     int flags) {
-  loop->counters.fs_event_init++;
-  uv__set_sys_error(loop, ENOSYS);
-  return -1;
-}
-
-
-void uv__fs_event_destroy(uv_fs_event_t* handle) {
-  UNREACHABLE();
-}
-
-
-/* Called by libev, don't touch. */
-void uv__kqueue_hack(EV_P_ int fflags, ev_io *w) {
-  UNREACHABLE();
-}
-
-#endif /* HAVE_KQUEUE */