Skip to content

feat: add generic ioctl support #1819

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

zyuiop
Copy link

@zyuiop zyuiop commented Jul 7, 2025

This PR adds an ioctl handler to file descriptor objects, such as sockets, and a helper to register any ioctl handler at a particular file system path.

Some Linux-specific crates communicate with the kernel via the use of an ioctl file. Support of ioctls may provide an easy path when porting such libraries to work with hermit, without increasing too much the size of the ABI for too specific features.

@mkroening mkroening self-requested a review July 7, 2025 12:56
@mkroening mkroening self-assigned this Jul 7, 2025
src/fs/ioctl.rs Outdated
Comment on lines 12 to 13
#[derive(Copy, Clone)]
pub struct IoCtlCall(pub u32);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use bitfield-struct for these bitfield types, which is already a transitive dependency.

We should link to the reference header (this one?) in the doc comments of this struct.

@zyuiop zyuiop requested a review from mkroening July 8, 2025 16:15
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 this pull request may close these issues.

2 participants