Skip to content

Change libkeyutils-sys to not requite C linking #24

Closed
@josephlr

Description

@josephlr

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions