There is a `uv__open_cloexec()` in src/unix/stream.c that you can use.