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

Implement the mmap64 foreign item. #3285

Merged
merged 4 commits into from Feb 11, 2024

Conversation

sunfishcode
Copy link
Member

mmap64 is like mmap but uses a 64-bit integer instead of off_t for the offset parameter.

@sunfishcode sunfishcode force-pushed the sunfishcode/mmap64 branch 2 times, most recently from d5d3e99 to 06bdcfc Compare January 30, 2024 13:49
`mmap64` is like `mmap` but uses a 64-bit integer instead of `off_t` for
the offset parameter.
@saethlin
Copy link
Member

saethlin commented Jan 31, 2024

Can we avoid a copy+paste of all the mmap tests by doing something like test_mmap(libc::mmap); test_mmap(libc::mmap64);? I've had to update those tests and they're already a lot of text.

@RalfJung
Copy link
Member

@rustbot author

@rustbot rustbot added the S-waiting-on-author Status: Waiting for the PR author to address review comments label Feb 10, 2024
`mmap64` is only defined on Linux, so move the implementation
to Linux-specific code.
@@ -217,6 +218,14 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
this.write_null(dest)?;
}

"mmap64" => {
Copy link
Member

Choose a reason for hiding this comment

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

You put this into the category of

// Incomplete shims that we "stub out" just to get pre-main initialization code to work.
// These shims are enabled only when the caller is in the standard library.

That doesn't seem right.

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't notice that comment :-). I've now moved it to "File related shims".

@RalfJung
Copy link
Member

Thanks!
@bors r+

@bors
Copy link
Collaborator

bors commented Feb 11, 2024

📌 Commit d914d5e has been approved by RalfJung

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Feb 11, 2024

⌛ Testing commit d914d5e with merge 36651cb...

@bors
Copy link
Collaborator

bors commented Feb 11, 2024

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing 36651cb to master...

@bors bors merged commit 36651cb into rust-lang:master Feb 11, 2024
8 checks passed
@sunfishcode sunfishcode deleted the sunfishcode/mmap64 branch February 11, 2024 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: Waiting for the PR author to address review comments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants