Regarding:
The cast was added in 8a25eae
which concerns freebsd support without further explanation. According to
the freebsd docs though, the mode argument is supposed to be of type
mode_t as well:
https://www.freebsd.org/cgi/man.cgi?query=openat&apropos=0&sektion=0&manpath=FreeBSD+12.0-RELEASE+and+Ports&arch=default&format=html
If I’m reading the libc source correctly:
src/unix/mod.rs:pub type c_uint = u32;
src/unix/bsd/freebsdlike/mod.rs:pub type mode_t = u16;
src/unix/linux_like/linux/mod.rs:pub type mode_t = u32;
this is a no-op on Linux but a cast of u16 to a u32 on Freebsd.
Does the build actually fail on Freebsd if the cast is omitted? If so, maybe
this should be highlighted by a cfg guard. I don’t have a Freebsd system
at my disposal so I cannot test this myself.
(Sorry for being nitpicky here. I’m currently subjecting the crate to a crev
review so I had to waste some extra attention to the unsafe blocks.)
Regarding:
openat/src/dir.rs
Line 268 in e4660c1
The cast was added in 8a25eae
which concerns freebsd support without further explanation. According to
the freebsd docs though, the mode argument is supposed to be of type
mode_tas well:https://www.freebsd.org/cgi/man.cgi?query=openat&apropos=0&sektion=0&manpath=FreeBSD+12.0-RELEASE+and+Ports&arch=default&format=html
If I’m reading the libc source correctly:
this is a no-op on Linux but a cast of u16 to a u32 on Freebsd.
Does the build actually fail on Freebsd if the cast is omitted? If so, maybe
this should be highlighted by a
cfgguard. I don’t have a Freebsd systemat my disposal so I cannot test this myself.
(Sorry for being nitpicky here. I’m currently subjecting the crate to a crev
review so I had to waste some extra attention to the unsafe blocks.)