This morning I learned that using ioctl() from rust is really really hard! Rust uses macros to dynamically generate ioctl-specific getter/setter functions ... but it assumes that the size in the signature of the ioctl is the same as the size of the data-type to be passed.
-
Show this thread
-
This is often not true. Like the signature size will be sizeof(int [2]) ... because those are the mandatory parameters in the ioctl C struct ... but the datatype will include a variable array. Someone missed a memo.
1 reply 0 retweets 4 likesShow this thread -
Anyway, if you want to learn Rust really deeply and get into the murky parts; set yourself the goal of setting and getting some ioctl()s!
1 reply 0 retweets 9 likesShow this thread -
Replying to @colmmacc
I ran across something similar while doing some rust embedded work. These folks have some nice code: http://bit.ly/2KyHKfe
1 reply 0 retweets 1 like
I ended up going down to libc::ioctl() and manually crafting the signature with request_code_write(). Not too ugly in the end, just a journey to get there!
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.