Lines Matching refs:fd
104 int (*callback)(void *ctx, int fd);
107 int fd; member
130 monitor_fd(int fd, int (*callback)(void *, int), void *ctx, int priority) in monitor_fd() argument
132 if (fd < 0 || fd >= FD_SETSIZE) { in monitor_fd()
137 FD_SET(fd, &preset_mask); in monitor_fd()
138 if (fd > nfds) in monitor_fd()
139 nfds = fd; in monitor_fd()
145 fd_monitors[fd].callback = callback; in monitor_fd()
146 fd_monitors[fd].ctx = ctx; in monitor_fd()
147 fd_monitors[fd].prio = priority; in monitor_fd()
148 fd_monitors[fd].fd = fd; in monitor_fd()
150 &fd_monitors[fd], chain); in monitor_fd()
154 unmonitor_fd(int fd) in unmonitor_fd() argument
156 if (fd < 0 || fd >= FD_SETSIZE) { in unmonitor_fd()
161 if (fd_monitors[fd].callback == NULL) in unmonitor_fd()
164 FD_CLR(fd, &preset_mask); in unmonitor_fd()
165 FD_CLR(fd, &active_mask); in unmonitor_fd()
166 fd_monitors[fd].callback = NULL; in unmonitor_fd()
167 fd_monitors[fd].ctx = NULL; in unmonitor_fd()
168 TAILQ_REMOVE(&fd_monitor_tree[fd_monitors[fd].prio], in unmonitor_fd()
169 &fd_monitors[fd], chain); in unmonitor_fd()
320 if (!FD_ISSET(fdm->fd, &active_mask)) in session()
323 FD_CLR(fdm->fd, &active_mask); in session()
325 fdm->callback(fdm->ctx, fdm->fd); in session()