Bug 180012

Summary: inotify events should be selec()-able
Product: [Fedora] Fedora Reporter: John Ellson <john.ellson>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: rml, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-05 16:41:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
small test program for inotify + select() none

Description John Ellson 2006-02-04 17:31:38 UTC
Description of problem:
/usr/share/doc/kernel-doc-2.6.15/Documentation/filesystems/inotify.txt states:
"Each inotify instance fd is also select()- and poll()-able."

I may be missing some setup, but I can't get select to wakeup from an inotify
event.   inotify (with headers from latest glibc) seems to work ok otherwise.

Version-Release number of selected component (if applicable):
kernel-2.6.15-1.1907_FC5
glibc-2.3.90-35

How reproducible:


Steps to Reproduce:
1.See test prog.
2.
3.
  
Actual results:
select always timesout, even if there were inotify events.

Expected results:
select should wake up for inotify events.

Additional info:

Comment 1 John Ellson 2006-02-04 17:31:38 UTC
Created attachment 124174 [details]
small test program for inotify + select()

Comment 2 Robert Love 2006-02-05 16:29:22 UTC
First pass: The first parameter to select() is the highest numbered file
descriptor, plus one, not the number of file descriptors watched.

Thus, in your test program, you want to do

s/select\(1/select\(fd+1/g

Comment 3 John Ellson 2006-02-05 16:39:37 UTC
Thank you.  That fixed it.