Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Limit on kevent entries?



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:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.