kqueue alternative?
Terry Lambert
tlambert2 at mindspring.com
Mon Jun 16 04:35:23 PDT 2003
Tony Finch wrote:
> Joshua Oreman <oremanj at webserver.get-linux.org> wrote:
> >On Sun, 15 Jun 2003, Matthew Hagerty wrote:
> >>
> >> I'm writing a little application that needs to watch a file that another
> >> process is writing to, think 'tail -F'.
> >
> >I would say, use select(2).
> >Is there a reason this wouldn't work?
>
> Select doesn't work with files.
The current "tail -f" uses kqueue. The prior "tail -f" used
to open the file, and fstat() it in a 1 second sleep() loop,
looking for the file to get larger.
So your "alternative to kqueue" is to sleep loop and fstat.
-- Terry
More information about the freebsd-hackers
mailing list