php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59728 cannot detect event on regular file (epoll_ctl syscall just fails with EPERM)
Submitted: 2011-04-20 19:09 UTC Modified: 2013-01-31 19:18 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: david dot barre at gmail dot com Assigned: tony2001 (profile)
Status: Not a bug Package: libevent (PECL)
PHP Version: 5.3.3 OS: linux 2.6.32 debian 6.0
Private report: No CVE-ID: None
 [2011-04-20 19:09 UTC] david dot barre at gmail dot com
Description:
------------
I use libevent 1.4.2 and I have the same problem describe in this page : 

http://abhinavsingh.com/blog/2009/11/writing-a-custom-unix-style-tail-in-php-using-libevent-api-on-mac-os-x-10-5-x-and-other-platforms/

I quote :
"I?m on Linux and this script will just exit when I run it on a regular file.
I straced it and it seems like the epoll_ctl syscall just fails with EPERM ( permission denied ) when it tries to set polling for the file descriptor"

Mac os X users don't semms to have any problem


Reproduce code:
---------------
http://abhinavsingh.com/blog/2009/11/writing-a-custom-unix-style-tail-in-php-using-libevent-api-on-mac-os-x-10-5-x-and-other-platforms/

Expected result:
----------------
script is waiting for event on regular file

Actual result:
--------------
test code quit immediately if i try to detect event on a regular file


But it's working on STDIN or "http://ww...."

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-08-23 06:19 UTC] marc-bennewith at arcor dot de
As described here:
http://stackoverflow.com/questions/5456967/problem-handling-file-i-o-with-libevent2
Libevent uses Epoll and Epoll doesn't support regular Unix files.

To solve the issue libevent should avoid "epoll" if a regular file descriptor was given or wrap config functions to make it possible on PHP level.
 [2013-01-25 08:53 UTC] tony2001@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: tony2001
 [2013-01-31 19:18 UTC] tony2001@php.net
Not PHP problem, but some original library issue instead.
 [2013-01-31 19:18 UTC] tony2001@php.net
-Status: Assigned +Status: Not a bug
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Apr 21 06:01:26 2019 UTC