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

Comparing libev/ev.pod (file contents):
Revision 1.107 by root, Mon Dec 24 04:34:00 2007 UTC vs.
Revision 1.108 by root, Mon Dec 24 10:39:21 2007 UTC

1496semantics of C<ev_stat> watchers, which means that libev sometimes needs 1496semantics of C<ev_stat> watchers, which means that libev sometimes needs
1497to fall back to regular polling again even with inotify, but changes are 1497to fall back to regular polling again even with inotify, but changes are
1498usually detected immediately, and if the file exists there will be no 1498usually detected immediately, and if the file exists there will be no
1499polling. 1499polling.
1500 1500
1501=head3 Inotify
1502
1503When C<inotify (7)> support has been compiled into libev (generally only
1504available on Linux) and present at runtime, it will be used to speed up
1505change detection where possible. The inotify descriptor will be created lazily
1506when the first C<ev_stat> watcher is being started.
1507
1508Inotify presense does not change the semantics of C<ev_stat> watchers
1509except that changes might be detected earlier, and in some cases, to avoid
1510making regular C<stat> calls. Even in the presense of inotify support
1511there are many cases where libev has to resort to regular C<stat> polling.
1512
1513(There is no support for kqueue, as apparently it cannot be used to
1514implement this functionality, due to the requirement of having a file
1515descriptor open on the object at all times).
1516
1501=head3 The special problem of stat time resolution 1517=head3 The special problem of stat time resolution
1502 1518
1503The C<stat ()> syscall only supports full-second resolution portably, and 1519The C<stat ()> syscall only supports full-second resolution portably, and
1504even on systems where the resolution is higher, many filesystems still 1520even on systems where the resolution is higher, many filesystems still
1505only support whole seconds. 1521only support whole seconds.
1559=item const char *path [read-only] 1575=item const char *path [read-only]
1560 1576
1561The filesystem path that is being watched. 1577The filesystem path that is being watched.
1562 1578
1563=back 1579=back
1580
1581=head3 Examples
1564 1582
1565Example: Watch C</etc/passwd> for attribute changes. 1583Example: Watch C</etc/passwd> for attribute changes.
1566 1584
1567 static void 1585 static void
1568 passwd_cb (struct ev_loop *loop, ev_stat *w, int revents) 1586 passwd_cb (struct ev_loop *loop, ev_stat *w, int revents)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines