codyps / ioctl

Helpers for binding ioctls in Rust
https://docs.rs/ioctl-sys
Apache License 2.0
4 stars 14 forks source link

evdev ioctls on non-x86_64 platforms? #4

Closed remexre closed 7 years ago

remexre commented 7 years ago

I'm trying to write an application that needs access to the evdev ioctls; they're defined only for x86_64 by the ioctls crate. Is it possible to add support for ARM platforms? (specifically the Raspberry Pi's armv7-unknown-linux-gnueabihf platform)

EDIT: I just realized some of the evdev ioctls are present, but a bunch are missing too, e.g. eviocgid

codyps commented 7 years ago

It's certainly possible to add evdev ioctls for other linux architectures, it just hasn't happened yet. I'd be happy to take patches that extend the ioctls we have available.

As an alternative, if desired you could define all the evdev ioctls in another crate, and just depend on the ioctl-sys crate in this repo for it's macros & base definitions.

remexre commented 7 years ago

How does https://github.com/jmesmon/ioctl/compare/master...acmumn:evdev-arm look? I'm not 100% sure how to get the scripts in etc working, so I just copied the ioctls over.

codyps commented 7 years ago

I wouldn't worry too much about the generation script: it isn't really clear that that is a workable direction given how much variation there is in how ioctls actually function.

Are the evdev ioctls the same for all archs? If so, it seems like moving them out of the arch specific includes would be a good idea.

remexre commented 7 years ago

I think they are; at least eviocgid works the same in x86 and arm with no code changes.

codyps commented 7 years ago

Ya, it looks like they are common. In that case, if you'd like to submit a PR adding the evdev ioctls you need as generic linux ones (outside of a specific architecture #[cfg]), I'd be happy to accept it.