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

Change sys module from private to public #33

Open
sboeuf opened this issue Jul 30, 2020 · 9 comments
Open

Change sys module from private to public #33

sboeuf opened this issue Jul 30, 2020 · 9 comments

Comments

@sboeuf
Copy link

sboeuf commented Jul 30, 2020

The sys module defines several constants (syscalls, operations, etc...), and it would be useful from the caller's perspective, to be able to access them.

@quininer
Copy link
Member

The sys mod module is generated using bindgen, and it often breaks API compatibility. so it is unlikely to be made public directly.

But I am willing to put it behind internal feature gate.

@sboeuf
Copy link
Author

sboeuf commented Jul 30, 2020

Yes a feature gate sounds fine to me.
But one question though, how do you expect something like probe.is_supported() to be used? Or even when you want to refer to the syscall since they're not part of libc yet?

@quininer
Copy link
Member

I think probe.is_supported() accepts opcode instead of syscall. so we just need probe.is_supported(Openat2::CODE).

@sboeuf
Copy link
Author

sboeuf commented Jul 30, 2020

Oh yes I missed the CODE defined for each opcode!
The syscall is for another use case I have. Since I want to use seccomp, I need to refer the syscall number, and I would have preferred to rely on the crate rather than having to define it (again) myself.

@quininer
Copy link
Member

I think we can export them in a stable way from sys mod. It is only necessary to ensure that no accidental API breakage occurs.

@quininer
Copy link
Member

We can have a syscall mod and put __NR_io_uring_register and other things in it. but I am not sure if this is necessary, I expect them to enter libc in the future.

Maybe an internal feature gate is enough, because we can expect the syscall API will not be changed.

@sboeuf
Copy link
Author

sboeuf commented Jul 30, 2020

Yes I agree the internal feature gate is maybe the easiest way to go, as we can expect libc will soon expose these syscalls, and so you would remove the internal feature gate once this happens.

@ericonr
Copy link

ericonr commented Jul 20, 2021

The syscalls seem to be in libc already. You probably want to update the libc crate too, since the bindgen definition of the syscall number is wrong for mips and mips64.

@quininer
Copy link
Member

Great, I will switch to the definition of libc.

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 a pull request may close this issue.

3 participants