… | |
… | |
2606 | |
2606 | |
2607 | =head2 C<ev_stat> - did the file attributes just change? |
2607 | =head2 C<ev_stat> - did the file attributes just change? |
2608 | |
2608 | |
2609 | This watches a file system path for attribute changes. That is, it calls |
2609 | This watches a file system path for attribute changes. That is, it calls |
2610 | C<stat> on that path in regular intervals (or when the OS says it changed) |
2610 | C<stat> on that path in regular intervals (or when the OS says it changed) |
2611 | and sees if it changed compared to the last time, invoking the callback if |
2611 | and sees if it changed compared to the last time, invoking the callback |
2612 | it did. |
2612 | if it did. Starting the watcher C<stat>'s the file, so only changes that |
|
|
2613 | happen after the watcher has been started will be reported. |
2613 | |
2614 | |
2614 | The path does not need to exist: changing from "path exists" to "path does |
2615 | The path does not need to exist: changing from "path exists" to "path does |
2615 | not exist" is a status change like any other. The condition "path does not |
2616 | not exist" is a status change like any other. The condition "path does not |
2616 | exist" (or more correctly "path cannot be stat'ed") is signified by the |
2617 | exist" (or more correctly "path cannot be stat'ed") is signified by the |
2617 | C<st_nlink> field being zero (which is otherwise always forced to be at |
2618 | C<st_nlink> field being zero (which is otherwise always forced to be at |
… | |
… | |
3177 | |
3178 | |
3178 | =over 4 |
3179 | =over 4 |
3179 | |
3180 | |
3180 | =item ev_embed_init (ev_embed *, callback, struct ev_loop *embedded_loop) |
3181 | =item ev_embed_init (ev_embed *, callback, struct ev_loop *embedded_loop) |
3181 | |
3182 | |
3182 | =item ev_embed_set (ev_embed *, callback, struct ev_loop *embedded_loop) |
3183 | =item ev_embed_set (ev_embed *, struct ev_loop *embedded_loop) |
3183 | |
3184 | |
3184 | Configures the watcher to embed the given loop, which must be |
3185 | Configures the watcher to embed the given loop, which must be |
3185 | embeddable. If the callback is C<0>, then C<ev_embed_sweep> will be |
3186 | embeddable. If the callback is C<0>, then C<ev_embed_sweep> will be |
3186 | invoked automatically, otherwise it is the responsibility of the callback |
3187 | invoked automatically, otherwise it is the responsibility of the callback |
3187 | to invoke it (it will continue to be called until the sweep has been done, |
3188 | to invoke it (it will continue to be called until the sweep has been done, |
… | |
… | |
4617 | different cpus (or different cpu cores). This reduces dependencies |
4618 | different cpus (or different cpu cores). This reduces dependencies |
4618 | and makes libev faster. |
4619 | and makes libev faster. |
4619 | |
4620 | |
4620 | =item EV_NO_THREADS |
4621 | =item EV_NO_THREADS |
4621 | |
4622 | |
4622 | If defined to be C<1>, libev will assume that it will never be called |
4623 | If defined to be C<1>, libev will assume that it will never be called from |
4623 | from different threads, which is a stronger assumption than C<EV_NO_SMP>, |
4624 | different threads (that includes signal handlers), which is a stronger |
4624 | above. This reduces dependencies and makes libev faster. |
4625 | assumption than C<EV_NO_SMP>, above. This reduces dependencies and makes |
|
|
4626 | libev faster. |
4625 | |
4627 | |
4626 | =item EV_ATOMIC_T |
4628 | =item EV_ATOMIC_T |
4627 | |
4629 | |
4628 | Libev requires an integer type (suitable for storing C<0> or C<1>) whose |
4630 | Libev requires an integer type (suitable for storing C<0> or C<1>) whose |
4629 | access is atomic with respect to other threads or signal contexts. No |
4631 | access is atomic with respect to other threads or signal contexts. No |