Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 9673d8d

Browse files
committed
Fix build on Solaris where is no flock().
1 parent 6e94718 commit 9673d8d

File tree

1 file changed

+8
-3
lines changed
  • src/tools/miri/src/shims/unix

1 file changed

+8
-3
lines changed

src/tools/miri/src/shims/unix/fs.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ impl UnixFileDescription for FileHandle {
178178
op: FlockOp,
179179
) -> InterpResult<'tcx, io::Result<()>> {
180180
assert!(communicate_allowed, "isolation should have prevented even opening a file");
181-
#[cfg(target_family = "unix")]
181+
#[cfg(all(target_family = "unix", not(target_os = "solaris")))]
182182
{
183183
use std::os::fd::AsRawFd;
184184

@@ -260,10 +260,15 @@ impl UnixFileDescription for FileHandle {
260260
interp_ok(res)
261261
}
262262

263-
#[cfg(not(any(target_family = "unix", target_family = "windows")))]
263+
#[cfg(not(any(
264+
all(target_family = "unix", not(target_os = "solaris")),
265+
target_family = "windows"
266+
)))]
264267
{
265268
let _ = op;
266-
compile_error!("flock is supported only on UNIX and Windows hosts");
269+
throw_unsup_format!(
270+
"flock is supported only on UNIX (except Solaris) and Windows hosts"
271+
);
267272
}
268273
}
269274
}

0 commit comments

Comments
 (0)