[fuchsia] Add a Fuchsia compat shim for openssh's uses of select

A few parts of ssh, in particular the client and server loops, use
select() to monitor the read and write state of a small number of open
sockets. libc's select() implementation is limited to only handling 8
FDs at a time, which this code hits in common situations.

This adds a fuchsia_select shim which implements the subset of the
select() functionality used by openssh and patches the callers to
select() to call this shim instead when __Fuchsia__ is defined. The
shim does not support exceptfds at all, which isn't used, and uses a
fairly inefficient method of waiting.

Further work should move more of the state management out to the caller
so objects like the port can persist between calls instead of having to
be reallocated for each wait.

NET-701 #done

Change-Id: Iee927a25283883e52fdcb8dde568417158d0f6f3
10 files changed
tree: 8ff9467ed18291bee8f6d20ebb1f6a346fc5ab62
  1. contrib/
  2. fuchsia/
  3. openbsd-compat/
  4. regress/
  5. .skipped-commit-ids
  6. aclocal.m4
  7. addrmatch.c
  8. atomicio.c
  9. atomicio.h
  10. audit-bsm.c
  11. audit-linux.c
  12. audit.c
  13. audit.h
  14. auth-bsdauth.c
  15. auth-krb5.c
  16. auth-options.c
  17. auth-options.h
  18. auth-pam.c
  19. auth-pam.h
  20. auth-passwd.c
  21. auth-rhosts.c
  22. auth-shadow.c
  23. auth-sia.c
  24. auth-sia.h
  25. auth-skey.c
  26. auth.c
  27. auth.h
  28. auth2-chall.c
  29. auth2-gss.c
  30. auth2-hostbased.c
  31. auth2-kbdint.c
  32. auth2-none.c
  33. auth2-passwd.c
  34. auth2-pubkey.c
  35. auth2.c
  36. authfd.c
  37. authfd.h
  38. authfile.c
  39. authfile.h
  40. bitmap.c
  41. bitmap.h
  42. blocks.c
  43. bufaux.c
  44. bufbn.c
  45. bufec.c
  46. buffer.c
  47. buffer.h
  48. BUILD.gn
  49. buildpkg.sh.in
  50. canohost.c
  51. canohost.h
  52. chacha.c
  53. chacha.h
  54. channels.c
  55. channels.h
  56. cipher-3des1.c
  57. cipher-aes.c
  58. cipher-aesctr.c
  59. cipher-aesctr.h
  60. cipher-bf1.c
  61. cipher-chachapoly.c
  62. cipher-chachapoly.h
  63. cipher-ctr.c
  64. cipher.c
  65. cipher.h
  66. cleanup.c
  67. clientloop.c
  68. clientloop.h
  69. compat.c
  70. compat.h
  71. configure.ac
  72. crc32.c
  73. crc32.h
  74. CREDITS
  75. crypto_api.h
  76. deattack.c
  77. deattack.h
  78. defines.h
  79. dh.c
  80. dh.h
  81. digest-libc.c
  82. digest-openssl.c
  83. digest.h
  84. dispatch.c
  85. dispatch.h
  86. dns.c
  87. dns.h
  88. ed25519.c
  89. entropy.c
  90. entropy.h
  91. fatal.c
  92. fe25519.c
  93. fe25519.h
  94. fixalgorithms
  95. fixpaths
  96. fixprogs
  97. ge25519.c
  98. ge25519.h
  99. ge25519_base.data
  100. groupaccess.c
  101. groupaccess.h
  102. gss-genr.c
  103. gss-serv-krb5.c
  104. gss-serv.c
  105. hash.c
  106. hmac.c
  107. hmac.h
  108. hostfile.c
  109. hostfile.h
  110. includes.h
  111. INSTALL
  112. install-sh
  113. kex.c
  114. kex.h
  115. kexc25519.c
  116. kexc25519c.c
  117. kexc25519s.c
  118. kexdh.c
  119. kexdhc.c
  120. kexdhs.c
  121. kexecdh.c
  122. kexecdhc.c
  123. kexecdhs.c
  124. kexgex.c
  125. kexgexc.c
  126. kexgexs.c
  127. key.c
  128. key.h
  129. krl.c
  130. krl.h
  131. LICENCE
  132. log.c
  133. log.h
  134. loginrec.c
  135. loginrec.h
  136. logintest.c
  137. mac.c
  138. mac.h
  139. Makefile.in
  140. match.c
  141. match.h
  142. md-sha256.c
  143. md5crypt.c
  144. md5crypt.h
  145. mdoc2man.awk
  146. misc.c
  147. misc.h
  148. mkinstalldirs
  149. moduli
  150. moduli.5
  151. moduli.c
  152. monitor.c
  153. monitor.h
  154. monitor_fdpass.c
  155. monitor_fdpass.h
  156. monitor_wrap.c
  157. monitor_wrap.h
  158. msg.c
  159. msg.h
  160. mux.c
  161. myproposal.h
  162. nchan.c
  163. nchan.ms
  164. nchan2.ms
  165. opacket.c
  166. opacket.h
  167. openssh.xml.in
  168. opensshd.init.in
  169. OVERVIEW
  170. packet.c
  171. packet.h
  172. pathnames.h
  173. pkcs11.h
  174. platform-pledge.c
  175. platform-tracing.c
  176. platform.c
  177. platform.h
  178. poly1305.c
  179. poly1305.h
  180. progressmeter.c
  181. progressmeter.h
  182. PROTOCOL
  183. PROTOCOL.agent
  184. PROTOCOL.certkeys
  185. PROTOCOL.chacha20poly1305
  186. PROTOCOL.key
  187. PROTOCOL.krl
  188. PROTOCOL.mux
  189. readconf.c
  190. readconf.h
  191. README
  192. README.dns
  193. README.fuchsia
  194. README.platform
  195. README.privsep
  196. README.tun
  197. readpass.c
  198. rijndael.c
  199. rijndael.h
  200. rsa.c
  201. rsa.h
  202. sandbox-capsicum.c
  203. sandbox-darwin.c
  204. sandbox-null.c
  205. sandbox-pledge.c
  206. sandbox-rlimit.c
  207. sandbox-seccomp-filter.c
  208. sandbox-solaris.c
  209. sandbox-systrace.c
  210. sc25519.c
  211. sc25519.h
  212. scp.1
  213. scp.c
  214. servconf.c
  215. servconf.h
  216. serverloop.c
  217. serverloop.h
  218. session.c
  219. session.h
  220. sftp-client.c
  221. sftp-client.h
  222. sftp-common.c
  223. sftp-common.h
  224. sftp-glob.c
  225. sftp-server-main.c
  226. sftp-server.8
  227. sftp-server.c
  228. sftp.1
  229. sftp.c
  230. sftp.h
  231. smult_curve25519_ref.c
  232. ssh-add.1
  233. ssh-add.c
  234. ssh-agent.1
  235. ssh-agent.c
  236. ssh-dss.c
  237. ssh-ecdsa.c
  238. ssh-ed25519.c
  239. ssh-gss.h
  240. ssh-keygen.1
  241. ssh-keygen.c
  242. ssh-keyscan.1
  243. ssh-keyscan.c
  244. ssh-keysign.8
  245. ssh-keysign.c
  246. ssh-pkcs11-client.c
  247. ssh-pkcs11-helper.8
  248. ssh-pkcs11-helper.c
  249. ssh-pkcs11.c
  250. ssh-pkcs11.h
  251. ssh-rsa.c
  252. ssh-sandbox.h
  253. ssh.1
  254. ssh.c
  255. ssh.h
  256. ssh1.h
  257. ssh2.h
  258. ssh_api.c
  259. ssh_api.h
  260. ssh_config
  261. ssh_config.5
  262. sshbuf-getput-basic.c
  263. sshbuf-getput-crypto.c
  264. sshbuf-misc.c
  265. sshbuf.c
  266. sshbuf.h
  267. sshconnect.c
  268. sshconnect.h
  269. sshconnect1.c
  270. sshconnect2.c
  271. sshd.8
  272. sshd.c
  273. sshd_config
  274. sshd_config.5
  275. ssherr.c
  276. ssherr.h
  277. sshkey.c
  278. sshkey.h
  279. sshlogin.c
  280. sshlogin.h
  281. sshpty.c
  282. sshpty.h
  283. sshtty.c
  284. survey.sh.in
  285. TODO
  286. ttymodes.c
  287. ttymodes.h
  288. uidswap.c
  289. uidswap.h
  290. umac.c
  291. umac.h
  292. utf8.c
  293. utf8.h
  294. uuencode.c
  295. uuencode.h
  296. verify.c
  297. version.h
  298. xmalloc.c
  299. xmalloc.h