Skip to content

linux/android: add PROCMAP_QUERY and PAGEMAP_SCAN bindings - #5665

Merged
JohnTitor merged 1 commit into
rust-lang:mainfrom
Nilsen84:add-procmap-query-pagemap-scan
Nov 14, 2026
Merged

JohnTitor merged 1 commit into
rust-lang:mainfrom
Nilsen84:add-procmap-query-pagemap-scan

Conversation

@Nilsen84

@Nilsen84 Nilsen84 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds PROCMAP_QUERY and PAGEMAP_SCAN, their structs and flags for Linux
and Android. Common definitions are shared. PAGE_IS_GUARD and
PAGE_IS_ACCESSED stay Linux-only.

I saw #4573 about removing Linux UAPI bindings from libc. Since additions like #5224 and #5145 have been merged since then, I figured this was worth proposing too. Totally fine to close this if adding more goes against that direction.

Testing:

  • Linux ARM64: ci/run.sh aarch64-unknown-linux-gnu passed using the
    repo's Ubuntu 26.04 Docker setup, including all three feature
    configurations and docs.
  • Android ARM64: tests passed on an emulator using NDK r27.
  • Full style checks passed.

Also tried NDK 30: it hits unrelated SYS_arch_specific_syscall and
_PATH_DEFPATH incompatibilities in the existing tests.

Checklist

  • Relevant tests in libc-test/semver have been updated
  • Commit messages permalink to headers for added or changed API
  • Placeholder or unstable values like *LAST or *MAX have the standard
    doc comment (not applicable)
  • Tested locally (cargo test -p libc-test --target mytarget),
    especially relevant for platforms that may not be checked in CI

@rustbot label +stable-nominated

Add both ioctls, their argument structs and associated flags, sharing
definitions between Linux and Android. Keep PAGE_IS_GUARD and
PAGE_IS_ACCESSED Linux-only because Bionic does not expose them yet.

Add semver entries and test exclusions for older headers.

Sources:
https://github.com/torvalds/linux/blob/3389648819829299517a8d482fda213fd7166a2c/include/uapi/linux/fs.h
https://android.googlesource.com/platform/bionic/+/731631f300090436d7f5df80d50b6275c8c60a93/libc/kernel/uapi/linux/fs.h
@rustbot

rustbot commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in an Android module

cc @maurer

@rustbot rustbot added O-android O-linux O-linux-like S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Oct 25, 2026

@JohnTitor JohnTitor left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JohnTitor
JohnTitor added this pull request to the merge queue Nov 14, 2026
Merged via the queue into rust-lang:main with commit 9529351 Nov 14, 2026
60 checks passed
Comment thread libc-test/build/main.rs Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-android O-linux O-linux-like stable-nominated This PR should be considered for cherry-pick to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants