Skip to content

Change libkeyutils-sys to not requite C linking #24

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

Closed
josephlr opened this issue Jun 21, 2019 · 1 comment · Fixed by #43
Closed

Change libkeyutils-sys to not requite C linking #24

josephlr opened this issue Jun 21, 2019 · 1 comment · Fixed by #43

Comments

@josephlr
Copy link
Contributor

The current implementation of libkeyutils-sys requires linking against the C library libkeyutils. However, this seems a bit unnecessary as this library doesn't use any of libkeyutils advanced functionality (and it reimplements all the constants), but only needs the wrappers for the three Linux syscalls:

I would propose the following design change:

  • Don't use libkeyutils
  • Use libc::syscall and std::io::Error::last_os_error to implement type-safe Rust wrappers around the syscalls.
  • These functions would then be safe, and all unsafe code would be limited to the lower-level crate.
  • The errno crate could be removed as a dependancy

This changes would probably justify changing the name from libkeyutils-sys to keyutils-raw.

@mathstuf
Copy link
Owner

I'd be thrilled to do this. However, first I think the test suite should be improved to help ensure that we're not breaking behavior with our implementation. There are some more advanced functionality bits that we're using that are incidental (mainly EOPNOTSUPP holes). Most of the extra code we are using seems to be around supporting older kernels without all of the features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants