Disable timerfd/signalfd on openvz, it seems broken

(imported from libratbox r27395 by nenolod)
This commit is contained in:
Aaron Sethman 2012-05-18 21:15:16 -05:00 committed by William Pitcock
parent 1e23af243b
commit 21acd0961c

View file

@ -254,6 +254,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;
@ -262,6 +263,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)
{ {