diff --git a/deps/libev/ev.c b/deps/libev/ev.c
index 27274b4..75c0600 100644
--- a/deps/libev/ev.c
+++ b/deps/libev/ev.c
@@ -1558,6 +1558,12 @@ ev_backend (EV_P)
   return backend;
 }
 
+int
+ev_backend_fd (EV_P)
+{
+  return backend_fd;
+}
+
 #if EV_FEATURE_API
 unsigned int
 ev_iteration (EV_P)
@@ -1571,6 +1577,12 @@ ev_depth (EV_P)
   return loop_depth;
 }
 
+int
+ev_loop_fdchangecount (EV_P)
+{
+  return fdchangecnt;
+}
+
 void
 ev_set_io_collect_interval (EV_P_ ev_tstamp interval)
 {
@@ -2293,6 +2305,62 @@ time_update (EV_P_ ev_tstamp max_block)
     }
 }
 
+
+
+
+ev_tstamp
+ev_loop_next_waittime (EV_P)
+{
+  ev_tstamp waittime  = 0.;
+  //ev_tstamp sleeptime = 0.;
+
+  if (expect_true (!(idleall || !activecnt)))
+  {
+    /* remember old timestamp for io_blocktime calculation */
+    ev_tstamp prev_mn_now = mn_now;
+
+    /* update time to cancel out callback processing overhead */
+    time_update (EV_A_ 1e100);
+
+    waittime = MAX_BLOCKTIME;
+
+    if (timercnt)
+    {
+      ev_tstamp to = ANHE_at (timers [HEAP0]) - mn_now + backend_fudge;
+      if (waittime > to) waittime = to;
+    }
+
+#if EV_PERIODIC_ENABLE
+    if (periodiccnt)
+    {
+      ev_tstamp to = ANHE_at (periodics [HEAP0]) - ev_rt_now + backend_fudge;
+      if (waittime > to) waittime = to;
+    }
+#endif
+
+    /* don't let timeouts decrease the waittime below timeout_blocktime */
+    if (expect_false (waittime < timeout_blocktime))
+      waittime = timeout_blocktime;
+
+    /* extra check because io_blocktime is commonly 0 */
+    /*if (expect_false (io_blocktime))
+    {
+      sleeptime = io_blocktime - (mn_now - prev_mn_now);
+
+      if (sleeptime > waittime - backend_fudge)
+        sleeptime = waittime - backend_fudge;
+
+      if (expect_true (sleeptime > 0.))
+      {
+        ev_sleep (sleeptime);
+        waittime -= sleeptime;
+      }
+    }*/
+  }
+  return waittime;
+}
+
+
 void
 ev_run (EV_P_ int flags)
 {
@@ -2461,6 +2529,12 @@ ev_unref (EV_P)
   --activecnt;
 }
 
+int
+ev_refcount (EV_P)
+{
+  return activecnt;
+}
+
 void
 ev_now_update (EV_P)
 {
diff --git a/deps/libev/ev.h b/deps/libev/ev.h
index 96e7358..c8acf07 100644
--- a/deps/libev/ev.h
+++ b/deps/libev/ev.h
@@ -567,6 +567,7 @@ void ev_default_destroy (void); /* destroy the default loop */
 void ev_default_fork (void);
 
 unsigned int ev_backend (EV_P); /* backend in use by loop */
+int ev_backend_fd (EV_P); /* backend file descriptor */
 
 void ev_now_update (EV_P); /* update event loop time */
 
@@ -603,6 +604,7 @@ void ev_break (EV_P_ int how); /* set to 1 to break out of event loop, set to 2
  */
 void ev_ref   (EV_P);
 void ev_unref (EV_P);
+int ev_refcount (EV_P); /* total number of active events ("refcount") */
 
 /*
  * convenience function, wait for a single event, without registering an event watcher
@@ -614,6 +616,9 @@ void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revent
 unsigned int ev_iteration (EV_P); /* number of loop iterations */
 unsigned int ev_depth     (EV_P); /* #ev_loop enters - #ev_loop leaves */
 void         ev_verify    (EV_P); /* abort if loop data corrupted */
+int ev_loop_fdchangecount (EV_P); /* number of pending I/O changes */
+ev_tstamp ev_loop_next_waittime (EV_P); /* calculate time to wait until next
+                                           loop iteration */
 
 void ev_set_io_collect_interval (EV_P_ ev_tstamp interval); /* sleep at least this time, default 0 */
 void ev_set_timeout_collect_interval (EV_P_ ev_tstamp interval); /* sleep at least this time, default 0 */
