Skip to content

Commit 5e7bfd5

Browse files
author
Alex Zepeda
committed
fcntl: Solaris doesn't have flock(2)
Solaris hasn't included flock(2) for a long while now, and building this wrapper creates issues with undefined symbols. However, OpenSolaris derivatives like Illumos do include flock(2) so they should not be excluded here.
1 parent f9d3a22 commit 5e7bfd5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
2626
([#2085](https://github.com/nix-rust/nix/pull/2085))
2727
- Added `SO_RTABLE` for OpenBSD and `SO_ACCEPTFILTER` for FreeBSD/NetBSD to `nix::sys::socket::sockopt`.
2828
([#2085](https://github.com/nix-rust/nix/pull/2085))
29+
- Removed `flock` from `::nix::fcntl` on Solaris. ([#2082](https://github.com/nix-rust/nix/pull/2082))
2930

3031
### Changed
3132

src/fcntl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ pub enum FlockArg {
559559
UnlockNonblock,
560560
}
561561

562-
#[cfg(not(target_os = "redox"))]
562+
#[cfg(not(any(target_os = "redox", target_os = "solaris")))]
563563
pub fn flock(fd: RawFd, arg: FlockArg) -> Result<()> {
564564
use self::FlockArg::*;
565565

0 commit comments

Comments
 (0)