When using an external library and/or FFI bindings, all non-cloexec file descriptors leak to all new processes spawned with `Command::spawn()`. This was introduced by the I/O reform because the [`getdtablesize()` loop](https://github.com/rust-lang/rust/blob/dabf0c6371d3b193664f58746fa27c1835a010f3/src/libstd/sys/unix/process.rs#L224-229) disappeared. The `getdtablesize()` loop could be replaced with a `walk_dir()` through `/proc/self/fd` when available (cf. https://github.com/rust-lang/rust/issues/12148#issuecomment-78221721). cc #12148 cc #22678 cc #24237 cc rust-lang/rfcs#941 cc @alexcrichton cc @aturon