Commit c40a5796 authored by Jason Madden's avatar Jason Madden

Restore sigfd for corecext using the same technique as the other LIBEV_EMBED properties.

parent 87a9efed
......@@ -272,9 +272,6 @@ libev
attributes are not portable and not implemented by libuv or the
CFFI backend. See :issue:`1076`.
- The ``sigfd`` property that was only conditionally available on
certain platforms and when libev was embedded, and only in the C
implementation, not the CFFI implementation, has been removed.
1.2.2 (2017-06-05)
==================
......
......@@ -565,6 +565,16 @@ cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]:
_check_loop(self)
return libev.gevent_ev_loop_origflags(self._ptr)
@property
def sigfd(self):
_check_loop(self)
fd = libev.gevent_ev_loop_sigfd(self._ptr)
if fd >= 0:
return fd
# Explicitly not EV_USE_SIGNALFD
raise AttributeError("sigfd")
cdef public class callback [object PyGeventCallbackObject, type PyGeventCallback_Type]:
cdef public object callback
......
......@@ -6,6 +6,11 @@
#define gevent_ev_loop_sig_pending(loop) ((loop))->sig_pending
#define gevent_ev_loop_backend_fd(loop) ((loop))->backend_fd
#define gevent_ev_loop_activecnt(loop) ((loop))->activecnt
#if EV_USE_SIGNALFD
#define gevent_ev_loop_sigfd(loop) ((loop))->sigfd
#else
#define gevent_ev_loop_sigfd(loop) -1
#endif /* !EV_USE_SIGNALFD */
#else /* !LIBEV_EMBED */
#include "ev.h"
......@@ -13,6 +18,7 @@
#define gevent_ev_loop_sig_pending(loop) -1
#define gevent_ev_loop_backend_fd(loop) -1
#define gevent_ev_loop_activecnt(loop) -1
#define gevent_ev_loop_sigfd(loop) -1
#define LIBEV_EMBED 0
#define EV_USE_FLOOR -1
......
......@@ -228,3 +228,4 @@ cdef extern from "libev.h" nogil:
int gevent_ev_loop_sig_pending(ev_loop*);
int gevent_ev_loop_backend_fd(ev_loop*);
int gevent_ev_loop_activecnt(ev_loop*);
int gevent_ev_loop_sigfd(ev_loop*);
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