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

Update Rust to use new system calls #665

Open
thaliaarchi opened this issue Feb 17, 2025 · 4 comments
Open

Update Rust to use new system calls #665

thaliaarchi opened this issue Feb 17, 2025 · 4 comments

Comments

@thaliaarchi
Copy link

thaliaarchi commented Feb 17, 2025

Since the last release of hermit-abi, version 0.4.0, a few system calls have been added, including mmap and seek. If a new version of hermit-abi were published to crates.io, then rust-lang/rust could take advantage of those features.

Relevant new features:

(If Rust isn't using every feature introduced before 0.4.0, then there may be more.)

I'd be happy to fix the missing seek on the rust-lang/rust side. (Also, if tell was added to Hermit, then I could add support in Rust in rust-lang/rust#137165 (Use tell for <File as Seek>::stream_position).)

@mkroening
Copy link
Member

mkroening commented Feb 19, 2025

Thanks for bringing these up! :)

I'll coordinate a new hermit-abi release, but maybe lseek should go into the libc crate directly if we are confident about the interface.

mmap is not finalized right now, since it is not POSIX conformant right now. We have to discuss whether we want to stick with the current design or change the system call to be POSIX compatible.

I am not sure how vsock is relevant for std, but confirming the stability and publishing would be a good thing anyway. Then we can expose them via vsock-rs.

There might actually more things missing from std that are present in the kernel. I have been looking into that a bit, but did not do a thorough check yet.

@thaliaarchi
Copy link
Author

maybe lseek should go into the libc crate directly if we are confident about the interface.

I didn't know the libc crate supported Hermit. The soon-to-be-current version of stdio for Hermit is merged with Unix stdio, but uses symbols from hermit_abi instead of libc. It sounds like it would be good to move those and others that are stable over to libc.

@mkroening
Copy link
Member

Yeah, that's the plan in the long run. I think that PR should not be blocked on using things from hermit-abi, though. It's fine to use the upstream definitions from hermit-abi. That's how we used to do it until recently, when we started moving things that we have high confidence in into libc with the long time goal to move to libc for as much as possible.

@thaliaarchi
Copy link
Author

@mkroening Hey, friendly ping! Just a reminder about this, in case you were intending to make a hermit-abi release but had forgotten.

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

No branches or pull requests

2 participants