os gates functions like copy_file_range on an AC_CHECK_FUNCS probe at configure time and drops them entirely when the build libc lacks the symbol. Redistributable builds pay for this: python-build-standalone targets glibc 2.17 for portability, so every os function whose glibc wrapper is newer than 2.17 is gone for good, even when the interpreter later runs on a newer glibc or a kernel that implements the syscall.
Affected functions, with the glibc version that added the wrapper:
os.copy_file_range, os.memfd_create (2.27)
os.pidfd_open, os.pidfd_getfd (2.36)
pidfd_open and pidfd_getfd already sidestep it by calling the raw syscall directly.
On Linux we could resolve these at load time instead: dlsym the symbol once from a constructor, fall back to the raw syscall when the running libc doesn't have it, and keep the existing HAVE_* path everywhere else. Only functions above the 2.17 baseline need it. Same idea as #125022, but for libc symbols instead of SIMD.
Linked PRs
osgates functions likecopy_file_rangeon anAC_CHECK_FUNCSprobe at configure time and drops them entirely when the build libc lacks the symbol. Redistributable builds pay for this: python-build-standalone targets glibc 2.17 for portability, so everyosfunction whose glibc wrapper is newer than 2.17 is gone for good, even when the interpreter later runs on a newer glibc or a kernel that implements the syscall.Affected functions, with the glibc version that added the wrapper:
os.copy_file_range,os.memfd_create(2.27)os.pidfd_open,os.pidfd_getfd(2.36)pidfd_openandpidfd_getfdalready sidestep it by calling the raw syscall directly.On Linux we could resolve these at load time instead:
dlsymthe symbol once from a constructor, fall back to the raw syscall when the running libc doesn't have it, and keep the existingHAVE_*path everywhere else. Only functions above the 2.17 baseline need it. Same idea as #125022, but for libc symbols instead of SIMD.Linked PRs