ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.pod
(Generate patch)

Comparing libev/ev.pod (file contents):
Revision 1.56 by root, Wed Nov 28 11:15:55 2007 UTC vs.
Revision 1.57 by root, Wed Nov 28 11:27:29 2007 UTC

1222not exist" is signified by the C<st_nlink> field being zero (which is 1222not exist" is signified by the C<st_nlink> field being zero (which is
1223otherwise always forced to be at least one) and all the other fields of 1223otherwise always forced to be at least one) and all the other fields of
1224the stat buffer having unspecified contents. 1224the stat buffer having unspecified contents.
1225 1225
1226Since there is no standard to do this, the portable implementation simply 1226Since there is no standard to do this, the portable implementation simply
1227calls C<stat (2)> regulalry on the path to see if it changed somehow. You 1227calls C<stat (2)> regularly on the path to see if it changed somehow. You
1228can specify a recommended polling interval for this case. If you specify 1228can specify a recommended polling interval for this case. If you specify
1229a polling interval of C<0> (highly recommended!) then a I<suitable, 1229a polling interval of C<0> (highly recommended!) then a I<suitable,
1230unspecified default> value will be used (which you can expect to be around 1230unspecified default> value will be used (which you can expect to be around
1231five seconds, although this might change dynamically). Libev will also 1231five seconds, although this might change dynamically). Libev will also
1232impose a minimum interval which is currently around C<0.1>, but thats 1232impose a minimum interval which is currently around C<0.1>, but thats
1234 1234
1235This watcher type is not meant for massive numbers of stat watchers, 1235This watcher type is not meant for massive numbers of stat watchers,
1236as even with OS-supported change notifications, this can be 1236as even with OS-supported change notifications, this can be
1237resource-intensive. 1237resource-intensive.
1238 1238
1239At the time of this writing, no specific OS backends are implemented, but 1239At the time of this writing, only the Linux inotify interface is
1240if demand increases, at least a kqueue and inotify backend will be added. 1240implemented (implementing kqueue support is left as an exercise for the
1241reader). Inotify will be used to give hints only and should not change the
1242semantics of C<ev_stat> watchers, which means that libev sometimes needs
1243to fall back to regular polling again even with inotify, but changes are
1244usually detected immediately, and if the file exists there will be no
1245polling.
1241 1246
1242=over 4 1247=over 4
1243 1248
1244=item ev_stat_init (ev_stat *, callback, const char *path, ev_tstamp interval) 1249=item ev_stat_init (ev_stat *, callback, const char *path, ev_tstamp interval)
1245 1250

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines