]> git.lizzy.rs Git - rust.git/commitdiff
assert platform in time shims
authorRalf Jung <post@ralfj.de>
Fri, 20 Mar 2020 14:11:54 +0000 (15:11 +0100)
committerRalf Jung <post@ralfj.de>
Fri, 20 Mar 2020 14:11:54 +0000 (15:11 +0100)
src/shims/time.rs

index c8807dd6ea846bcf46fa904142394fcc8ed6adc8..2d812208fba1117e374674f57943272dd08c7aad 100644 (file)
@@ -21,6 +21,7 @@ fn clock_gettime(
         let this = self.eval_context_mut();
 
         this.check_no_isolation("clock_gettime")?;
+        this.assert_platform("linux");
 
         let clk_id = this.read_scalar(clk_id_op)?.to_i32()?;
         let tp = this.deref_operand(tp_op)?;
@@ -58,6 +59,8 @@ fn gettimeofday(
         let this = self.eval_context_mut();
 
         this.check_no_isolation("gettimeofday")?;
+        this.assert_platform("macos");
+
         // Using tz is obsolete and should always be null
         let tz = this.read_scalar(tz_op)?.not_undef()?;
         if !this.is_null(tz)? {