+
+extern int DebugEventLoopBacktrace;
+void EV_backtrace(AsyncIO *IO)
+{
+#ifdef HAVE_BACKTRACE
+ void *stack_frames[50];
+ size_t size, i;
+ char **strings;
+
+ if ((IO == NULL) || (DebugEventLoopBacktrace == 0))
+ return;
+ size = backtrace(stack_frames, sizeof(stack_frames) / sizeof(void*));
+ strings = backtrace_symbols(stack_frames, size);
+ for (i = 0; i < size; i++) {
+ if (strings != NULL) {
+ EV_syslog(LOG_ALERT, " BT %s\n", strings[i]);
+ }
+ else {
+ EV_syslog(LOG_ALERT, " BT %p\n", stack_frames[i]);
+ }
+ }
+ free(strings);
+#endif
+}
+
+
+ev_tstamp ctdl_ev_now (void)
+{
+ return ev_now(event_base);
+}