Index: head/lib/libc/sys/kqueue.2 =================================================================== --- head/lib/libc/sys/kqueue.2 +++ head/lib/libc/sys/kqueue.2 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 29, 2015 +.Dd August 4, 2015 .Dt KQUEUE 2 .Os .Sh NAME @@ -288,6 +288,14 @@ .Va data contains the offset from current position to end of file, and may be negative. +.Pp +This behavior is different from +.Xr poll 2 , +where read events are triggered for regular files unconditionally. +This event can be triggered unconditionally by setting the +.Dv NOTE_FILE_POLL +flag in +.Va fflags . .It "Fifos, Pipes" Returns when the there is data to read; .Va data Index: head/sys/kern/vfs_subr.c =================================================================== --- head/sys/kern/vfs_subr.c +++ head/sys/kern/vfs_subr.c @@ -4622,7 +4622,7 @@ VI_LOCK(vp); kn->kn_data = va.va_size - kn->kn_fp->f_offset; - res = (kn->kn_data != 0); + res = (kn->kn_sfflags & NOTE_FILE_POLL) != 0 || kn->kn_data != 0; VI_UNLOCK(vp); return (res); } Index: head/sys/sys/event.h =================================================================== --- head/sys/sys/event.h +++ head/sys/sys/event.h @@ -108,6 +108,7 @@ * data/hint flags for EVFILT_{READ|WRITE}, shared with userspace */ #define NOTE_LOWAT 0x0001 /* low water mark */ +#define NOTE_FILE_POLL 0x0002 /* behave like poll() */ /* * data/hint flags for EVFILT_VNODE, shared with userspace