about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPetr Sumbera <sumbera@volny.cz>2025-02-04 11:51:08 +0000
committerPetr Sumbera <sumbera@volny.cz>2025-02-05 08:51:45 +0000
commit9673d8d543c5fa8f14b168beed8280b98baf64cf (patch)
treef08a67a60f01a2c822198789214b76eb8337616d /src
parent6e9471811baff6d6928547383f0ba3e0b622f5f8 (diff)
Fix build on Solaris where is no flock().
Diffstat (limited to 'src')
-rw-r--r--src/tools/miri/src/shims/unix/fs.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/tools/miri/src/shims/unix/fs.rs b/src/tools/miri/src/shims/unix/fs.rs
index c7399b00d3f..924dbb88799 100644
--- a/src/tools/miri/src/shims/unix/fs.rs
+++ b/src/tools/miri/src/shims/unix/fs.rs
@@ -178,7 +178,7 @@ impl UnixFileDescription for FileHandle {
         op: FlockOp,
     ) -> InterpResult<'tcx, io::Result<()>> {
         assert!(communicate_allowed, "isolation should have prevented even opening a file");
-        #[cfg(target_family = "unix")]
+        #[cfg(all(target_family = "unix", not(target_os = "solaris")))]
         {
             use std::os::fd::AsRawFd;
 
@@ -260,10 +260,15 @@ impl UnixFileDescription for FileHandle {
             interp_ok(res)
         }
 
-        #[cfg(not(any(target_family = "unix", target_family = "windows")))]
+        #[cfg(not(any(
+            all(target_family = "unix", not(target_os = "solaris")),
+            target_family = "windows"
+        )))]
         {
             let _ = op;
-            compile_error!("flock is supported only on UNIX and Windows hosts");
+            throw_unsup_format!(
+                "flock is supported only on UNIX (except Solaris) and Windows hosts"
+            );
         }
     }
 }