On 2014-10-03 22:13, Roy Marples wrote:
On 2014-10-03 21:08, Simon Kelley wrote:
This looks fine, but I have a vague worry about breaking the build on
old C libraries that don't define the st_mtim field. Does anyone know
when this entered the standard?

It's not in *any* accepted standard other than glibc.
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/stat.h.html

Please #define accordingly, for OS's other than Linux w glibc.

Or tackle the problem a different way:

Store st_mtime, add a 2 second timeout to the event loop to look again at the file If the st_mtime is the same as stored read it, otherwise timeout for another 2 seconds.
Once read, poll at normal intervals (whatever they are).

Or go the proper way and use inotify for linux and kevent for BSD and get file change notifications rather than the inefficient polling.

Roy

_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss

Reply via email to