rust-lang / socket2

Advanced configuration options for sockets.
https://docs.rs/socket2
Apache License 2.0
652 stars 214 forks source link

Don't set CLOEXEC on Fuchsia #443

Open ttttcrngyblflpp opened 1 year ago

ttttcrngyblflpp commented 1 year ago

The CLOEXEC flag is currently set for the Fuchsia platform, e.g. in accept.

Even though the flag is supported on Fuchsia, the flag doesn't do anything because Fuchsia doesn't really have exec as a concept. As a result, it would seem wise to pretend that this flag doesn't exist on Fuchsia.

Thomasdezeeuw commented 1 year ago

I don't know enough about Fuchsia to say whether or not this makes sense, @tamird any thoughts?

tamird commented 1 year ago

Everything @ttttcrngyblflpp says is correct. The flag is supported - it can be set and queried - but doesn't do anything because exec doesn't exist in Fuchsia by design.

Whether or not this justifies conditional logic is less clear to me.

There's an issue tracking this in Fuchsia, which may be useful to cite when making changes in this area.