On 6 Nov 2014, at 16:23, Quinn The Eskimo! <eskimo1@apple.com> wrote:
On 6 Nov 2014, at 04:20, Gerriet M. Denkmann <gerriet@mdenkmann.de> wrote:
Following your advice I found a way to change a file without DISPATCH_SOURCE_TYPE_VNODE noticing it (same way save_drift_file() in ntp_util.c does it):
As to whether it /should/ be this way, I'm not really qualified to say--given the way memory mapping works, it might be quite hard to change this behaviour--but, regardless, if the current behaviour is causing you problems, you should file a bug about it.
Not really a problem. This was just a sidetrack.
Realistically though, it might be better asking for a dedicated notification for the drift change rather than trying to do this through the file system.
What I am currently doing is: polling by sending a packet to ntpd (same as ntpq does), asking for the current frequency. This is probably efficient enough. Getting a notification whenever the frequency changes would be nice, but how? NSDistributedNotificationCenter? "Posting a distributed notification is an expensive operation." Registering a block with ntpd to be executed in this case? (Looks dangerous, as ntpd runs as root). Some other method? Anyway, thanks a lot for your help! - I understand DISPATCH_SOURCE_TYPE_VNODE much better now. Kind regards, Gerriet. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.... This email sent to site_archiver@lists.apple.com