-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up some workarounds after upgrading minimum kernel version #74519
Comments
Kernel updated in #74163 . |
As noted, |
The new minimal version is 2.6.27 from what I can see, so "Socket::accept uses accept4(2) to permit use of SOCK_CLOEXEC" still needs a fallback, right? |
The builder is using 2.6.32 headers, so I would call that our new minimum. |
Ah right; I am actually not sure where I got the 27 from... |
The title of #62516 suggested 2.6.27, but we went a little higher to match the actual distros in use. |
@alexcrichton I know this is ancient history, but do you recall the problem with |
Just digging in kernel history, I did find one hiccup in torvalds/linux@1219771, but that bug was introduced and resolved during the 3.7 development cycle, not in a release. |
IIRC we just mirrored what musl did at the time, which looks like it still does: int ret = __syscall(SYS_fcntl, fd, F_DUPFD_CLOEXEC, arg);
if (ret != -EINVAL) {
if (ret >= 0)
__syscall(SYS_fcntl, ret, F_SETFD, FD_CLOEXEC);
return __syscall_ret(ret);
} Looks like the original mailing list thread is gone and there's no comments in the musl source, and I don't recall what happened here. I suspect it would be safe to remove those workarounds and just assume |
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_c
uses theO_CLOEXEC
flag withopen(2)
(mentioned above, added in 2.6.23)FileDesc::duplicate
usesF_DUPFD_CLOEXEC
withfcntl(2)
(added in 2.6.24, there is also the mention of a bug occuring on "some linux kernel at some point")pipe::anon_pipe
usespipe2(2)
to atomically set theO_CLOEXEC
flag on the pipe fds (added in 2.6.27)Socket::new_raw
usesSOCK_CLOEXEC
withsocket(2)
(added in 2.6.27)Socket::accept
usesaccept4(2)
to permit use ofSOCK_CLOEXEC
(added in 2.6.28)fs::copy
usescopy_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)
The text was updated successfully, but these errors were encountered: