• Home
  • Raw
  • Download

Lines Matching refs:iol

24     IoLooper*  iol = qemu_malloc(sizeof(*iol));  in iolooper_new()  local
25 iolooper_reset(iol); in iolooper_new()
26 return iol; in iolooper_new()
30 iolooper_free( IoLooper* iol ) in iolooper_free() argument
32 qemu_free(iol); in iolooper_free()
36 iolooper_reset( IoLooper* iol ) in iolooper_reset() argument
38 FD_ZERO(iol->reads); in iolooper_reset()
39 FD_ZERO(iol->writes); in iolooper_reset()
40 iol->max_fd = -1; in iolooper_reset()
41 iol->max_fd_valid = 1; in iolooper_reset()
45 iolooper_add_fd( IoLooper* iol, int fd ) in iolooper_add_fd() argument
47 if (iol->max_fd_valid && fd > iol->max_fd) { in iolooper_add_fd()
48 iol->max_fd = fd; in iolooper_add_fd()
53 iolooper_del_fd( IoLooper* iol, int fd ) in iolooper_del_fd() argument
55 if (iol->max_fd_valid && fd == iol->max_fd) in iolooper_del_fd()
56 iol->max_fd_valid = 0; in iolooper_del_fd()
60 iolooper_fd_count( IoLooper* iol ) in iolooper_fd_count() argument
62 int max_fd = iol->max_fd; in iolooper_fd_count()
65 if (iol->max_fd_valid) in iolooper_fd_count()
70 if (!FD_ISSET(fd, iol->reads) && !FD_ISSET(fd, iol->writes)) in iolooper_fd_count()
75 iol->max_fd = max_fd; in iolooper_fd_count()
76 iol->max_fd_valid = 1; in iolooper_fd_count()
82 iolooper_add_read( IoLooper* iol, int fd ) in iolooper_add_read() argument
85 iolooper_add_fd(iol, fd); in iolooper_add_read()
86 FD_SET(fd, iol->reads); in iolooper_add_read()
91 iolooper_add_write( IoLooper* iol, int fd ) in iolooper_add_write() argument
94 iolooper_add_fd(iol, fd); in iolooper_add_write()
95 FD_SET(fd, iol->writes); in iolooper_add_write()
100 iolooper_del_read( IoLooper* iol, int fd ) in iolooper_del_read() argument
103 iolooper_del_fd(iol, fd); in iolooper_del_read()
104 FD_CLR(fd, iol->reads); in iolooper_del_read()
109 iolooper_del_write( IoLooper* iol, int fd ) in iolooper_del_write() argument
112 iolooper_del_fd(iol, fd); in iolooper_del_write()
113 FD_CLR(fd, iol->reads); in iolooper_del_write()
118 iolooper_poll( IoLooper* iol ) in iolooper_poll() argument
120 int count = iolooper_fd_count(iol); in iolooper_poll()
134 iol->reads_result[0] = iol->reads[0]; in iolooper_poll()
135 iol->writes_result[0] = iol->writes[0]; in iolooper_poll()
137 ret = select( count, iol->reads_result, iol->writes_result, &errs, &tv); in iolooper_poll()
144 iolooper_wait( IoLooper* iol, int64_t duration ) in iolooper_wait() argument
146 int count = iolooper_fd_count(iol); in iolooper_wait()
156 iol->reads_result[0] = iol->reads[0]; in iolooper_wait()
157 iol->writes_result[0] = iol->writes[0]; in iolooper_wait()
159 ret = select( count, iol->reads_result, iol->writes_result, &errs, NULL); in iolooper_wait()
167 iolooper_is_read( IoLooper* iol, int fd ) in iolooper_is_read() argument
169 return FD_ISSET(fd, iol->reads_result); in iolooper_is_read()
173 iolooper_is_write( IoLooper* iol, int fd ) in iolooper_is_write() argument
175 return FD_ISSET(fd, iol->writes_result); in iolooper_is_write()