epolltable-internal.h 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166
  1. /*
  2. * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
  3. * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. The name of the author may not be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  17. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  18. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  19. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  20. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  21. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  22. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  23. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  25. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. #ifndef EPOLLTABLE_INTERNAL_H_INCLUDED_
  28. #define EPOLLTABLE_INTERNAL_H_INCLUDED_
  29. /*
  30. Here are the values we're masking off to decide what operations to do.
  31. Note that since EV_READ|EV_WRITE.
  32. Note also that this table is a little sparse, since ADD+DEL is
  33. nonsensical ("xxx" in the list below.)
  34. Note also that we are shifting old_events by only 5 bits, since
  35. EV_READ is 2 and EV_WRITE is 4.
  36. The table was auto-generated with a python script, according to this
  37. pseudocode:[*0]
  38. If either the read or the write change is add+del:
  39. This is impossible; Set op==-1, events=0.
  40. Else, if either the read or the write change is add:
  41. Set events to 0.
  42. If the read change is add, or
  43. (the read change is not del, and ev_read is in old_events):
  44. Add EPOLLIN to events.
  45. If the write change is add, or
  46. (the write change is not del, and ev_write is in old_events):
  47. Add EPOLLOUT to events.
  48. If old_events is set:
  49. Set op to EPOLL_CTL_MOD [*1,*2]
  50. Else:
  51. Set op to EPOLL_CTL_ADD [*3]
  52. Else, if the read or the write change is del:
  53. Set op to EPOLL_CTL_DEL.
  54. If the read change is del:
  55. If the write change is del:
  56. Set events to EPOLLIN|EPOLLOUT
  57. Else if ev_write is in old_events:
  58. Set events to EPOLLOUT
  59. Set op to EPOLL_CTL_MOD
  60. Else
  61. Set events to EPOLLIN
  62. Else:
  63. {The write change is del.}
  64. If ev_read is in old_events:
  65. Set events to EPOLLIN
  66. Set op to EPOLL_CTL_MOD
  67. Else:
  68. Set the events to EPOLLOUT
  69. Else:
  70. There is no read or write change; set op to 0 and events to 0.
  71. The logic is a little tricky, since we had no events set on the fd before,
  72. we need to set op="ADD" and set events=the events we want to add. If we
  73. had any events set on the fd before, and we want any events to remain on
  74. the fd, we need to say op="MOD" and set events=the events we want to
  75. remain. But if we want to delete the last event, we say op="DEL" and
  76. set events=(any non-null pointer).
  77. [*0] Actually, the Python script has gotten a bit more complicated, to
  78. support EPOLLRDHUP.
  79. [*1] This MOD is only a guess. MOD might fail with ENOENT if the file was
  80. closed and a new file was opened with the same fd. If so, we'll retry
  81. with ADD.
  82. [*2] We can't replace this with a no-op even if old_events is the same as
  83. the new events: if the file was closed and reopened, we need to retry
  84. with an ADD. (We do a MOD in this case since "no change" is more
  85. common than "close and reopen", so we'll usually wind up doing 1
  86. syscalls instead of 2.)
  87. [*3] This ADD is only a guess. There is a fun Linux kernel issue where if
  88. you have two fds for the same file (via dup) and you ADD one to an
  89. epfd, then close it, then re-create it with the same fd (via dup2 or an
  90. unlucky dup), then try to ADD it again, you'll get an EEXIST, since the
  91. struct epitem is not actually removed from the struct eventpoll until
  92. the file itself is closed.
  93. EV_CHANGE_ADD==1
  94. EV_CHANGE_DEL==2
  95. EV_READ ==2
  96. EV_WRITE ==4
  97. EV_CLOSED ==0x80
  98. Bit 0: close change is add
  99. Bit 1: close change is del
  100. Bit 2: read change is add
  101. Bit 3: read change is del
  102. Bit 4: write change is add
  103. Bit 5: write change is del
  104. Bit 6: old events had EV_READ
  105. Bit 7: old events had EV_WRITE
  106. Bit 8: old events had EV_CLOSED
  107. */
  108. #define EPOLL_OP_TABLE_INDEX(c) \
  109. ( (((c)->close_change&(EV_CHANGE_ADD|EV_CHANGE_DEL))) | \
  110. (((c)->read_change&(EV_CHANGE_ADD|EV_CHANGE_DEL)) << 2) | \
  111. (((c)->write_change&(EV_CHANGE_ADD|EV_CHANGE_DEL)) << 4) | \
  112. (((c)->old_events&(EV_READ|EV_WRITE)) << 5) | \
  113. (((c)->old_events&(EV_CLOSED)) << 1) \
  114. )
  115. #if EV_READ != 2 || EV_WRITE != 4 || EV_CLOSED != 0x80 || EV_CHANGE_ADD != 1 || EV_CHANGE_DEL != 2
  116. #error "Libevent's internals changed! Regenerate the op_table in epolltable-internal.h"
  117. #endif
  118. static const struct operation {
  119. int events;
  120. int op;
  121. } epoll_op_table[] = {
  122. /* old= 0, write: 0, read: 0, close: 0 */
  123. { 0, 0 },
  124. /* old= 0, write: 0, read: 0, close:add */
  125. { EPOLLRDHUP, EPOLL_CTL_ADD },
  126. /* old= 0, write: 0, read: 0, close:del */
  127. { EPOLLRDHUP, EPOLL_CTL_DEL },
  128. /* old= 0, write: 0, read: 0, close:xxx */
  129. { 0, 255 },
  130. /* old= 0, write: 0, read:add, close: 0 */
  131. { EPOLLIN, EPOLL_CTL_ADD },
  132. /* old= 0, write: 0, read:add, close:add */
  133. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_ADD },
  134. /* old= 0, write: 0, read:add, close:del */
  135. { EPOLLIN, EPOLL_CTL_ADD },
  136. /* old= 0, write: 0, read:add, close:xxx */
  137. { 0, 255 },
  138. /* old= 0, write: 0, read:del, close: 0 */
  139. { EPOLLIN, EPOLL_CTL_DEL },
  140. /* old= 0, write: 0, read:del, close:add */
  141. { EPOLLRDHUP, EPOLL_CTL_ADD },
  142. /* old= 0, write: 0, read:del, close:del */
  143. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_DEL },
  144. /* old= 0, write: 0, read:del, close:xxx */
  145. { 0, 255 },
  146. /* old= 0, write: 0, read:xxx, close: 0 */
  147. { 0, 255 },
  148. /* old= 0, write: 0, read:xxx, close:add */
  149. { 0, 255 },
  150. /* old= 0, write: 0, read:xxx, close:del */
  151. { 0, 255 },
  152. /* old= 0, write: 0, read:xxx, close:xxx */
  153. { 0, 255 },
  154. /* old= 0, write:add, read: 0, close: 0 */
  155. { EPOLLOUT, EPOLL_CTL_ADD },
  156. /* old= 0, write:add, read: 0, close:add */
  157. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_ADD },
  158. /* old= 0, write:add, read: 0, close:del */
  159. { EPOLLOUT, EPOLL_CTL_ADD },
  160. /* old= 0, write:add, read: 0, close:xxx */
  161. { 0, 255 },
  162. /* old= 0, write:add, read:add, close: 0 */
  163. { EPOLLIN|EPOLLOUT, EPOLL_CTL_ADD },
  164. /* old= 0, write:add, read:add, close:add */
  165. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_ADD },
  166. /* old= 0, write:add, read:add, close:del */
  167. { EPOLLIN|EPOLLOUT, EPOLL_CTL_ADD },
  168. /* old= 0, write:add, read:add, close:xxx */
  169. { 0, 255 },
  170. /* old= 0, write:add, read:del, close: 0 */
  171. { EPOLLOUT, EPOLL_CTL_ADD },
  172. /* old= 0, write:add, read:del, close:add */
  173. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_ADD },
  174. /* old= 0, write:add, read:del, close:del */
  175. { EPOLLOUT, EPOLL_CTL_ADD },
  176. /* old= 0, write:add, read:del, close:xxx */
  177. { 0, 255 },
  178. /* old= 0, write:add, read:xxx, close: 0 */
  179. { 0, 255 },
  180. /* old= 0, write:add, read:xxx, close:add */
  181. { 0, 255 },
  182. /* old= 0, write:add, read:xxx, close:del */
  183. { 0, 255 },
  184. /* old= 0, write:add, read:xxx, close:xxx */
  185. { 0, 255 },
  186. /* old= 0, write:del, read: 0, close: 0 */
  187. { EPOLLOUT, EPOLL_CTL_DEL },
  188. /* old= 0, write:del, read: 0, close:add */
  189. { EPOLLRDHUP, EPOLL_CTL_ADD },
  190. /* old= 0, write:del, read: 0, close:del */
  191. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
  192. /* old= 0, write:del, read: 0, close:xxx */
  193. { 0, 255 },
  194. /* old= 0, write:del, read:add, close: 0 */
  195. { EPOLLIN, EPOLL_CTL_ADD },
  196. /* old= 0, write:del, read:add, close:add */
  197. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_ADD },
  198. /* old= 0, write:del, read:add, close:del */
  199. { EPOLLIN, EPOLL_CTL_ADD },
  200. /* old= 0, write:del, read:add, close:xxx */
  201. { 0, 255 },
  202. /* old= 0, write:del, read:del, close: 0 */
  203. { EPOLLIN|EPOLLOUT, EPOLL_CTL_DEL },
  204. /* old= 0, write:del, read:del, close:add */
  205. { EPOLLRDHUP, EPOLL_CTL_ADD },
  206. /* old= 0, write:del, read:del, close:del */
  207. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
  208. /* old= 0, write:del, read:del, close:xxx */
  209. { 0, 255 },
  210. /* old= 0, write:del, read:xxx, close: 0 */
  211. { 0, 255 },
  212. /* old= 0, write:del, read:xxx, close:add */
  213. { 0, 255 },
  214. /* old= 0, write:del, read:xxx, close:del */
  215. { 0, 255 },
  216. /* old= 0, write:del, read:xxx, close:xxx */
  217. { 0, 255 },
  218. /* old= 0, write:xxx, read: 0, close: 0 */
  219. { 0, 255 },
  220. /* old= 0, write:xxx, read: 0, close:add */
  221. { 0, 255 },
  222. /* old= 0, write:xxx, read: 0, close:del */
  223. { 0, 255 },
  224. /* old= 0, write:xxx, read: 0, close:xxx */
  225. { 0, 255 },
  226. /* old= 0, write:xxx, read:add, close: 0 */
  227. { 0, 255 },
  228. /* old= 0, write:xxx, read:add, close:add */
  229. { 0, 255 },
  230. /* old= 0, write:xxx, read:add, close:del */
  231. { 0, 255 },
  232. /* old= 0, write:xxx, read:add, close:xxx */
  233. { 0, 255 },
  234. /* old= 0, write:xxx, read:del, close: 0 */
  235. { 0, 255 },
  236. /* old= 0, write:xxx, read:del, close:add */
  237. { 0, 255 },
  238. /* old= 0, write:xxx, read:del, close:del */
  239. { 0, 255 },
  240. /* old= 0, write:xxx, read:del, close:xxx */
  241. { 0, 255 },
  242. /* old= 0, write:xxx, read:xxx, close: 0 */
  243. { 0, 255 },
  244. /* old= 0, write:xxx, read:xxx, close:add */
  245. { 0, 255 },
  246. /* old= 0, write:xxx, read:xxx, close:del */
  247. { 0, 255 },
  248. /* old= 0, write:xxx, read:xxx, close:xxx */
  249. { 0, 255 },
  250. /* old= r, write: 0, read: 0, close: 0 */
  251. { 0, 0 },
  252. /* old= r, write: 0, read: 0, close:add */
  253. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  254. /* old= r, write: 0, read: 0, close:del */
  255. { EPOLLIN, EPOLL_CTL_MOD },
  256. /* old= r, write: 0, read: 0, close:xxx */
  257. { 0, 255 },
  258. /* old= r, write: 0, read:add, close: 0 */
  259. { EPOLLIN, EPOLL_CTL_MOD },
  260. /* old= r, write: 0, read:add, close:add */
  261. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  262. /* old= r, write: 0, read:add, close:del */
  263. { EPOLLIN, EPOLL_CTL_MOD },
  264. /* old= r, write: 0, read:add, close:xxx */
  265. { 0, 255 },
  266. /* old= r, write: 0, read:del, close: 0 */
  267. { EPOLLIN, EPOLL_CTL_DEL },
  268. /* old= r, write: 0, read:del, close:add */
  269. { EPOLLRDHUP, EPOLL_CTL_MOD },
  270. /* old= r, write: 0, read:del, close:del */
  271. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_DEL },
  272. /* old= r, write: 0, read:del, close:xxx */
  273. { 0, 255 },
  274. /* old= r, write: 0, read:xxx, close: 0 */
  275. { 0, 255 },
  276. /* old= r, write: 0, read:xxx, close:add */
  277. { 0, 255 },
  278. /* old= r, write: 0, read:xxx, close:del */
  279. { 0, 255 },
  280. /* old= r, write: 0, read:xxx, close:xxx */
  281. { 0, 255 },
  282. /* old= r, write:add, read: 0, close: 0 */
  283. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  284. /* old= r, write:add, read: 0, close:add */
  285. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  286. /* old= r, write:add, read: 0, close:del */
  287. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  288. /* old= r, write:add, read: 0, close:xxx */
  289. { 0, 255 },
  290. /* old= r, write:add, read:add, close: 0 */
  291. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  292. /* old= r, write:add, read:add, close:add */
  293. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  294. /* old= r, write:add, read:add, close:del */
  295. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  296. /* old= r, write:add, read:add, close:xxx */
  297. { 0, 255 },
  298. /* old= r, write:add, read:del, close: 0 */
  299. { EPOLLOUT, EPOLL_CTL_MOD },
  300. /* old= r, write:add, read:del, close:add */
  301. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  302. /* old= r, write:add, read:del, close:del */
  303. { EPOLLOUT, EPOLL_CTL_MOD },
  304. /* old= r, write:add, read:del, close:xxx */
  305. { 0, 255 },
  306. /* old= r, write:add, read:xxx, close: 0 */
  307. { 0, 255 },
  308. /* old= r, write:add, read:xxx, close:add */
  309. { 0, 255 },
  310. /* old= r, write:add, read:xxx, close:del */
  311. { 0, 255 },
  312. /* old= r, write:add, read:xxx, close:xxx */
  313. { 0, 255 },
  314. /* old= r, write:del, read: 0, close: 0 */
  315. { EPOLLIN, EPOLL_CTL_MOD },
  316. /* old= r, write:del, read: 0, close:add */
  317. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  318. /* old= r, write:del, read: 0, close:del */
  319. { EPOLLIN, EPOLL_CTL_MOD },
  320. /* old= r, write:del, read: 0, close:xxx */
  321. { 0, 255 },
  322. /* old= r, write:del, read:add, close: 0 */
  323. { EPOLLIN, EPOLL_CTL_MOD },
  324. /* old= r, write:del, read:add, close:add */
  325. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  326. /* old= r, write:del, read:add, close:del */
  327. { EPOLLIN, EPOLL_CTL_MOD },
  328. /* old= r, write:del, read:add, close:xxx */
  329. { 0, 255 },
  330. /* old= r, write:del, read:del, close: 0 */
  331. { EPOLLIN|EPOLLOUT, EPOLL_CTL_DEL },
  332. /* old= r, write:del, read:del, close:add */
  333. { EPOLLRDHUP, EPOLL_CTL_MOD },
  334. /* old= r, write:del, read:del, close:del */
  335. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
  336. /* old= r, write:del, read:del, close:xxx */
  337. { 0, 255 },
  338. /* old= r, write:del, read:xxx, close: 0 */
  339. { 0, 255 },
  340. /* old= r, write:del, read:xxx, close:add */
  341. { 0, 255 },
  342. /* old= r, write:del, read:xxx, close:del */
  343. { 0, 255 },
  344. /* old= r, write:del, read:xxx, close:xxx */
  345. { 0, 255 },
  346. /* old= r, write:xxx, read: 0, close: 0 */
  347. { 0, 255 },
  348. /* old= r, write:xxx, read: 0, close:add */
  349. { 0, 255 },
  350. /* old= r, write:xxx, read: 0, close:del */
  351. { 0, 255 },
  352. /* old= r, write:xxx, read: 0, close:xxx */
  353. { 0, 255 },
  354. /* old= r, write:xxx, read:add, close: 0 */
  355. { 0, 255 },
  356. /* old= r, write:xxx, read:add, close:add */
  357. { 0, 255 },
  358. /* old= r, write:xxx, read:add, close:del */
  359. { 0, 255 },
  360. /* old= r, write:xxx, read:add, close:xxx */
  361. { 0, 255 },
  362. /* old= r, write:xxx, read:del, close: 0 */
  363. { 0, 255 },
  364. /* old= r, write:xxx, read:del, close:add */
  365. { 0, 255 },
  366. /* old= r, write:xxx, read:del, close:del */
  367. { 0, 255 },
  368. /* old= r, write:xxx, read:del, close:xxx */
  369. { 0, 255 },
  370. /* old= r, write:xxx, read:xxx, close: 0 */
  371. { 0, 255 },
  372. /* old= r, write:xxx, read:xxx, close:add */
  373. { 0, 255 },
  374. /* old= r, write:xxx, read:xxx, close:del */
  375. { 0, 255 },
  376. /* old= r, write:xxx, read:xxx, close:xxx */
  377. { 0, 255 },
  378. /* old= w, write: 0, read: 0, close: 0 */
  379. { 0, 0 },
  380. /* old= w, write: 0, read: 0, close:add */
  381. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  382. /* old= w, write: 0, read: 0, close:del */
  383. { EPOLLOUT, EPOLL_CTL_MOD },
  384. /* old= w, write: 0, read: 0, close:xxx */
  385. { 0, 255 },
  386. /* old= w, write: 0, read:add, close: 0 */
  387. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  388. /* old= w, write: 0, read:add, close:add */
  389. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  390. /* old= w, write: 0, read:add, close:del */
  391. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  392. /* old= w, write: 0, read:add, close:xxx */
  393. { 0, 255 },
  394. /* old= w, write: 0, read:del, close: 0 */
  395. { EPOLLOUT, EPOLL_CTL_MOD },
  396. /* old= w, write: 0, read:del, close:add */
  397. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  398. /* old= w, write: 0, read:del, close:del */
  399. { EPOLLOUT, EPOLL_CTL_MOD },
  400. /* old= w, write: 0, read:del, close:xxx */
  401. { 0, 255 },
  402. /* old= w, write: 0, read:xxx, close: 0 */
  403. { 0, 255 },
  404. /* old= w, write: 0, read:xxx, close:add */
  405. { 0, 255 },
  406. /* old= w, write: 0, read:xxx, close:del */
  407. { 0, 255 },
  408. /* old= w, write: 0, read:xxx, close:xxx */
  409. { 0, 255 },
  410. /* old= w, write:add, read: 0, close: 0 */
  411. { EPOLLOUT, EPOLL_CTL_MOD },
  412. /* old= w, write:add, read: 0, close:add */
  413. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  414. /* old= w, write:add, read: 0, close:del */
  415. { EPOLLOUT, EPOLL_CTL_MOD },
  416. /* old= w, write:add, read: 0, close:xxx */
  417. { 0, 255 },
  418. /* old= w, write:add, read:add, close: 0 */
  419. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  420. /* old= w, write:add, read:add, close:add */
  421. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  422. /* old= w, write:add, read:add, close:del */
  423. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  424. /* old= w, write:add, read:add, close:xxx */
  425. { 0, 255 },
  426. /* old= w, write:add, read:del, close: 0 */
  427. { EPOLLOUT, EPOLL_CTL_MOD },
  428. /* old= w, write:add, read:del, close:add */
  429. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  430. /* old= w, write:add, read:del, close:del */
  431. { EPOLLOUT, EPOLL_CTL_MOD },
  432. /* old= w, write:add, read:del, close:xxx */
  433. { 0, 255 },
  434. /* old= w, write:add, read:xxx, close: 0 */
  435. { 0, 255 },
  436. /* old= w, write:add, read:xxx, close:add */
  437. { 0, 255 },
  438. /* old= w, write:add, read:xxx, close:del */
  439. { 0, 255 },
  440. /* old= w, write:add, read:xxx, close:xxx */
  441. { 0, 255 },
  442. /* old= w, write:del, read: 0, close: 0 */
  443. { EPOLLOUT, EPOLL_CTL_DEL },
  444. /* old= w, write:del, read: 0, close:add */
  445. { EPOLLRDHUP, EPOLL_CTL_MOD },
  446. /* old= w, write:del, read: 0, close:del */
  447. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
  448. /* old= w, write:del, read: 0, close:xxx */
  449. { 0, 255 },
  450. /* old= w, write:del, read:add, close: 0 */
  451. { EPOLLIN, EPOLL_CTL_MOD },
  452. /* old= w, write:del, read:add, close:add */
  453. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  454. /* old= w, write:del, read:add, close:del */
  455. { EPOLLIN, EPOLL_CTL_MOD },
  456. /* old= w, write:del, read:add, close:xxx */
  457. { 0, 255 },
  458. /* old= w, write:del, read:del, close: 0 */
  459. { EPOLLIN|EPOLLOUT, EPOLL_CTL_DEL },
  460. /* old= w, write:del, read:del, close:add */
  461. { EPOLLRDHUP, EPOLL_CTL_MOD },
  462. /* old= w, write:del, read:del, close:del */
  463. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
  464. /* old= w, write:del, read:del, close:xxx */
  465. { 0, 255 },
  466. /* old= w, write:del, read:xxx, close: 0 */
  467. { 0, 255 },
  468. /* old= w, write:del, read:xxx, close:add */
  469. { 0, 255 },
  470. /* old= w, write:del, read:xxx, close:del */
  471. { 0, 255 },
  472. /* old= w, write:del, read:xxx, close:xxx */
  473. { 0, 255 },
  474. /* old= w, write:xxx, read: 0, close: 0 */
  475. { 0, 255 },
  476. /* old= w, write:xxx, read: 0, close:add */
  477. { 0, 255 },
  478. /* old= w, write:xxx, read: 0, close:del */
  479. { 0, 255 },
  480. /* old= w, write:xxx, read: 0, close:xxx */
  481. { 0, 255 },
  482. /* old= w, write:xxx, read:add, close: 0 */
  483. { 0, 255 },
  484. /* old= w, write:xxx, read:add, close:add */
  485. { 0, 255 },
  486. /* old= w, write:xxx, read:add, close:del */
  487. { 0, 255 },
  488. /* old= w, write:xxx, read:add, close:xxx */
  489. { 0, 255 },
  490. /* old= w, write:xxx, read:del, close: 0 */
  491. { 0, 255 },
  492. /* old= w, write:xxx, read:del, close:add */
  493. { 0, 255 },
  494. /* old= w, write:xxx, read:del, close:del */
  495. { 0, 255 },
  496. /* old= w, write:xxx, read:del, close:xxx */
  497. { 0, 255 },
  498. /* old= w, write:xxx, read:xxx, close: 0 */
  499. { 0, 255 },
  500. /* old= w, write:xxx, read:xxx, close:add */
  501. { 0, 255 },
  502. /* old= w, write:xxx, read:xxx, close:del */
  503. { 0, 255 },
  504. /* old= w, write:xxx, read:xxx, close:xxx */
  505. { 0, 255 },
  506. /* old= rw, write: 0, read: 0, close: 0 */
  507. { 0, 0 },
  508. /* old= rw, write: 0, read: 0, close:add */
  509. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  510. /* old= rw, write: 0, read: 0, close:del */
  511. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  512. /* old= rw, write: 0, read: 0, close:xxx */
  513. { 0, 255 },
  514. /* old= rw, write: 0, read:add, close: 0 */
  515. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  516. /* old= rw, write: 0, read:add, close:add */
  517. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  518. /* old= rw, write: 0, read:add, close:del */
  519. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  520. /* old= rw, write: 0, read:add, close:xxx */
  521. { 0, 255 },
  522. /* old= rw, write: 0, read:del, close: 0 */
  523. { EPOLLOUT, EPOLL_CTL_MOD },
  524. /* old= rw, write: 0, read:del, close:add */
  525. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  526. /* old= rw, write: 0, read:del, close:del */
  527. { EPOLLOUT, EPOLL_CTL_MOD },
  528. /* old= rw, write: 0, read:del, close:xxx */
  529. { 0, 255 },
  530. /* old= rw, write: 0, read:xxx, close: 0 */
  531. { 0, 255 },
  532. /* old= rw, write: 0, read:xxx, close:add */
  533. { 0, 255 },
  534. /* old= rw, write: 0, read:xxx, close:del */
  535. { 0, 255 },
  536. /* old= rw, write: 0, read:xxx, close:xxx */
  537. { 0, 255 },
  538. /* old= rw, write:add, read: 0, close: 0 */
  539. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  540. /* old= rw, write:add, read: 0, close:add */
  541. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  542. /* old= rw, write:add, read: 0, close:del */
  543. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  544. /* old= rw, write:add, read: 0, close:xxx */
  545. { 0, 255 },
  546. /* old= rw, write:add, read:add, close: 0 */
  547. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  548. /* old= rw, write:add, read:add, close:add */
  549. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  550. /* old= rw, write:add, read:add, close:del */
  551. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  552. /* old= rw, write:add, read:add, close:xxx */
  553. { 0, 255 },
  554. /* old= rw, write:add, read:del, close: 0 */
  555. { EPOLLOUT, EPOLL_CTL_MOD },
  556. /* old= rw, write:add, read:del, close:add */
  557. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  558. /* old= rw, write:add, read:del, close:del */
  559. { EPOLLOUT, EPOLL_CTL_MOD },
  560. /* old= rw, write:add, read:del, close:xxx */
  561. { 0, 255 },
  562. /* old= rw, write:add, read:xxx, close: 0 */
  563. { 0, 255 },
  564. /* old= rw, write:add, read:xxx, close:add */
  565. { 0, 255 },
  566. /* old= rw, write:add, read:xxx, close:del */
  567. { 0, 255 },
  568. /* old= rw, write:add, read:xxx, close:xxx */
  569. { 0, 255 },
  570. /* old= rw, write:del, read: 0, close: 0 */
  571. { EPOLLIN, EPOLL_CTL_MOD },
  572. /* old= rw, write:del, read: 0, close:add */
  573. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  574. /* old= rw, write:del, read: 0, close:del */
  575. { EPOLLIN, EPOLL_CTL_MOD },
  576. /* old= rw, write:del, read: 0, close:xxx */
  577. { 0, 255 },
  578. /* old= rw, write:del, read:add, close: 0 */
  579. { EPOLLIN, EPOLL_CTL_MOD },
  580. /* old= rw, write:del, read:add, close:add */
  581. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  582. /* old= rw, write:del, read:add, close:del */
  583. { EPOLLIN, EPOLL_CTL_MOD },
  584. /* old= rw, write:del, read:add, close:xxx */
  585. { 0, 255 },
  586. /* old= rw, write:del, read:del, close: 0 */
  587. { EPOLLIN|EPOLLOUT, EPOLL_CTL_DEL },
  588. /* old= rw, write:del, read:del, close:add */
  589. { EPOLLRDHUP, EPOLL_CTL_MOD },
  590. /* old= rw, write:del, read:del, close:del */
  591. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
  592. /* old= rw, write:del, read:del, close:xxx */
  593. { 0, 255 },
  594. /* old= rw, write:del, read:xxx, close: 0 */
  595. { 0, 255 },
  596. /* old= rw, write:del, read:xxx, close:add */
  597. { 0, 255 },
  598. /* old= rw, write:del, read:xxx, close:del */
  599. { 0, 255 },
  600. /* old= rw, write:del, read:xxx, close:xxx */
  601. { 0, 255 },
  602. /* old= rw, write:xxx, read: 0, close: 0 */
  603. { 0, 255 },
  604. /* old= rw, write:xxx, read: 0, close:add */
  605. { 0, 255 },
  606. /* old= rw, write:xxx, read: 0, close:del */
  607. { 0, 255 },
  608. /* old= rw, write:xxx, read: 0, close:xxx */
  609. { 0, 255 },
  610. /* old= rw, write:xxx, read:add, close: 0 */
  611. { 0, 255 },
  612. /* old= rw, write:xxx, read:add, close:add */
  613. { 0, 255 },
  614. /* old= rw, write:xxx, read:add, close:del */
  615. { 0, 255 },
  616. /* old= rw, write:xxx, read:add, close:xxx */
  617. { 0, 255 },
  618. /* old= rw, write:xxx, read:del, close: 0 */
  619. { 0, 255 },
  620. /* old= rw, write:xxx, read:del, close:add */
  621. { 0, 255 },
  622. /* old= rw, write:xxx, read:del, close:del */
  623. { 0, 255 },
  624. /* old= rw, write:xxx, read:del, close:xxx */
  625. { 0, 255 },
  626. /* old= rw, write:xxx, read:xxx, close: 0 */
  627. { 0, 255 },
  628. /* old= rw, write:xxx, read:xxx, close:add */
  629. { 0, 255 },
  630. /* old= rw, write:xxx, read:xxx, close:del */
  631. { 0, 255 },
  632. /* old= rw, write:xxx, read:xxx, close:xxx */
  633. { 0, 255 },
  634. /* old= c, write: 0, read: 0, close: 0 */
  635. { 0, 0 },
  636. /* old= c, write: 0, read: 0, close:add */
  637. { EPOLLRDHUP, EPOLL_CTL_MOD },
  638. /* old= c, write: 0, read: 0, close:del */
  639. { EPOLLRDHUP, EPOLL_CTL_DEL },
  640. /* old= c, write: 0, read: 0, close:xxx */
  641. { 0, 255 },
  642. /* old= c, write: 0, read:add, close: 0 */
  643. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  644. /* old= c, write: 0, read:add, close:add */
  645. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  646. /* old= c, write: 0, read:add, close:del */
  647. { EPOLLIN, EPOLL_CTL_MOD },
  648. /* old= c, write: 0, read:add, close:xxx */
  649. { 0, 255 },
  650. /* old= c, write: 0, read:del, close: 0 */
  651. { EPOLLRDHUP, EPOLL_CTL_MOD },
  652. /* old= c, write: 0, read:del, close:add */
  653. { EPOLLRDHUP, EPOLL_CTL_MOD },
  654. /* old= c, write: 0, read:del, close:del */
  655. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_DEL },
  656. /* old= c, write: 0, read:del, close:xxx */
  657. { 0, 255 },
  658. /* old= c, write: 0, read:xxx, close: 0 */
  659. { 0, 255 },
  660. /* old= c, write: 0, read:xxx, close:add */
  661. { 0, 255 },
  662. /* old= c, write: 0, read:xxx, close:del */
  663. { 0, 255 },
  664. /* old= c, write: 0, read:xxx, close:xxx */
  665. { 0, 255 },
  666. /* old= c, write:add, read: 0, close: 0 */
  667. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  668. /* old= c, write:add, read: 0, close:add */
  669. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  670. /* old= c, write:add, read: 0, close:del */
  671. { EPOLLOUT, EPOLL_CTL_MOD },
  672. /* old= c, write:add, read: 0, close:xxx */
  673. { 0, 255 },
  674. /* old= c, write:add, read:add, close: 0 */
  675. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  676. /* old= c, write:add, read:add, close:add */
  677. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  678. /* old= c, write:add, read:add, close:del */
  679. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  680. /* old= c, write:add, read:add, close:xxx */
  681. { 0, 255 },
  682. /* old= c, write:add, read:del, close: 0 */
  683. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  684. /* old= c, write:add, read:del, close:add */
  685. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  686. /* old= c, write:add, read:del, close:del */
  687. { EPOLLOUT, EPOLL_CTL_MOD },
  688. /* old= c, write:add, read:del, close:xxx */
  689. { 0, 255 },
  690. /* old= c, write:add, read:xxx, close: 0 */
  691. { 0, 255 },
  692. /* old= c, write:add, read:xxx, close:add */
  693. { 0, 255 },
  694. /* old= c, write:add, read:xxx, close:del */
  695. { 0, 255 },
  696. /* old= c, write:add, read:xxx, close:xxx */
  697. { 0, 255 },
  698. /* old= c, write:del, read: 0, close: 0 */
  699. { EPOLLRDHUP, EPOLL_CTL_MOD },
  700. /* old= c, write:del, read: 0, close:add */
  701. { EPOLLRDHUP, EPOLL_CTL_MOD },
  702. /* old= c, write:del, read: 0, close:del */
  703. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
  704. /* old= c, write:del, read: 0, close:xxx */
  705. { 0, 255 },
  706. /* old= c, write:del, read:add, close: 0 */
  707. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  708. /* old= c, write:del, read:add, close:add */
  709. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  710. /* old= c, write:del, read:add, close:del */
  711. { EPOLLIN, EPOLL_CTL_MOD },
  712. /* old= c, write:del, read:add, close:xxx */
  713. { 0, 255 },
  714. /* old= c, write:del, read:del, close: 0 */
  715. { EPOLLRDHUP, EPOLL_CTL_MOD },
  716. /* old= c, write:del, read:del, close:add */
  717. { EPOLLRDHUP, EPOLL_CTL_MOD },
  718. /* old= c, write:del, read:del, close:del */
  719. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
  720. /* old= c, write:del, read:del, close:xxx */
  721. { 0, 255 },
  722. /* old= c, write:del, read:xxx, close: 0 */
  723. { 0, 255 },
  724. /* old= c, write:del, read:xxx, close:add */
  725. { 0, 255 },
  726. /* old= c, write:del, read:xxx, close:del */
  727. { 0, 255 },
  728. /* old= c, write:del, read:xxx, close:xxx */
  729. { 0, 255 },
  730. /* old= c, write:xxx, read: 0, close: 0 */
  731. { 0, 255 },
  732. /* old= c, write:xxx, read: 0, close:add */
  733. { 0, 255 },
  734. /* old= c, write:xxx, read: 0, close:del */
  735. { 0, 255 },
  736. /* old= c, write:xxx, read: 0, close:xxx */
  737. { 0, 255 },
  738. /* old= c, write:xxx, read:add, close: 0 */
  739. { 0, 255 },
  740. /* old= c, write:xxx, read:add, close:add */
  741. { 0, 255 },
  742. /* old= c, write:xxx, read:add, close:del */
  743. { 0, 255 },
  744. /* old= c, write:xxx, read:add, close:xxx */
  745. { 0, 255 },
  746. /* old= c, write:xxx, read:del, close: 0 */
  747. { 0, 255 },
  748. /* old= c, write:xxx, read:del, close:add */
  749. { 0, 255 },
  750. /* old= c, write:xxx, read:del, close:del */
  751. { 0, 255 },
  752. /* old= c, write:xxx, read:del, close:xxx */
  753. { 0, 255 },
  754. /* old= c, write:xxx, read:xxx, close: 0 */
  755. { 0, 255 },
  756. /* old= c, write:xxx, read:xxx, close:add */
  757. { 0, 255 },
  758. /* old= c, write:xxx, read:xxx, close:del */
  759. { 0, 255 },
  760. /* old= c, write:xxx, read:xxx, close:xxx */
  761. { 0, 255 },
  762. /* old= cr, write: 0, read: 0, close: 0 */
  763. { 0, 0 },
  764. /* old= cr, write: 0, read: 0, close:add */
  765. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  766. /* old= cr, write: 0, read: 0, close:del */
  767. { EPOLLIN, EPOLL_CTL_MOD },
  768. /* old= cr, write: 0, read: 0, close:xxx */
  769. { 0, 255 },
  770. /* old= cr, write: 0, read:add, close: 0 */
  771. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  772. /* old= cr, write: 0, read:add, close:add */
  773. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  774. /* old= cr, write: 0, read:add, close:del */
  775. { EPOLLIN, EPOLL_CTL_MOD },
  776. /* old= cr, write: 0, read:add, close:xxx */
  777. { 0, 255 },
  778. /* old= cr, write: 0, read:del, close: 0 */
  779. { EPOLLRDHUP, EPOLL_CTL_MOD },
  780. /* old= cr, write: 0, read:del, close:add */
  781. { EPOLLRDHUP, EPOLL_CTL_MOD },
  782. /* old= cr, write: 0, read:del, close:del */
  783. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_DEL },
  784. /* old= cr, write: 0, read:del, close:xxx */
  785. { 0, 255 },
  786. /* old= cr, write: 0, read:xxx, close: 0 */
  787. { 0, 255 },
  788. /* old= cr, write: 0, read:xxx, close:add */
  789. { 0, 255 },
  790. /* old= cr, write: 0, read:xxx, close:del */
  791. { 0, 255 },
  792. /* old= cr, write: 0, read:xxx, close:xxx */
  793. { 0, 255 },
  794. /* old= cr, write:add, read: 0, close: 0 */
  795. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  796. /* old= cr, write:add, read: 0, close:add */
  797. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  798. /* old= cr, write:add, read: 0, close:del */
  799. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  800. /* old= cr, write:add, read: 0, close:xxx */
  801. { 0, 255 },
  802. /* old= cr, write:add, read:add, close: 0 */
  803. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  804. /* old= cr, write:add, read:add, close:add */
  805. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  806. /* old= cr, write:add, read:add, close:del */
  807. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  808. /* old= cr, write:add, read:add, close:xxx */
  809. { 0, 255 },
  810. /* old= cr, write:add, read:del, close: 0 */
  811. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  812. /* old= cr, write:add, read:del, close:add */
  813. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  814. /* old= cr, write:add, read:del, close:del */
  815. { EPOLLOUT, EPOLL_CTL_MOD },
  816. /* old= cr, write:add, read:del, close:xxx */
  817. { 0, 255 },
  818. /* old= cr, write:add, read:xxx, close: 0 */
  819. { 0, 255 },
  820. /* old= cr, write:add, read:xxx, close:add */
  821. { 0, 255 },
  822. /* old= cr, write:add, read:xxx, close:del */
  823. { 0, 255 },
  824. /* old= cr, write:add, read:xxx, close:xxx */
  825. { 0, 255 },
  826. /* old= cr, write:del, read: 0, close: 0 */
  827. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  828. /* old= cr, write:del, read: 0, close:add */
  829. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  830. /* old= cr, write:del, read: 0, close:del */
  831. { EPOLLIN, EPOLL_CTL_MOD },
  832. /* old= cr, write:del, read: 0, close:xxx */
  833. { 0, 255 },
  834. /* old= cr, write:del, read:add, close: 0 */
  835. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  836. /* old= cr, write:del, read:add, close:add */
  837. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  838. /* old= cr, write:del, read:add, close:del */
  839. { EPOLLIN, EPOLL_CTL_MOD },
  840. /* old= cr, write:del, read:add, close:xxx */
  841. { 0, 255 },
  842. /* old= cr, write:del, read:del, close: 0 */
  843. { EPOLLRDHUP, EPOLL_CTL_MOD },
  844. /* old= cr, write:del, read:del, close:add */
  845. { EPOLLRDHUP, EPOLL_CTL_MOD },
  846. /* old= cr, write:del, read:del, close:del */
  847. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
  848. /* old= cr, write:del, read:del, close:xxx */
  849. { 0, 255 },
  850. /* old= cr, write:del, read:xxx, close: 0 */
  851. { 0, 255 },
  852. /* old= cr, write:del, read:xxx, close:add */
  853. { 0, 255 },
  854. /* old= cr, write:del, read:xxx, close:del */
  855. { 0, 255 },
  856. /* old= cr, write:del, read:xxx, close:xxx */
  857. { 0, 255 },
  858. /* old= cr, write:xxx, read: 0, close: 0 */
  859. { 0, 255 },
  860. /* old= cr, write:xxx, read: 0, close:add */
  861. { 0, 255 },
  862. /* old= cr, write:xxx, read: 0, close:del */
  863. { 0, 255 },
  864. /* old= cr, write:xxx, read: 0, close:xxx */
  865. { 0, 255 },
  866. /* old= cr, write:xxx, read:add, close: 0 */
  867. { 0, 255 },
  868. /* old= cr, write:xxx, read:add, close:add */
  869. { 0, 255 },
  870. /* old= cr, write:xxx, read:add, close:del */
  871. { 0, 255 },
  872. /* old= cr, write:xxx, read:add, close:xxx */
  873. { 0, 255 },
  874. /* old= cr, write:xxx, read:del, close: 0 */
  875. { 0, 255 },
  876. /* old= cr, write:xxx, read:del, close:add */
  877. { 0, 255 },
  878. /* old= cr, write:xxx, read:del, close:del */
  879. { 0, 255 },
  880. /* old= cr, write:xxx, read:del, close:xxx */
  881. { 0, 255 },
  882. /* old= cr, write:xxx, read:xxx, close: 0 */
  883. { 0, 255 },
  884. /* old= cr, write:xxx, read:xxx, close:add */
  885. { 0, 255 },
  886. /* old= cr, write:xxx, read:xxx, close:del */
  887. { 0, 255 },
  888. /* old= cr, write:xxx, read:xxx, close:xxx */
  889. { 0, 255 },
  890. /* old= cw, write: 0, read: 0, close: 0 */
  891. { 0, 0 },
  892. /* old= cw, write: 0, read: 0, close:add */
  893. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  894. /* old= cw, write: 0, read: 0, close:del */
  895. { EPOLLOUT, EPOLL_CTL_MOD },
  896. /* old= cw, write: 0, read: 0, close:xxx */
  897. { 0, 255 },
  898. /* old= cw, write: 0, read:add, close: 0 */
  899. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  900. /* old= cw, write: 0, read:add, close:add */
  901. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  902. /* old= cw, write: 0, read:add, close:del */
  903. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  904. /* old= cw, write: 0, read:add, close:xxx */
  905. { 0, 255 },
  906. /* old= cw, write: 0, read:del, close: 0 */
  907. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  908. /* old= cw, write: 0, read:del, close:add */
  909. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  910. /* old= cw, write: 0, read:del, close:del */
  911. { EPOLLOUT, EPOLL_CTL_MOD },
  912. /* old= cw, write: 0, read:del, close:xxx */
  913. { 0, 255 },
  914. /* old= cw, write: 0, read:xxx, close: 0 */
  915. { 0, 255 },
  916. /* old= cw, write: 0, read:xxx, close:add */
  917. { 0, 255 },
  918. /* old= cw, write: 0, read:xxx, close:del */
  919. { 0, 255 },
  920. /* old= cw, write: 0, read:xxx, close:xxx */
  921. { 0, 255 },
  922. /* old= cw, write:add, read: 0, close: 0 */
  923. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  924. /* old= cw, write:add, read: 0, close:add */
  925. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  926. /* old= cw, write:add, read: 0, close:del */
  927. { EPOLLOUT, EPOLL_CTL_MOD },
  928. /* old= cw, write:add, read: 0, close:xxx */
  929. { 0, 255 },
  930. /* old= cw, write:add, read:add, close: 0 */
  931. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  932. /* old= cw, write:add, read:add, close:add */
  933. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  934. /* old= cw, write:add, read:add, close:del */
  935. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  936. /* old= cw, write:add, read:add, close:xxx */
  937. { 0, 255 },
  938. /* old= cw, write:add, read:del, close: 0 */
  939. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  940. /* old= cw, write:add, read:del, close:add */
  941. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  942. /* old= cw, write:add, read:del, close:del */
  943. { EPOLLOUT, EPOLL_CTL_MOD },
  944. /* old= cw, write:add, read:del, close:xxx */
  945. { 0, 255 },
  946. /* old= cw, write:add, read:xxx, close: 0 */
  947. { 0, 255 },
  948. /* old= cw, write:add, read:xxx, close:add */
  949. { 0, 255 },
  950. /* old= cw, write:add, read:xxx, close:del */
  951. { 0, 255 },
  952. /* old= cw, write:add, read:xxx, close:xxx */
  953. { 0, 255 },
  954. /* old= cw, write:del, read: 0, close: 0 */
  955. { EPOLLRDHUP, EPOLL_CTL_MOD },
  956. /* old= cw, write:del, read: 0, close:add */
  957. { EPOLLRDHUP, EPOLL_CTL_MOD },
  958. /* old= cw, write:del, read: 0, close:del */
  959. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
  960. /* old= cw, write:del, read: 0, close:xxx */
  961. { 0, 255 },
  962. /* old= cw, write:del, read:add, close: 0 */
  963. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  964. /* old= cw, write:del, read:add, close:add */
  965. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  966. /* old= cw, write:del, read:add, close:del */
  967. { EPOLLIN, EPOLL_CTL_MOD },
  968. /* old= cw, write:del, read:add, close:xxx */
  969. { 0, 255 },
  970. /* old= cw, write:del, read:del, close: 0 */
  971. { EPOLLRDHUP, EPOLL_CTL_MOD },
  972. /* old= cw, write:del, read:del, close:add */
  973. { EPOLLRDHUP, EPOLL_CTL_MOD },
  974. /* old= cw, write:del, read:del, close:del */
  975. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
  976. /* old= cw, write:del, read:del, close:xxx */
  977. { 0, 255 },
  978. /* old= cw, write:del, read:xxx, close: 0 */
  979. { 0, 255 },
  980. /* old= cw, write:del, read:xxx, close:add */
  981. { 0, 255 },
  982. /* old= cw, write:del, read:xxx, close:del */
  983. { 0, 255 },
  984. /* old= cw, write:del, read:xxx, close:xxx */
  985. { 0, 255 },
  986. /* old= cw, write:xxx, read: 0, close: 0 */
  987. { 0, 255 },
  988. /* old= cw, write:xxx, read: 0, close:add */
  989. { 0, 255 },
  990. /* old= cw, write:xxx, read: 0, close:del */
  991. { 0, 255 },
  992. /* old= cw, write:xxx, read: 0, close:xxx */
  993. { 0, 255 },
  994. /* old= cw, write:xxx, read:add, close: 0 */
  995. { 0, 255 },
  996. /* old= cw, write:xxx, read:add, close:add */
  997. { 0, 255 },
  998. /* old= cw, write:xxx, read:add, close:del */
  999. { 0, 255 },
  1000. /* old= cw, write:xxx, read:add, close:xxx */
  1001. { 0, 255 },
  1002. /* old= cw, write:xxx, read:del, close: 0 */
  1003. { 0, 255 },
  1004. /* old= cw, write:xxx, read:del, close:add */
  1005. { 0, 255 },
  1006. /* old= cw, write:xxx, read:del, close:del */
  1007. { 0, 255 },
  1008. /* old= cw, write:xxx, read:del, close:xxx */
  1009. { 0, 255 },
  1010. /* old= cw, write:xxx, read:xxx, close: 0 */
  1011. { 0, 255 },
  1012. /* old= cw, write:xxx, read:xxx, close:add */
  1013. { 0, 255 },
  1014. /* old= cw, write:xxx, read:xxx, close:del */
  1015. { 0, 255 },
  1016. /* old= cw, write:xxx, read:xxx, close:xxx */
  1017. { 0, 255 },
  1018. /* old=crw, write: 0, read: 0, close: 0 */
  1019. { 0, 0 },
  1020. /* old=crw, write: 0, read: 0, close:add */
  1021. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  1022. /* old=crw, write: 0, read: 0, close:del */
  1023. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  1024. /* old=crw, write: 0, read: 0, close:xxx */
  1025. { 0, 255 },
  1026. /* old=crw, write: 0, read:add, close: 0 */
  1027. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  1028. /* old=crw, write: 0, read:add, close:add */
  1029. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  1030. /* old=crw, write: 0, read:add, close:del */
  1031. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  1032. /* old=crw, write: 0, read:add, close:xxx */
  1033. { 0, 255 },
  1034. /* old=crw, write: 0, read:del, close: 0 */
  1035. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  1036. /* old=crw, write: 0, read:del, close:add */
  1037. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  1038. /* old=crw, write: 0, read:del, close:del */
  1039. { EPOLLOUT, EPOLL_CTL_MOD },
  1040. /* old=crw, write: 0, read:del, close:xxx */
  1041. { 0, 255 },
  1042. /* old=crw, write: 0, read:xxx, close: 0 */
  1043. { 0, 255 },
  1044. /* old=crw, write: 0, read:xxx, close:add */
  1045. { 0, 255 },
  1046. /* old=crw, write: 0, read:xxx, close:del */
  1047. { 0, 255 },
  1048. /* old=crw, write: 0, read:xxx, close:xxx */
  1049. { 0, 255 },
  1050. /* old=crw, write:add, read: 0, close: 0 */
  1051. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  1052. /* old=crw, write:add, read: 0, close:add */
  1053. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  1054. /* old=crw, write:add, read: 0, close:del */
  1055. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  1056. /* old=crw, write:add, read: 0, close:xxx */
  1057. { 0, 255 },
  1058. /* old=crw, write:add, read:add, close: 0 */
  1059. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  1060. /* old=crw, write:add, read:add, close:add */
  1061. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  1062. /* old=crw, write:add, read:add, close:del */
  1063. { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
  1064. /* old=crw, write:add, read:add, close:xxx */
  1065. { 0, 255 },
  1066. /* old=crw, write:add, read:del, close: 0 */
  1067. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  1068. /* old=crw, write:add, read:del, close:add */
  1069. { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
  1070. /* old=crw, write:add, read:del, close:del */
  1071. { EPOLLOUT, EPOLL_CTL_MOD },
  1072. /* old=crw, write:add, read:del, close:xxx */
  1073. { 0, 255 },
  1074. /* old=crw, write:add, read:xxx, close: 0 */
  1075. { 0, 255 },
  1076. /* old=crw, write:add, read:xxx, close:add */
  1077. { 0, 255 },
  1078. /* old=crw, write:add, read:xxx, close:del */
  1079. { 0, 255 },
  1080. /* old=crw, write:add, read:xxx, close:xxx */
  1081. { 0, 255 },
  1082. /* old=crw, write:del, read: 0, close: 0 */
  1083. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  1084. /* old=crw, write:del, read: 0, close:add */
  1085. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  1086. /* old=crw, write:del, read: 0, close:del */
  1087. { EPOLLIN, EPOLL_CTL_MOD },
  1088. /* old=crw, write:del, read: 0, close:xxx */
  1089. { 0, 255 },
  1090. /* old=crw, write:del, read:add, close: 0 */
  1091. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  1092. /* old=crw, write:del, read:add, close:add */
  1093. { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
  1094. /* old=crw, write:del, read:add, close:del */
  1095. { EPOLLIN, EPOLL_CTL_MOD },
  1096. /* old=crw, write:del, read:add, close:xxx */
  1097. { 0, 255 },
  1098. /* old=crw, write:del, read:del, close: 0 */
  1099. { EPOLLRDHUP, EPOLL_CTL_MOD },
  1100. /* old=crw, write:del, read:del, close:add */
  1101. { EPOLLRDHUP, EPOLL_CTL_MOD },
  1102. /* old=crw, write:del, read:del, close:del */
  1103. { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
  1104. /* old=crw, write:del, read:del, close:xxx */
  1105. { 0, 255 },
  1106. /* old=crw, write:del, read:xxx, close: 0 */
  1107. { 0, 255 },
  1108. /* old=crw, write:del, read:xxx, close:add */
  1109. { 0, 255 },
  1110. /* old=crw, write:del, read:xxx, close:del */
  1111. { 0, 255 },
  1112. /* old=crw, write:del, read:xxx, close:xxx */
  1113. { 0, 255 },
  1114. /* old=crw, write:xxx, read: 0, close: 0 */
  1115. { 0, 255 },
  1116. /* old=crw, write:xxx, read: 0, close:add */
  1117. { 0, 255 },
  1118. /* old=crw, write:xxx, read: 0, close:del */
  1119. { 0, 255 },
  1120. /* old=crw, write:xxx, read: 0, close:xxx */
  1121. { 0, 255 },
  1122. /* old=crw, write:xxx, read:add, close: 0 */
  1123. { 0, 255 },
  1124. /* old=crw, write:xxx, read:add, close:add */
  1125. { 0, 255 },
  1126. /* old=crw, write:xxx, read:add, close:del */
  1127. { 0, 255 },
  1128. /* old=crw, write:xxx, read:add, close:xxx */
  1129. { 0, 255 },
  1130. /* old=crw, write:xxx, read:del, close: 0 */
  1131. { 0, 255 },
  1132. /* old=crw, write:xxx, read:del, close:add */
  1133. { 0, 255 },
  1134. /* old=crw, write:xxx, read:del, close:del */
  1135. { 0, 255 },
  1136. /* old=crw, write:xxx, read:del, close:xxx */
  1137. { 0, 255 },
  1138. /* old=crw, write:xxx, read:xxx, close: 0 */
  1139. { 0, 255 },
  1140. /* old=crw, write:xxx, read:xxx, close:add */
  1141. { 0, 255 },
  1142. /* old=crw, write:xxx, read:xxx, close:del */
  1143. { 0, 255 },
  1144. /* old=crw, write:xxx, read:xxx, close:xxx */
  1145. { 0, 255 },
  1146. };
  1147. #endif