* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#define _GNU_SOURCE
#define _LGPL_SOURCE
#include <assert.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
-#include <config.h>
#include <common/error.h>
#include <common/defaults.h>
ERR("Wrong arguments in compat_epoll_wait");
goto error;
}
- assert(events->nb_fd >= 0);
if (events->nb_fd == 0) {
errno = EINVAL;
fd = open(COMPAT_EPOLL_PROC_PATH, O_RDONLY);
if (fd < 0) {
- retval = -1;
+ /*
+ * Failing on opening [1] is not an error per see. [1] was
+ * introduced in Linux 2.6.28 but epoll is available since
+ * 2.5.44. Hence, goto end and set a default value without
+ * setting an error return value.
+ *
+ * [1] /proc/sys/fs/epoll/max_user_watches
+ */
+ retval = 0;
goto end;
}