lucab / caps-rs

A pure-Rust library to work with Linux capabilities
https://docs.rs/caps
Other
83 stars 20 forks source link

nr: adds syscall constants for mips (32b) #3

Closed bkchr closed 7 years ago

lucab commented 7 years ago

Correct me if wrong, but I seem to understand those constants are for mips32 ABI only. Is the "mips" arch identifier valid for both mips32 and mips64? If so, can we AND the arch width in the conditional?

Also, I'd be happy if you could run the testsuite as root and check that everything is green there.

bkchr commented 7 years ago

Based on the following file https://github.com/rust-lang/rust/blob/master/src/test/run-pass/conditional-compile-arch.rs, I would assume that mips is for 32bit and mips64 for 64bit.

I cross compiled the tests and executed the ambient, bounding and effective tests per hand and all worked :)

lucab commented 7 years ago

Great feedback! Thanks for cross-checking/testing this, and also for the the example. I just have a minor comment on that, otherwise all green.

bkchr commented 7 years ago

Nice find with the cfg conditional! You were right, I was compiling with musl. Hope the changes are now mergable :)

lucab commented 7 years ago

Yup, LGTM. I'll follow up with libc-rs to inquiry about non-musl type as I think the u32 there may just be a bug. Thanks for you contribution!

lucab commented 7 years ago

While at it, do you have by chance an armv7 board nearby and willing to validate https://github.com/lucab/caps-rs/issues/2?

bkchr commented 7 years ago

No sorry, I don't have an armv7 board nearby.