Code extracted from: https://github.com/libuv/libuv.git at commit ee24ce900e5714c950b248da2bdd311b01c983be (v1.x).