Skip to content
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

std.os: add mincore syscall #15148

Merged
merged 1 commit into from Apr 6, 2023
Merged

Conversation

shadeops
Copy link
Contributor

@shadeops shadeops commented Apr 2, 2023

This PR adds support for the mincore syscall

mincore is available on some UNIX like operating systems and allows a user to determine if a page is resident in memory.

Notes:

  • The mincore function signature in std.os could be made more idiomatic Zig by passing a slice instead of a ptr and len. However this implementation matches what was done for madvise. If we want the more idiomatic approach we can open a separate (breaking) PR which updates the various functions which currently pass both a ptr and len.
  • Only std/c/linux.zig was updated, despite mincore supposedly being available in *bsd and solaris as well. We can update this PR to include them, but I don't have a way of verifying they work.
  • mincore is not part of the POSIX standard.

The mincore syscall is available on some UNIX like operating systems
and allows a user to determine if a page is resident in memory.
@andrewrk andrewrk merged commit 3487514 into ziglang:master Apr 6, 2023
10 checks passed
@andrewrk
Copy link
Member

andrewrk commented Apr 6, 2023

Thanks!

@shadeops shadeops deleted the mincore-syscall branch April 6, 2023 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants