Go to the documentation of this file.
32 #include <sys/inotify.h>
33 #include <sys/types.h>
47 #define CAST(p) ((struct watcher_root*)(p))
52 if (
a->wd <
b->wd)
return -1;
53 if (
a->wd >
b->wd)
return 1;
63 unsigned int revents);
71 if (
loop->inotify_fd != -1)
74 fd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
78 loop->inotify_fd = fd;
97 if (old_watchers != NULL) {
101 loop->inotify_watchers = old_watchers;
110 CAST(&old_watchers), tmp_watcher_list_iter) {
121 assert(tmp_path != NULL);
159 if ((!w->iterating) &&
QUEUE_EMPTY(&w->watchers)) {
162 inotify_rm_watch(
loop->inotify_fd, w->wd);
169 unsigned int events) {
170 const struct inotify_event* e;
184 while (
size == -1 && errno == EINTR);
187 assert(errno == EAGAIN || errno == EWOULDBLOCK);
195 e = (
const struct inotify_event*)
p;
198 if (e->mask & (IN_ATTRIB|IN_MODIFY))
200 if (e->mask & ~(IN_ATTRIB|IN_MODIFY))
211 path = e->len ? (
const char*) (e + 1) : uv__basename_r(w->path);
233 h->cb(h,
path, events, 0);
252 unsigned int flags) {
275 wd = inotify_add_watch(
handle->loop->inotify_fd,
path, events);
#define RB_REMOVE(name, x, y)
void * uv__malloc(size_t size)
int uv_fs_event_start(uv_fs_event_t *handle, uv_fs_event_cb cb, const char *path, unsigned int flags)
void uv__io_init(uv__io_t *w, uv__io_cb cb, int fd)
#define QUEUE_DATA(ptr, type, field)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
int uv__inotify_fork(uv_loop_t *loop, void *old_watchers)
char * uv__strdup(const char *s)
void uv__io_start(uv_loop_t *loop, uv__io_t *w, unsigned int events)
#define RB_FOREACH_SAFE(x, name, head, y)
static int init_inotify(uv_loop_t *loop)
#define RB_INSERT(name, x, y)
void uv__fs_event_close(uv_fs_event_t *handle)
#define uv__handle_init(loop_, h, type_)
int read(izstream &zs, T *x, Items items)
static int compare_watchers(const struct watcher_list *a, const struct watcher_list *b)
static struct watcher_list * find_watcher(uv_loop_t *loop, int wd)
struct watcher_list * rbh_root
void(* uv_fs_event_cb)(uv_fs_event_t *handle, const char *filename, int events, int status)
#define RB_FIND(name, x, y)
#define uv__handle_start(h)
static void maybe_free_watcher_list(struct watcher_list *w, uv_loop_t *loop)
int uv_fs_event_stop(uv_fs_event_t *handle)
static void uv__inotify_read(uv_loop_t *loop, uv__io_t *w, unsigned int revents)
#define uv__handle_stop(h)
RB_GENERATE_STATIC(uv__signal_tree_s, uv_signal_s, tree_entry, uv__signal_compare)
#define QUEUE_INSERT_TAIL(h, q)
OPENSSL_EXPORT pem_password_cb * cb
int uv_fs_event_init(uv_loop_t *loop, uv_fs_event_t *handle)
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:00:28