Repository navigation
gh-153400: Add a syscall fallback for os.statx #159043
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
Open
jjhelmus
wants to merge
3
commits into
python:main
Choose a base branch
from
jjhelmus:jjh/statx_syscall_fallback
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+173
−77
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3544,10 +3544,14 @@ features: | |||||
|
|
||||||
| .. seealso:: The :manpage:`statx(2)` man page. | ||||||
|
|
||||||
| .. availability:: Linux >= 4.11 with glibc >= 2.28. | ||||||
| .. availability:: Linux >= 4.11. | ||||||
|
|
||||||
| .. versionadded:: 3.15 | ||||||
|
|
||||||
| .. versionchanged:: 3.16 | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Minor nit, we prefer |
||||||
| The function is also available when Python is built against a libc | ||||||
| that lacks ``statx()``, such as glibc older than 2.28. | ||||||
|
cmaloney marked this conversation as resolved.
Resolved
|
||||||
|
|
||||||
|
|
||||||
| .. class:: statx_result | ||||||
|
|
||||||
|
|
@@ -3576,7 +3580,7 @@ features: | |||||
| Equal to ``None`` if :data:`STATX_WRITE_ATOMIC` is missing from | ||||||
| :attr:`~statx_result.stx_mask`. | ||||||
|
|
||||||
| .. availability:: Linux >= 4.11 with glibc >= 2.28 and build-time kernel | ||||||
| .. availability:: Linux >= 4.11 and build-time kernel | ||||||
| userspace API headers >= 6.11. | ||||||
|
|
||||||
| .. attribute:: stx_atomic_write_unit_max | ||||||
|
|
@@ -3586,7 +3590,7 @@ features: | |||||
| Equal to ``None`` if :data:`STATX_WRITE_ATOMIC` is missing from | ||||||
| :attr:`~statx_result.stx_mask`. | ||||||
|
|
||||||
| .. availability:: Linux >= 4.11 with glibc >= 2.28 and build-time kernel | ||||||
| .. availability:: Linux >= 4.11 and build-time kernel | ||||||
| userspace API headers >= 6.11. | ||||||
|
|
||||||
| .. attribute:: stx_atomic_write_unit_max_opt | ||||||
|
|
@@ -3596,7 +3600,7 @@ features: | |||||
| Equal to ``None`` if :data:`STATX_WRITE_ATOMIC` is missing from | ||||||
| :attr:`~statx_result.stx_mask`. | ||||||
|
|
||||||
| .. availability:: Linux >= 4.11 with glibc >= 2.28 and build-time kernel | ||||||
| .. availability:: Linux >= 4.11 and build-time kernel | ||||||
| userspace API headers >= 6.16. | ||||||
|
|
||||||
| .. attribute:: stx_atomic_write_unit_min | ||||||
|
|
@@ -3606,7 +3610,7 @@ features: | |||||
| Equal to ``None`` if :data:`STATX_WRITE_ATOMIC` is missing from | ||||||
| :attr:`~statx_result.stx_mask`. | ||||||
|
|
||||||
| .. availability:: Linux >= 4.11 with glibc >= 2.28 and build-time kernel | ||||||
| .. availability:: Linux >= 4.11 and build-time kernel | ||||||
| userspace API headers >= 6.11. | ||||||
|
|
||||||
| .. attribute:: stx_attributes | ||||||
|
|
@@ -3680,7 +3684,7 @@ features: | |||||
| Equal to ``None`` if :data:`STATX_DIOALIGN` is missing from | ||||||
| :attr:`~statx_result.stx_mask`. | ||||||
|
|
||||||
| .. availability:: Linux >= 4.11 with glibc >= 2.28 and build-time kernel | ||||||
| .. availability:: Linux >= 4.11 and build-time kernel | ||||||
| userspace API headers >= 6.1. | ||||||
|
|
||||||
| .. attribute:: stx_dio_offset_align | ||||||
|
|
@@ -3690,7 +3694,7 @@ features: | |||||
| Equal to ``None`` if :data:`STATX_DIOALIGN` is missing from | ||||||
| :attr:`~statx_result.stx_mask`. | ||||||
|
|
||||||
| .. availability:: Linux >= 4.11 with glibc >= 2.28 and build-time kernel | ||||||
| .. availability:: Linux >= 4.11 and build-time kernel | ||||||
| userspace API headers >= 6.1. | ||||||
|
|
||||||
| .. attribute:: stx_dio_read_offset_align | ||||||
|
|
@@ -3700,7 +3704,7 @@ features: | |||||
| Equal to ``None`` if :data:`STATX_DIO_READ_ALIGN` is missing from | ||||||
| :attr:`~statx_result.stx_mask`. | ||||||
|
|
||||||
| .. availability:: Linux >= 4.11 with glibc >= 2.28 and build-time kernel | ||||||
| .. availability:: Linux >= 4.11 and build-time kernel | ||||||
| userspace API headers >= 6.14. | ||||||
|
|
||||||
| .. attribute:: stx_gid | ||||||
|
|
@@ -3729,7 +3733,7 @@ features: | |||||
| Equal to ``None`` if :data:`STATX_MNT_ID` is missing from | ||||||
| :attr:`~statx_result.stx_mask`. | ||||||
|
|
||||||
| .. availability:: Linux >= 4.11 with glibc >= 2.28 and build-time kernel | ||||||
| .. availability:: Linux >= 4.11 and build-time kernel | ||||||
| userspace API headers >= 5.8. | ||||||
|
|
||||||
| .. attribute:: stx_mode | ||||||
|
|
@@ -3789,7 +3793,7 @@ features: | |||||
| Equal to ``None`` if :data:`STATX_SUBVOL` is missing from | ||||||
| :attr:`~statx_result.stx_mask`. | ||||||
|
|
||||||
| .. availability:: Linux >= 4.11 with glibc >= 2.28 and build-time kernel | ||||||
| .. availability:: Linux >= 4.11 and build-time kernel | ||||||
| userspace API headers >= 6.10. | ||||||
|
|
||||||
| .. attribute:: stx_uid | ||||||
|
|
@@ -3801,7 +3805,7 @@ features: | |||||
|
|
||||||
| .. seealso:: The :manpage:`statx(2)` man page. | ||||||
|
|
||||||
| .. availability:: Linux >= 4.11 with glibc >= 2.28. | ||||||
| .. availability:: Linux >= 4.11. | ||||||
|
|
||||||
| .. versionadded:: 3.15 | ||||||
|
|
||||||
|
|
@@ -3830,7 +3834,7 @@ features: | |||||
| flags may be available even when their corresponding members in | ||||||
| :class:`statx_result` are not available. | ||||||
|
|
||||||
| .. availability:: Linux >= 4.11 with glibc >= 2.28. | ||||||
| .. availability:: Linux >= 4.11. | ||||||
|
|
||||||
| .. versionadded:: 3.15 | ||||||
|
|
||||||
|
|
@@ -3840,7 +3844,7 @@ features: | |||||
| up-to-date information even when doing so is expensive (for example, | ||||||
| requiring a round trip to the server for a file on a network filesystem). | ||||||
|
|
||||||
| .. availability:: Linux >= 4.11 with glibc >= 2.28. | ||||||
| .. availability:: Linux >= 4.11. | ||||||
|
|
||||||
| .. versionadded:: 3.15 | ||||||
|
|
||||||
|
|
@@ -3849,7 +3853,7 @@ features: | |||||
| A flag for the :func:`os.statx` function. Requests that the kernel return | ||||||
| cached information if possible. | ||||||
|
|
||||||
| .. availability:: Linux >= 4.11 with glibc >= 2.28. | ||||||
| .. availability:: Linux >= 4.11. | ||||||
|
|
||||||
| .. versionadded:: 3.15 | ||||||
|
|
||||||
|
|
@@ -3861,7 +3865,7 @@ features: | |||||
| In the absence of the other two flags, the kernel will generally return | ||||||
| information as fresh as :func:`os.stat` would return. | ||||||
|
|
||||||
| .. availability:: Linux >= 4.11 with glibc >= 2.28. | ||||||
| .. availability:: Linux >= 4.11. | ||||||
|
|
||||||
| .. versionadded:: 3.15 | ||||||
|
|
||||||
|
|
||||||
2 changes: 2 additions & 0 deletions
2
Misc/NEWS.d/next/Library/2026-10-08-22-52-48.gh-issue-153400.4NsKKN.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| On Linux, :func:`os.statx` falls back to the raw syscall when the libc Python is built against does not provide the | ||
| wrapper function. This makes it possible for this function to be available on interpreters built against a libc older than glibc 2.28. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this say "and build time kernel" like the others below?