I'm wondering if we can reuse some OS.File implementation modules to do these file descriptor read/write!
We already have some code that uses jsctypes to call these functions:
http://mxr.mozilla.org/mozilla-central/source/toolkit/components/osfile/osfile_unix_back.jsm
http://mxr.mozilla.org/mozilla-central/source/toolkit/components/osfile/osfile_win_back.jsm
https://developer.mozilla.org/en-US/docs/JavaScript_OS.File/OS.File_for_workers

OS.File works in workers, unfortunately, it exposes an high level API where we can't pass a fd.
But there may be some room to call internals to do that.