Skip to content

Commit 076f240

Browse files
author
Alex Zepeda
committed
solarisish: move flock consts to illumos.rs
1 parent cca407c commit 076f240

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

src/unix/solarish/illumos.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ pub const TCP_KEEPCNT: ::c_int = 35;
3333
pub const TCP_KEEPINTVL: ::c_int = 36;
3434
pub const TCP_CONGESTION: ::c_int = 37;
3535

36+
pub const LOCK_SH: ::c_int = 1;
37+
pub const LOCK_EX: ::c_int = 2;
38+
pub const LOCK_NB: ::c_int = 4;
39+
pub const LOCK_UN: ::c_int = 8;
40+
3641
// These constants are correct for 64-bit programs or 32-bit programs that are
3742
// not using large-file mode. If Rust ever supports anything other than 64-bit
3843
// compilation on illumos, this may require adjustment:

src/unix/solarish/mod.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1915,17 +1915,6 @@ pub const SHUT_RD: ::c_int = 0;
19151915
pub const SHUT_WR: ::c_int = 1;
19161916
pub const SHUT_RDWR: ::c_int = 2;
19171917

1918-
// These don't exist on Solaris, but do on OpenSolaris derivatives
1919-
// e.g. https://illumos.org/man/3C/flock
1920-
cfg_if! {
1921-
if #[cfg(not(target_os = "solaris"))] {
1922-
pub const LOCK_SH: ::c_int = 1;
1923-
pub const LOCK_EX: ::c_int = 2;
1924-
pub const LOCK_NB: ::c_int = 4;
1925-
pub const LOCK_UN: ::c_int = 8;
1926-
}
1927-
}
1928-
19291918
pub const F_RDLCK: ::c_short = 1;
19301919
pub const F_WRLCK: ::c_short = 2;
19311920
pub const F_UNLCK: ::c_short = 3;

0 commit comments

Comments
 (0)