Skip to content

Conversation

@FlorianNAdam
Copy link
Contributor

fixes the ui_set_phys ioctl binding in sys.rs and adds a with_phys method to VirtualDeviceBuilder in uinput.rs.
The ioctl for set_phys is regrettably a bit weird. Whilst it expects to receive a pointer to a c string, it doesn't want the length of this string, but rather the size of the pointer itself.
A simple pointer cast is the cleanest workaround for this issue that I know of.
Setting the physical path of a virtual device is a pretty niche application, but can be extremely useful.

Copy link
Collaborator

@jeff-hiner jeff-hiner left a comment

Choose a reason for hiding this comment

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

Good catch. Yeah, probably a good half of the ioctls in Linux are weird in some way for legacy reasons.

Approved!

@jeff-hiner jeff-hiner merged commit 34666c4 into emberian:main Jul 26, 2023
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