Limit on kevent entries?
Limit on kevent entries?
- Subject: Limit on kevent entries?
- From: maurits <email@hidden>
- Date: Thu, 12 Oct 2006 06:46:14 +0200
Dear darwin-dev list,
is there a limit on the number of files one can simultaneously
monitor with the kevent mechanism? Basically, I want to monitor if a
file has changed, for potentially hundreds or even thousands of
files. The code I have (based on Michael McCracken's stakeout) seems
to be able to monitor no more than 251 files (weird number, I don't
have a clue why). Is there a limitation? Is it even sensible to
monitor so many files simultaneously using the kevent mechanism?
For your reference, my code looks somewhat like this:
int kq = kqueue();
for (every file...)
{
EV_SET(ev, fd, EVFILT_VNODE,
EV_ADD | EV_ENABLE | EV_CLEAR,
NOTE_RENAME | NOTE_WRITE | NOTE_DELETE | NOTE_EXTEND, 0,
(void *) path);
err = kevent(kq, &ev, 1, NULL, 0, &nullts);
}
EV_SET(&ev, SIGIO, EVFILT_SIGNAL, EV_ADD | EV_ENABLE, 0, 0, 0);
err = kevent(kq, &ev, 1, NULL, 0, &nullts);
and then I poll using
n = kevent(kq, NULL, 0, &ev, 1, NULL);
Thanks,
maurits
--
http://www.plasticsfuture.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden