Merge pull request #5 from Joah/master

Port OpenVZ/epoll Fix From charybdis
This commit is contained in:
Jeff Horelick 2012-11-20 15:32:38 -08:00
commit 5585d1fa16
1 changed files with 8 additions and 0 deletions

View File

@ -253,6 +253,7 @@ rb_epoll_supports_event(void)
/* try to detect at runtime if everything we need actually works */ /* try to detect at runtime if everything we need actually works */
timer_t timer; timer_t timer;
struct sigevent ev; struct sigevent ev;
struct stat st;
int fd; int fd;
sigset_t set; sigset_t set;
@ -261,6 +262,13 @@ rb_epoll_supports_event(void)
if(can_do_event == -1) if(can_do_event == -1)
return 0; return 0;
/* Check for openvz..it has a broken timerfd.. */
if(stat("/proc/user_beancounters", &st) == 0)
{
can_do_event = -1;
return 0;
}
#ifdef USE_TIMERFD_CREATE #ifdef USE_TIMERFD_CREATE
if((fd = timerfd_create(CLOCK_REALTIME, 0)) >= 0) if((fd = timerfd_create(CLOCK_REALTIME, 0)) >= 0)
{ {