This project exposes the stdio C function `luafileno` to convert a `*FILE` into a file descriptor.
$ luarocks install luafileno
root