epoll.html 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <!-- This file is generated by Nim. -->
  4. <html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en" data-theme="auto">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <title>std/epoll</title>
  9. <!-- Google fonts -->
  10. <link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
  11. <link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
  12. <!-- Favicon -->
  13. <link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
  14. <link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
  15. <!-- CSS -->
  16. <link rel="stylesheet" type="text/css" href="nimdoc.out.css?v=2.3.1">
  17. <!-- JS -->
  18. <script type="text/javascript" src="dochack.js?v=2.3.1"></script>
  19. </head>
  20. <body>
  21. <div class="document" id="documentId">
  22. <div class="container">
  23. <h1 class="title">std/epoll</h1>
  24. <div class="row">
  25. <div class="three columns">
  26. <div class="theme-select-wrapper">
  27. <label for="theme-select">Theme:&nbsp;</label>
  28. <select id="theme-select" onchange="setTheme(this.value)">
  29. <option value="auto">🌗 Match OS</option>
  30. <option value="dark">🌑 Dark</option>
  31. <option value="light">🌕 Light</option>
  32. </select>
  33. </div>
  34. <div id="global-links">
  35. <ul class="simple-boot">
  36. <li><a href="manual.html">Manual</a></li>
  37. <li><a href="lib.html">Standard library</a></li>
  38. <li> <a id="indexLink" href="theindex.html">Index</a></li>
  39. <li><a href="compiler/theindex.html">Compiler docs</a></li>
  40. <li><a href="https://nim-lang.github.io/fusion/theindex.html">Fusion docs</a></li>
  41. <li><a href="https://nim-lang.github.io/Nim/">devel</a>, <a href="https://nim-lang.org/documentation.html">stable</a></li>
  42. </ul>
  43. </div>
  44. <div id="searchInputDiv">
  45. Search: <input type="search" id="searchInput"
  46. oninput="search()" />
  47. </div>
  48. <ul class="simple simple-toc" id="toc-list">
  49. <li>
  50. <a class="reference reference-toplevel" href="#6" id="56">Imports</a>
  51. </li>
  52. <li>
  53. <details open>
  54. <summary><a class="reference reference-toplevel" href="#7" id="57">Types</a></summary>
  55. <ul class="simple simple-toc-section">
  56. <li><a class="reference" href="#EpollData" title="EpollData {.importc: &quot;epoll_data_t&quot;, header: &quot;&lt;sys/epoll.h&gt;&quot;, pure, final, union.} = object
  57. fd* {.importc: &quot;fd&quot;.}: cint
  58. u32* {.importc: &quot;u32&quot;.}: uint32
  59. u64* {.importc: &quot;u64&quot;.}: uint64">EpollData</a></li>
  60. <li><a class="reference" href="#EpollEvent" title="EpollEvent {.importc: &quot;struct epoll_event&quot;, header: &quot;&lt;sys/epoll.h&gt;&quot;, pure,
  61. final, packed.} = object
  62. events*: uint32
  63. data*: EpollData">EpollEvent</a></li>
  64. </ul>
  65. </details>
  66. </li>
  67. <li>
  68. <details open>
  69. <summary><a class="reference reference-toplevel" href="#10" id="60">Consts</a></summary>
  70. <ul class="simple simple-toc-section">
  71. <li><a class="reference" href="#EPOLL_CTL_ADD" title="EPOLL_CTL_ADD = 1">EPOLL_CTL_ADD</a></li>
  72. <li><a class="reference" href="#EPOLL_CTL_DEL" title="EPOLL_CTL_DEL = 2">EPOLL_CTL_DEL</a></li>
  73. <li><a class="reference" href="#EPOLL_CTL_MOD" title="EPOLL_CTL_MOD = 3">EPOLL_CTL_MOD</a></li>
  74. <li><a class="reference" href="#EPOLLERR" title="EPOLLERR = 0x00000008">EPOLLERR</a></li>
  75. <li><a class="reference" href="#EPOLLET" title="EPOLLET = 2147483648">EPOLLET</a></li>
  76. <li><a class="reference" href="#EPOLLEXCLUSIVE" title="EPOLLEXCLUSIVE = 268435456">EPOLLEXCLUSIVE</a></li>
  77. <li><a class="reference" href="#EPOLLHUP" title="EPOLLHUP = 0x00000010">EPOLLHUP</a></li>
  78. <li><a class="reference" href="#EPOLLIN" title="EPOLLIN = 0x00000001">EPOLLIN</a></li>
  79. <li><a class="reference" href="#EPOLLMSG" title="EPOLLMSG = 0x00000400">EPOLLMSG</a></li>
  80. <li><a class="reference" href="#EPOLLONESHOT" title="EPOLLONESHOT = 1073741824">EPOLLONESHOT</a></li>
  81. <li><a class="reference" href="#EPOLLOUT" title="EPOLLOUT = 0x00000004">EPOLLOUT</a></li>
  82. <li><a class="reference" href="#EPOLLPRI" title="EPOLLPRI = 0x00000002">EPOLLPRI</a></li>
  83. <li><a class="reference" href="#EPOLLRDBAND" title="EPOLLRDBAND = 0x00000080">EPOLLRDBAND</a></li>
  84. <li><a class="reference" href="#EPOLLRDHUP" title="EPOLLRDHUP = 0x00002000">EPOLLRDHUP</a></li>
  85. <li><a class="reference" href="#EPOLLRDNORM" title="EPOLLRDNORM = 0x00000040">EPOLLRDNORM</a></li>
  86. <li><a class="reference" href="#EPOLLWAKEUP" title="EPOLLWAKEUP = 536870912">EPOLLWAKEUP</a></li>
  87. <li><a class="reference" href="#EPOLLWRBAND" title="EPOLLWRBAND = 0x00000200">EPOLLWRBAND</a></li>
  88. <li><a class="reference" href="#EPOLLWRNORM" title="EPOLLWRNORM = 0x00000100">EPOLLWRNORM</a></li>
  89. </ul>
  90. </details>
  91. </li>
  92. <li>
  93. <details open>
  94. <summary><a class="reference reference-toplevel" href="#12" id="62">Procs</a></summary>
  95. <ul class="simple simple-toc-section">
  96. <ul class="simple nested-toc-section">epoll_create
  97. <li><a class="reference" href="#epoll_create%2Ccint" title="epoll_create(size: cint): cint">epoll_create(size: cint): cint</a></li>
  98. </ul>
  99. <ul class="simple nested-toc-section">epoll_create1
  100. <li><a class="reference" href="#epoll_create1%2Ccint" title="epoll_create1(flags: cint): cint">epoll_create1(flags: cint): cint</a></li>
  101. </ul>
  102. <ul class="simple nested-toc-section">epoll_ctl
  103. <li><a class="reference" href="#epoll_ctl%2Ccint%2Ccint%2C%2Cptr.EpollEvent" title="epoll_ctl(epfd: cint; op: cint; fd: cint | SocketHandle; event: ptr EpollEvent): cint">epoll_ctl(epfd: cint; op: cint; fd: cint | SocketHandle; event: ptr EpollEvent): cint</a></li>
  104. </ul>
  105. <ul class="simple nested-toc-section">epoll_wait
  106. <li><a class="reference" href="#epoll_wait%2Ccint%2Cptr.EpollEvent%2Ccint%2Ccint" title="epoll_wait(epfd: cint; events: ptr EpollEvent; maxevents: cint; timeout: cint): cint">epoll_wait(epfd: cint; events: ptr EpollEvent; maxevents: cint; timeout: cint): cint</a></li>
  107. </ul>
  108. </ul>
  109. </details>
  110. </li>
  111. </ul>
  112. </div>
  113. <div class="nine columns" id="content">
  114. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L1" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  115. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L1" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  116. <div id="tocRoot"></div>
  117. <p class="module-desc"></p>
  118. <div class="section" id="6">
  119. <h1><a class="toc-backref" href="#6">Imports</a></h1>
  120. <dl class="item">
  121. <a class="reference external" href="posix.html">posix</a>
  122. </dl>
  123. </div>
  124. <div class="section" id="7">
  125. <h1><a class="toc-backref" href="#7">Types</a></h1>
  126. <dl class="item">
  127. <div id="EpollData">
  128. <dt><pre><a href="epoll.html#EpollData"><span class="Identifier">EpollData</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;epoll_data_t&quot;</span><span class="Other">,</span> <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">&quot;&lt;sys/epoll.h&gt;&quot;</span><span class="Other">,</span> <span class="Identifier">pure</span><span class="Other">,</span> <span class="Identifier">final</span><span class="Other">,</span> <span class="Identifier">union</span>.} <span class="Other">=</span> <span class="Keyword">object</span>
  129. <span class="Identifier">fd</span><span class="Operator">*</span> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;fd&quot;</span>.}<span class="Other">:</span> <a href="ctypes.html#cint"><span class="Identifier">cint</span></a>
  130. <span class="Identifier">u32</span><span class="Operator">*</span> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;u32&quot;</span>.}<span class="Other">:</span> <a href="system.html#uint32"><span class="Identifier">uint32</span></a>
  131. <span class="Identifier">u64</span><span class="Operator">*</span> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;u64&quot;</span>.}<span class="Other">:</span> <a href="system.html#uint64"><span class="Identifier">uint64</span></a></pre></dt>
  132. <dd>
  133. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L44" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  134. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L44" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  135. </dd>
  136. </div>
  137. <div id="EpollEvent">
  138. <dt><pre><a href="epoll.html#EpollEvent"><span class="Identifier">EpollEvent</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;struct epoll_event&quot;</span><span class="Other">,</span> <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">&quot;&lt;sys/epoll.h&gt;&quot;</span><span class="Other">,</span> <span class="Identifier">pure</span><span class="Other">,</span>
  139. <span class="Identifier">final</span><span class="Other">,</span> <span class="Identifier">packed</span>.} <span class="Other">=</span> <span class="Keyword">object</span>
  140. <span class="Identifier">events</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#uint32"><span class="Identifier">uint32</span></a>
  141. <span class="Identifier">data</span><span class="Operator">*</span><span class="Other">:</span> <a href="epoll.html#EpollData"><span class="Identifier">EpollData</span></a></pre></dt>
  142. <dd>
  143. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L50" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  144. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L50" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  145. </dd>
  146. </div>
  147. </dl>
  148. </div>
  149. <div class="section" id="10">
  150. <h1><a class="toc-backref" href="#10">Consts</a></h1>
  151. <dl class="item">
  152. <div id="EPOLL_CTL_ADD">
  153. <dt><pre><a href="epoll.html#EPOLL_CTL_ADD"><span class="Identifier">EPOLL_CTL_ADD</span></a> <span class="Other">=</span> <span class="DecNumber">1</span></pre></dt>
  154. <dd>
  155. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L32" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  156. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L32" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  157. </dd>
  158. </div>
  159. <div id="EPOLL_CTL_DEL">
  160. <dt><pre><a href="epoll.html#EPOLL_CTL_DEL"><span class="Identifier">EPOLL_CTL_DEL</span></a> <span class="Other">=</span> <span class="DecNumber">2</span></pre></dt>
  161. <dd>
  162. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L33" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  163. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L33" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  164. </dd>
  165. </div>
  166. <div id="EPOLL_CTL_MOD">
  167. <dt><pre><a href="epoll.html#EPOLL_CTL_MOD"><span class="Identifier">EPOLL_CTL_MOD</span></a> <span class="Other">=</span> <span class="DecNumber">3</span></pre></dt>
  168. <dd>
  169. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L34" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  170. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L34" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  171. </dd>
  172. </div>
  173. <div id="EPOLLERR">
  174. <dt><pre><a href="epoll.html#EPOLLERR"><span class="Identifier">EPOLLERR</span></a> <span class="Other">=</span> <span class="DecNumber">0x00000008</span></pre></dt>
  175. <dd>
  176. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L16" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  177. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L16" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  178. </dd>
  179. </div>
  180. <div id="EPOLLET">
  181. <dt><pre><a href="epoll.html#EPOLLET"><span class="Identifier">EPOLLET</span></a> <span class="Other">=</span> <span class="DecNumber">2147483648</span></pre></dt>
  182. <dd>
  183. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L27" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  184. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L27" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  185. </dd>
  186. </div>
  187. <div id="EPOLLEXCLUSIVE">
  188. <dt><pre><a href="epoll.html#EPOLLEXCLUSIVE"><span class="Identifier">EPOLLEXCLUSIVE</span></a> <span class="Other">=</span> <span class="DecNumber">268435456</span></pre></dt>
  189. <dd>
  190. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L24" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  191. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L24" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  192. </dd>
  193. </div>
  194. <div id="EPOLLHUP">
  195. <dt><pre><a href="epoll.html#EPOLLHUP"><span class="Identifier">EPOLLHUP</span></a> <span class="Other">=</span> <span class="DecNumber">0x00000010</span></pre></dt>
  196. <dd>
  197. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L17" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  198. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L17" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  199. </dd>
  200. </div>
  201. <div id="EPOLLIN">
  202. <dt><pre><a href="epoll.html#EPOLLIN"><span class="Identifier">EPOLLIN</span></a> <span class="Other">=</span> <span class="DecNumber">0x00000001</span></pre></dt>
  203. <dd>
  204. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L13" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  205. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L13" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  206. </dd>
  207. </div>
  208. <div id="EPOLLMSG">
  209. <dt><pre><a href="epoll.html#EPOLLMSG"><span class="Identifier">EPOLLMSG</span></a> <span class="Other">=</span> <span class="DecNumber">0x00000400</span></pre></dt>
  210. <dd>
  211. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L22" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  212. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L22" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  213. </dd>
  214. </div>
  215. <div id="EPOLLONESHOT">
  216. <dt><pre><a href="epoll.html#EPOLLONESHOT"><span class="Identifier">EPOLLONESHOT</span></a> <span class="Other">=</span> <span class="DecNumber">1073741824</span></pre></dt>
  217. <dd>
  218. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L26" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  219. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L26" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  220. </dd>
  221. </div>
  222. <div id="EPOLLOUT">
  223. <dt><pre><a href="epoll.html#EPOLLOUT"><span class="Identifier">EPOLLOUT</span></a> <span class="Other">=</span> <span class="DecNumber">0x00000004</span></pre></dt>
  224. <dd>
  225. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L15" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  226. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L15" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  227. </dd>
  228. </div>
  229. <div id="EPOLLPRI">
  230. <dt><pre><a href="epoll.html#EPOLLPRI"><span class="Identifier">EPOLLPRI</span></a> <span class="Other">=</span> <span class="DecNumber">0x00000002</span></pre></dt>
  231. <dd>
  232. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L14" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  233. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L14" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  234. </dd>
  235. </div>
  236. <div id="EPOLLRDBAND">
  237. <dt><pre><a href="epoll.html#EPOLLRDBAND"><span class="Identifier">EPOLLRDBAND</span></a> <span class="Other">=</span> <span class="DecNumber">0x00000080</span></pre></dt>
  238. <dd>
  239. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L19" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  240. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L19" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  241. </dd>
  242. </div>
  243. <div id="EPOLLRDHUP">
  244. <dt><pre><a href="epoll.html#EPOLLRDHUP"><span class="Identifier">EPOLLRDHUP</span></a> <span class="Other">=</span> <span class="DecNumber">0x00002000</span></pre></dt>
  245. <dd>
  246. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L23" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  247. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L23" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  248. </dd>
  249. </div>
  250. <div id="EPOLLRDNORM">
  251. <dt><pre><a href="epoll.html#EPOLLRDNORM"><span class="Identifier">EPOLLRDNORM</span></a> <span class="Other">=</span> <span class="DecNumber">0x00000040</span></pre></dt>
  252. <dd>
  253. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L18" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  254. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L18" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  255. </dd>
  256. </div>
  257. <div id="EPOLLWAKEUP">
  258. <dt><pre><a href="epoll.html#EPOLLWAKEUP"><span class="Identifier">EPOLLWAKEUP</span></a> <span class="Other">=</span> <span class="DecNumber">536870912</span></pre></dt>
  259. <dd>
  260. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L25" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  261. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L25" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  262. </dd>
  263. </div>
  264. <div id="EPOLLWRBAND">
  265. <dt><pre><a href="epoll.html#EPOLLWRBAND"><span class="Identifier">EPOLLWRBAND</span></a> <span class="Other">=</span> <span class="DecNumber">0x00000200</span></pre></dt>
  266. <dd>
  267. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L21" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  268. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L21" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  269. </dd>
  270. </div>
  271. <div id="EPOLLWRNORM">
  272. <dt><pre><a href="epoll.html#EPOLLWRNORM"><span class="Identifier">EPOLLWRNORM</span></a> <span class="Other">=</span> <span class="DecNumber">0x00000100</span></pre></dt>
  273. <dd>
  274. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L20" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  275. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L20" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  276. </dd>
  277. </div>
  278. </dl>
  279. </div>
  280. <div class="section" id="12">
  281. <h1><a class="toc-backref" href="#12">Procs</a></h1>
  282. <dl class="item">
  283. <div id="epoll_create-procs-all">
  284. <div id="epoll_create,cint">
  285. <dt><pre><span class="Keyword">proc</span> <a href="#epoll_create%2Ccint"><span class="Identifier">epoll_create</span></a><span class="Other">(</span><span class="Identifier">size</span><span class="Other">:</span> <a href="ctypes.html#cint"><span class="Identifier">cint</span></a><span class="Other">)</span><span class="Other">:</span> <a href="ctypes.html#cint"><span class="Identifier">cint</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;epoll_create&quot;</span><span class="Other">,</span>
  286. <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">&quot;&lt;sys/epoll.h&gt;&quot;</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
  287. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  288. <dd>
  289. <p>Creates an epoll instance. Returns an fd for the new instance.</p>
  290. <p>The &quot;size&quot; parameter is a hint specifying the number of file descriptors to be associated with the new instance. The fd returned by epoll_create() should be closed with close().</p>
  291. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L54" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  292. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L54" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  293. </dd>
  294. </div>
  295. </div>
  296. <div id="epoll_create1-procs-all">
  297. <div id="epoll_create1,cint">
  298. <dt><pre><span class="Keyword">proc</span> <a href="#epoll_create1%2Ccint"><span class="Identifier">epoll_create1</span></a><span class="Other">(</span><span class="Identifier">flags</span><span class="Other">:</span> <a href="ctypes.html#cint"><span class="Identifier">cint</span></a><span class="Other">)</span><span class="Other">:</span> <a href="ctypes.html#cint"><span class="Identifier">cint</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;epoll_create1&quot;</span><span class="Other">,</span>
  299. <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">&quot;&lt;sys/epoll.h&gt;&quot;</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
  300. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  301. <dd>
  302. Same as epoll_create but with an FLAGS parameter. The unused SIZE parameter has been dropped.
  303. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L62" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  304. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L62" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  305. </dd>
  306. </div>
  307. </div>
  308. <div id="epoll_ctl-procs-all">
  309. <div id="epoll_ctl,cint,cint,,ptr.EpollEvent">
  310. <dt><pre><span class="Keyword">proc</span> <a href="#epoll_ctl%2Ccint%2Ccint%2C%2Cptr.EpollEvent"><span class="Identifier">epoll_ctl</span></a><span class="Other">(</span><span class="Identifier">epfd</span><span class="Other">:</span> <a href="ctypes.html#cint"><span class="Identifier">cint</span></a><span class="Other">;</span> <span class="Identifier">op</span><span class="Other">:</span> <a href="ctypes.html#cint"><span class="Identifier">cint</span></a><span class="Other">;</span> <span class="Identifier">fd</span><span class="Other">:</span> <a href="ctypes.html#cint"><span class="Identifier">cint</span></a> <span class="Operator">|</span> <a href="posix.html#SocketHandle"><span class="Identifier">SocketHandle</span></a><span class="Other">;</span>
  311. <span class="Identifier">event</span><span class="Other">:</span> <span class="Keyword">ptr</span> <a href="epoll.html#EpollEvent"><span class="Identifier">EpollEvent</span></a><span class="Other">)</span><span class="Other">:</span> <a href="ctypes.html#cint"><span class="Identifier">cint</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;epoll_ctl&quot;</span><span class="Other">,</span>
  312. <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">&quot;&lt;sys/epoll.h&gt;&quot;</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  313. <dd>
  314. <p>Manipulate an epoll instance &quot;epfd&quot;. Returns <tt class="docutils literal"><span class="pre"><span class="DecNumber">0</span></span></tt> in case of success, <tt class="docutils literal"><span class="pre"><span class="Operator">-</span><span class="DecNumber">1</span></span></tt> in case of error (the &quot;errno&quot; variable will contain the specific error code).</p>
  315. <p>The &quot;op&quot; parameter is one of the <tt class="docutils literal"><span class="pre"><span class="Identifier">EPOLL_CTL_</span><span class="Operator">*</span></span></tt> constants defined above. The &quot;fd&quot; parameter is the target of the operation. The &quot;event&quot; parameter describes which events the caller is interested in and any associated user data.</p>
  316. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L67" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  317. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L67" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  318. </dd>
  319. </div>
  320. </div>
  321. <div id="epoll_wait-procs-all">
  322. <div id="epoll_wait,cint,ptr.EpollEvent,cint,cint">
  323. <dt><pre><span class="Keyword">proc</span> <a href="#epoll_wait%2Ccint%2Cptr.EpollEvent%2Ccint%2Ccint"><span class="Identifier">epoll_wait</span></a><span class="Other">(</span><span class="Identifier">epfd</span><span class="Other">:</span> <a href="ctypes.html#cint"><span class="Identifier">cint</span></a><span class="Other">;</span> <span class="Identifier">events</span><span class="Other">:</span> <span class="Keyword">ptr</span> <a href="epoll.html#EpollEvent"><span class="Identifier">EpollEvent</span></a><span class="Other">;</span> <span class="Identifier">maxevents</span><span class="Other">:</span> <a href="ctypes.html#cint"><span class="Identifier">cint</span></a><span class="Other">;</span>
  324. <span class="Identifier">timeout</span><span class="Other">:</span> <a href="ctypes.html#cint"><span class="Identifier">cint</span></a><span class="Other">)</span><span class="Other">:</span> <a href="ctypes.html#cint"><span class="Identifier">cint</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;epoll_wait&quot;</span><span class="Other">,</span>
  325. <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">&quot;&lt;sys/epoll.h&gt;&quot;</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
  326. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  327. <dd>
  328. <p>Wait for events on an epoll instance &quot;epfd&quot;. Returns the number of triggered events returned in &quot;events&quot; buffer. Or -1 in case of error with the &quot;errno&quot; variable set to the specific error code. The &quot;events&quot; parameter is a buffer that will contain triggered events. The &quot;maxevents&quot; is the maximum number of events to be returned ( usually size of &quot;events&quot; ). The &quot;timeout&quot; parameter specifies the maximum wait time in milliseconds (-1 == infinite).</p>
  329. <p>This function is a cancellation point and therefore not marked with __THROW.</p>
  330. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/posix/epoll.nim#L77" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  331. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/posix/epoll.nim#L77" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  332. </dd>
  333. </div>
  334. </div>
  335. </dl>
  336. </div>
  337. </div>
  338. </div>
  339. <div class="twelve-columns footer">
  340. <span class="nim-sprite"></span>
  341. <br>
  342. <small style="color: var(--hint);">Made with Nim. Generated: 2025-02-03 14:57:19 UTC</small>
  343. </div>
  344. </div>
  345. </div>
  346. <script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
  347. </body>
  348. </html>