Test / verify uv_fileno binding
Split from #403
Can you check that
filenois operating properly?
uv_os_fd_t is a HANDLE on Windows and a typedef int on Unix. We have no test cases and it's unclear if we're binding it in a way that makes sense for all platforms.
https://github.com/luvit/luv/blob/cfd4f38bc7c6482e6a8ebf721e196d16a83ab364/src/handle.c#L182-L189
Links:
- http://docs.libuv.org/en/v1.x/handle.html#c.uv_fileno
- http://docs.libuv.org/en/v1.x/misc.html#c.uv_os_fd_t
- https://github.com/libuv/libuv/search?utf8=%E2%9C%93&q=uv_fileno&type=
It looks like node returns -1 (or UV_EBADF) on Windows from their uv_fileno wrappers:
- https://github.com/nodejs/node/blob/0c65314e0e8602f4a7e0ace43ebd63de233eac62/src/stream_wrap.h#L115-L123
- https://github.com/nodejs/node/blob/afdc3d0d187e4e3a336937df17a4c90092405e2a/src/udp_wrap.cc#L172-L180
- https://github.com/nodejs/node/blob/060d901f87b3d87314f8540eb02f315e2952f581/src/stream_wrap.cc#L165-L174
We're returning the HANDLE pointer as an int on Windows, which might be okay? https://stackoverflow.com/questions/18266626/what-is-the-range-of-a-windows-handle-on-a-64-bits-application
EDIT: A relevant node issue: https://github.com/nodejs/node/issues/7627 and a node library that returns the HANDLE: https://github.com/clshortfuse/node-getsockethandleaddress