Skip to content

Don't include flock support on Solaris #3310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,11 @@ extern "C" {
)]
pub fn realpath(pathname: *const ::c_char, resolved: *mut ::c_char) -> *mut ::c_char;

pub fn flock(fd: ::c_int, operation: ::c_int) -> ::c_int;
cfg_if! {
if #[cfg(not(target_os = "solaris"))] {
pub fn flock(fd: ::c_int, operation: ::c_int) -> ::c_int;
}
}

#[cfg_attr(target_os = "netbsd", link_name = "__times13")]
pub fn times(buf: *mut ::tms) -> ::clock_t;
Expand Down
5 changes: 5 additions & 0 deletions src/unix/solarish/illumos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ pub const TCP_KEEPCNT: ::c_int = 35;
pub const TCP_KEEPINTVL: ::c_int = 36;
pub const TCP_CONGESTION: ::c_int = 37;

pub const LOCK_SH: ::c_int = 1;
pub const LOCK_EX: ::c_int = 2;
pub const LOCK_NB: ::c_int = 4;
pub const LOCK_UN: ::c_int = 8;

// These constants are correct for 64-bit programs or 32-bit programs that are
// not using large-file mode. If Rust ever supports anything other than 64-bit
// compilation on illumos, this may require adjustment:
Expand Down
5 changes: 0 additions & 5 deletions src/unix/solarish/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1915,11 +1915,6 @@ pub const SHUT_RD: ::c_int = 0;
pub const SHUT_WR: ::c_int = 1;
pub const SHUT_RDWR: ::c_int = 2;

pub const LOCK_SH: ::c_int = 1;
pub const LOCK_EX: ::c_int = 2;
pub const LOCK_NB: ::c_int = 4;
pub const LOCK_UN: ::c_int = 8;

pub const F_RDLCK: ::c_short = 1;
pub const F_WRLCK: ::c_short = 2;
pub const F_UNLCK: ::c_short = 3;
Expand Down