From f31bb43804fd70452eb8e20f83065aad186f8ec5 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 27 Nov 2018 15:06:08 +0100 Subject: [PATCH] implement some libc hooks needed by libtest --- src/fn_call.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/fn_call.rs b/src/fn_call.rs index 5d41848b643..8909223a31d 100644 --- a/src/fn_call.rs +++ b/src/fn_call.rs @@ -426,6 +426,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a+'mir>: crate::MiriEvalContextExt<'a, let paths = &[ (&["libc", "_SC_PAGESIZE"], Scalar::from_int(4096, dest.layout.size)), (&["libc", "_SC_GETPW_R_SIZE_MAX"], Scalar::from_int(-1, dest.layout.size)), + (&["libc", "_SC_NPROCESSORS_ONLN"], Scalar::from_int(1, dest.layout.size)), ]; let mut result = None; for &(path, path_value) in paths { @@ -452,6 +453,10 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a+'mir>: crate::MiriEvalContextExt<'a, } } + "isatty" => { + self.write_null(dest)?; + } + // Hook pthread calls that go to the thread-local storage memory subsystem "pthread_key_create" => { let key_ptr = this.read_scalar(args[0])?.to_ptr()?;