38 loop->poll_fds_used = 0;
39 loop->poll_fds_size = 0;
40 loop->poll_fds_iterating = 0;
60 if (
loop->poll_fds_used <
loop->poll_fds_size)
63 n =
loop->poll_fds_size ?
loop->poll_fds_size * 2 : 64;
69 for (
i =
loop->poll_fds_size;
i <
n;
i++) {
70 loop->poll_fds[
i].fd = -1;
71 loop->poll_fds[
i].events = 0;
72 loop->poll_fds[
i].revents = 0;
74 loop->poll_fds_size =
n;
80 pfd =
loop->poll_fds[l];
82 loop->poll_fds[
r] = pfd;
92 for (
i = 0;
i <
loop->poll_fds_used; ++
i) {
93 if (
loop->poll_fds[
i].fd ==
w->fd) {
94 loop->poll_fds[
i].events =
w->pevents;
101 pe = &
loop->poll_fds[
loop->poll_fds_used++];
103 pe->events =
w->pevents;
110 for (
i = 0;
i <
loop->poll_fds_used;) {
111 if (
loop->poll_fds[
i].fd ==
fd) {
113 --
loop->poll_fds_used;
115 loop->poll_fds[
loop->poll_fds_used].fd = -1;
116 loop->poll_fds[
loop->poll_fds_used].events = 0;
117 loop->poll_fds[
loop->poll_fds_used].revents = 0;
142 unsigned int nevents;
150 if (
loop->nfds == 0) {
168 w->events =
w->pevents;
176 sigaddset(pset, SIGPROF);
180 time_base =
loop->time;
202 if (pthread_sigmask(SIG_BLOCK, pset,
NULL))
206 if (pthread_sigmask(SIG_UNBLOCK, pset,
NULL))
216 if (reset_timeout != 0) {
233 if (reset_timeout != 0) {
251 loop->poll_fds_iterating = 1;
258 for (
i = 0;
i <
loop->poll_fds_used;
i++) {
259 pe =
loop->poll_fds +
i;
267 assert((
unsigned) fd < loop->nwatchers);
280 pe->revents &=
w->pevents | POLLERR | POLLHUP;
282 if (pe->revents != 0) {
284 if (
w == &
loop->signal_io_watcher) {
288 w->cb(
loop,
w, pe->revents);
295 if (reset_timeout != 0) {
300 if (have_signals != 0) {
302 loop->signal_io_watcher.cb(
loop, &
loop->signal_io_watcher, POLLIN);
305 loop->poll_fds_iterating = 0;
310 if (have_signals != 0)
325 time_diff =
loop->time - time_base;
341 if (
loop->poll_fds_iterating) {
343 for (
i = 0;
i <
loop->poll_fds_used;
i++)
344 if (
loop->poll_fds[
i].fd ==
fd) {
345 loop->poll_fds[
i].fd = -1;
346 loop->poll_fds[
i].events = 0;
347 loop->poll_fds[
i].revents = 0;
361 p[0].events = POLLIN;
365 while (rv == -1 && (errno ==
EINTR || errno ==
EAGAIN));
370 if (
p[0].revents & POLLNVAL)
static const char struct stat static buf struct stat static buf static vhangup int struct rusage static rusage struct sysinfo static info unsigned static __unused struct utsname static buf const char static size const char static name static pid unsigned static persona static fsgid const void static flags const struct iovec static count static fd const void static len static munlockall struct sched_param static p static sched_yield static policy const struct timespec struct timespec static rem uid_t uid_t uid_t static suid poll
static const char struct stat static buf struct stat static buf static vhangup int struct rusage static rusage struct sysinfo static info unsigned static __unused struct utsname static buf const char static size const char static name static pid unsigned static persona static fsgid const void static flags const struct iovec static count static fd const void static len static munlockall struct sched_param static p static sched_yield static policy const struct timespec struct timespec static rem uid_t uid_t uid_t static suid struct pollfd unsigned nfds
assert(limit<=UINT32_MAX/2)
static void uv__pollfds_add(uv_loop_t *loop, uv__io_t *w)
static void uv__pollfds_maybe_resize(uv_loop_t *loop)
void uv__platform_invalidate_fd(uv_loop_t *loop, int fd)
void uv__io_poll(uv_loop_t *loop, int timeout)
static void uv__pollfds_swap(uv_loop_t *loop, size_t l, size_t r)
int uv__io_check_fd(uv_loop_t *loop, int fd)
int uv__platform_loop_init(uv_loop_t *loop)
int uv__io_fork(uv_loop_t *loop)
void uv__platform_loop_delete(uv_loop_t *loop)
static void uv__pollfds_del(uv_loop_t *loop, int fd)
#define QUEUE_DATA(ptr, type, field)
static struct sockaddr static addrlen static backlog const void static flags void flags
#define SAVE_ERRNO(block)
void * uv__reallocf(void *ptr, size_t size)
void uv__metrics_update_idle_time(uv_loop_t *loop)
void uv__metrics_set_provider_entry_time(uv_loop_t *loop)
#define uv__get_internal_fields(loop)
static const z80_opcode fd[]