-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed
Labels
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.
Description
Besides
O_CLOEXEC, which other things would we be able to clean up?
Good question! There are 6 workarounds in libstd for older Linux versions (that I could find).
Increasing the minimum version to 2.6.32 (aka 3rd Kernel LTS, aka RHEL 6) would fix 5 of them.
Code links are inline:
-
File::open_cuses theO_CLOEXECflag withopen(2)(mentioned above, added in 2.6.23) -
FileDesc::duplicateusesF_DUPFD_CLOEXECwithfcntl(2)(added in 2.6.24, there is also the mention of a bug occuring on "some linux kernel at some point") -
pipe::anon_pipeusespipe2(2)to atomically set theO_CLOEXECflag on the pipe fds (added in 2.6.27) -
Socket::new_rawusesSOCK_CLOEXECwithsocket(2)(added in 2.6.27) -
Socket::acceptusesaccept4(2)to permit use ofSOCK_CLOEXEC(added in 2.6.28) fs::copyusescopy_file_range(2)(added in 4.5, not fixed by this proposal)
As you can see, the workarounds fixed by this proposal all have a similar flavor.
Originally posted by @josephlr in #62516 (comment)
Metadata
Metadata
Assignees
Labels
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.