We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f29a923 + fbf791b commit b86620aCopy full SHA for b86620a
src/libstd/sys/unix/fs.rs
@@ -703,6 +703,10 @@ impl File {
703
| opts.get_access_mode()?
704
| opts.get_creation_mode()?
705
| (opts.custom_flags as c_int & !libc::O_ACCMODE);
706
+ // The third argument of `open64` is documented to have type `mode_t`. On
707
+ // some platforms (like macOS, where `open64` is actually `open`), `mode_t` is `u16`.
708
+ // However, since this is a variadic function, C integer promotion rules mean that on
709
+ // the ABI level, this still gets passed as `c_int` (aka `u32` on Unix platforms).
710
let fd = cvt_r(|| unsafe { open64(path.as_ptr(), flags, opts.mode as c_int) })?;
711
let fd = FileDesc::new(fd);
712
0 commit comments