Repository navigation
Conversation
|
|
||
| .. versionchanged:: 3.16 | ||
| The function is also available when Python is built against a libc | ||
| that lacks ``statx()``, such as glibc older than 2.28. |
There was a problem hiding this comment.
I suspect this will be backportable to 3.15 once that is released (although will need a core developer to confirm)
There was a problem hiding this comment.
Given 3.15 has now released, it isn't backportable anymore unfortunately
|
I believe this would now need the same try-catch on OSError as the other syscall fallbacks which rely on cpython/Lib/logging/handlers.py Lines 288 to 290 in 5607381 e.g. cpython/Lib/asyncio/unix_events.py Lines 1025 to 1033 in 5607381 |
Expose os.statx when build with Linux headers that provide the syscall number and struct statx, even if the build-time libc lacks a statx wrapper. Call the libc wrapper when available, to keep the symbol versioing and fortification checks. Fall back to the syscall if the wrapper is absent, either at build or run time. Detect optional struct statx fields from the available libc or kernel headers. os.statx is not longer exposed when the syscall is unavailable at build time, even is libc provides a wrapper. This is a rare edge case where glibc would emulate the behavior at runtime.
411cbb0 to
372ca48
Compare
Documentation build overview
|
…hongh-153400) Co-authored-by: Muse Code (Meta Muse Spark)
db0e4e4 to
943aa85
Compare
Following the pattern in #155520, this adds a syscall fallback for statx.
Expose os.statx when built with Linux headers that provide the syscall number and statx struct, even if the build time libc lacks a statx wrapper.
Call the libc wrapper when available, to keep the symbol versioning and fortification checks. Fall back to the syscall if the wrapper is absent, either at build or run time. If the run time kernel lacks the syscall an OSError with errno.ENOSYS will be raised.
Detect the optional statx struct fields from the available libc or kernel headers.
os.statx is no longer exposed when the syscall is unavailable at build time, even if libc provides a wrapper. This is a rare edge case where glibc would emulate the behavior of statx at runtime.