+/*
+ This returns the ring's pollable file descriptor. If one does not exist, then
+ it is created.
+*/
+static int uta_ring_getpfd( void* vr ) {
+ ring_t* r;
+
+ if( !RING_FAST ) { // compiler should drop the conditional when always false
+ if( (r = (ring_t*) vr) == NULL ) {
+ return 0;
+ }
+ } else {
+ r = (ring_t*) vr;
+ }
+
+ if( r->pfd < 0 ) {
+ r->pfd = eventfd( 0, EFD_SEMAPHORE | EFD_NONBLOCK );
+ }
+
+ return r->pfd;
+}
+