kripken/emscripten — pull request #1557 by inolen (2013-08-25 06:01:54+00:00)
Title: getaddrinfo, freeaddrinfo, getnameinfo support and sockfs

The first commit tweaks the new ipv6 functionality added by https://github.com/kripken/emscripten/pull/1348 so that the internal functions (inet_ntop4, inet_pton4, etc.) are prefixed with an underscore. Further, inet_ntop6_raw was changed to take in an array of integers as opposed to a pointer to the heap. `inet_ntoa_raw` was renamed to be `inet_ntop4_raw` to be consistent with `inet_ntop6_raw`. The `test_inet*` and `test_getaddrinfo` tests were moved into the sockets test suite. And finally, `test_sockets_getaddrinfo` was re-enabled and consolidated with `test_getaddrinfo`.

The second commit adds support for `getaddrinfo`, `freeaddrinfo` and `getnameinfo`. Part of that meant moving some of the fake IP generation / resolution code that previously existed in `gethostbyname` into the two new internal functions `_lookup_name` and `_lookup_addr`. Tests were added for all of them.

The final commit adds the new sockfs filesystem and replaces many of our libc networking functions to call (e.g. ioctl, recv, poll, send, etc.) into the appropriate stream operations. Socket tests were updated to now compile the C server and run them through node as a separate harness. A `package.json` file was added to the root to make installing the node `ws` module simple (just run `npm install` from the emscripten root).