A nominally working translation. The select() support is almost certainly broken, and at this point there
are no tests.