nix-rust / nix

Rust friendly bindings to *nix APIs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Should O_DIRECTORY be excluded for solarish platforms?

travispaul opened this issue · comments

While tracking down a build error a couple of crates deep I've found that O_DIRECTORY is omitted on nix for solarish systems:

nix/src/fcntl.rs

Lines 99 to 100 in 2c6bbc4

#[cfg(not(solarish))]
O_DIRECTORY;

However, it is defined in fcntl.h

I've [patch]ed my way around the issue for the moment but I'm unsure if this is accidental or there is a good reason for it so opening this issue as not to forget over the holiday.

ping @jclulow, @jasonbking, @hadfl (saw that you folks worked on these changes as part of /pull/1394)

I believe support for O_DIRECTORY was added via illumos bug 9965 in early 2020, and we try not to expose things immediately in Rust programs so that software can continue to build and work on OS bits that are at least a couple of years old; e.g., OmniOS has an LTS release that lasts a few years at a time. I believe it's probably been long enough in this case to expose it now, though.

@jclulow thank you for clarifying, that makes sense.

From your guys' discussion, seems that we should still exclude it from Solarish OSes for now?

I can't speak for Solaris, but it seems reasonable to me to expose it for illumos systems at this point.

This has been resolved in /pull/2275, thanks all!