-
Notifications
You must be signed in to change notification settings - Fork 15
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
Switching Sysno to usize #50
Conversation
src/lib.rs
Outdated
pub use super::syscall::syscall4; | ||
pub use super::syscall::syscall5; | ||
pub use super::syscall::syscall6; | ||
pub use super::syscall::raw_syscall0; |
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.
Small, but important, build error: raw_syscallX
-> syscallX
Changing syscalls::raw::syscallX
to take a usize
instead of Sysno
is also technically a breaking change, so I think I'll release a new major version of the library.
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.
Seems I previously only changed the function names on the x86-64 arch, and this is why its currently the only arch that's correctly building.
I also saw your other comment, so now I've reverted x86-64 instead of changing the other archs (revert the function names on x86-64 to syscall[0-6]
instead of raw_syscall[0-6]
)
Everything looks great except for the build error. Thanks! |
src/syscall/x86_64.rs
Outdated
/// Issues a raw system call with 0 arguments. | ||
/// | ||
/// # Safety | ||
/// | ||
/// Running a system call is inherently unsafe. It is the caller's | ||
/// responsibility to ensure safety. | ||
#[inline] | ||
pub unsafe fn syscall0(n: Sysno) -> usize { | ||
pub unsafe fn raw_syscall0(n: usize) -> usize { |
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.
I don't think these names need to change to raw_*
actually. All architecture-specific syscalls are private (but reexported via syscalls::raw::*
).
Keeping these the same should result in the least amount of breaking change. Likewise, the syscalls::raw::*
names should remain the same and where the only difference is that Sysno
is replaced by usize
.
dc37698
to
ab294c7
Compare
Just amended the previous commits, cargo tests are passing, and a small test crate I have is compiling successfully, hopefully the CI builds this time |
ab294c7
to
17452ed
Compare
Hello, I've come across this project while working through a personal project and saw the request for PR on #46, I figured to do it since I'd already read up on the codebase.
The guidelines were helpful and the codebase currently uses
usize
instead ofSysno
, this is of course in theraw
parts.I've tested the current changes on an x86 machine, and all public apis are functioning correctly.