Open setharnold opened 6 years ago
@rust-lang/libs checking with y'all before a PR gets opened for this – is it okay to specify that close-on-exec flag (CLOEXEC) gets set as a platform-specific behavior for TcpStream::try_clone
?
@frewsxcv ah yeah every file descriptor libstd creates has CLOEXEC, so this should be good to document
so next step here is deciding how to document this. i imagine there are a bunch of APIs in the standard library that create file descriptors. would it be excessive to add a # Platform-specific behavior
to each of these APIs mentioning which platforms set CLOEXEC
?
@frewsxcv yup!
Hello, the TcpSocket try_clone() method calls into .duplicate(), which sets the close-on-exec flag on the socket:
https://doc.rust-lang.org/src/std/net/tcp.rs.html#255-257 https://github.com/rust-lang/rust/blob/master/src/libstd/sys/unix/fd.rs#L197
I believe the documentation for try_clone() should be extended to describe:
(this would help address very similar issue 45536)Thanks