Closed as not planned
Description
O_LARGEFILE
isn't defined in the libc crate on some platforms. For example, this code:
use libc::{O_CREAT, O_LARGEFILE, O_EXCL};
fn main() {
let _ = O_CREAT | O_LARGEFILE | O_EXCL;
}
yields a compiler error on aarch64-apple-darwin, where O_LARGEFILE
doesn't exist.
I ran into this while porting a C library to Rust. Since the C libc doesn't have O_LARGEFILE
on all platforms, the C idiom is:
#ifdef O_LARGEFILE
...
#endif
On targets where the C libc doesn't have a O_LARGEFILE
, would it make sense for Rust libc to provide
const O_LARGEFILE: c_int = 0;
to support apps that need to compile for many platforms? If so, I'm willing to submit a PR to cover the macOS case.