Skip to content

Commit f02f5a1

Browse files
committed
add env test
1 parent 7083a45 commit f02f5a1

File tree

3 files changed

+3
-28
lines changed

3 files changed

+3
-28
lines changed

ci/ci.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ case $HOST_TARGET in
148148
BASIC="$VERY_BASIC hello hashmap alloc align" # ensures we have the shims for stdout and basic data structures
149149
TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal $BASIC panic/panic concurrency/simple atomic threadname libc-mem libc-misc libc-random libc-time fs env num_cpus
150150
TEST_TARGET=i686-unknown-freebsd run_tests_minimal $BASIC panic/panic concurrency/simple atomic threadname libc-mem libc-misc libc-random libc-time fs env num_cpus
151-
TEST_TARGET=x86_64-unknown-illumos run_tests_minimal $VERY_BASIC hello panic/panic concurrency/simple pthread-sync libc-mem libc-misc libc-random alloc hashmap
152-
TEST_TARGET=x86_64-pc-solaris run_tests_minimal $VERY_BASIC hello panic/panic concurrency/simple pthread-sync libc-mem libc-misc libc-random alloc hashmap
151+
TEST_TARGET=x86_64-unknown-illumos run_tests_minimal $BASIC hello panic/panic concurrency/simple pthread-sync libc-mem libc-misc libc-random env
152+
TEST_TARGET=x86_64-pc-solaris run_tests_minimal $BASIC hello panic/panic concurrency/simple pthread-sync libc-mem libc-misc libc-random env
153153
TEST_TARGET=aarch64-linux-android run_tests_minimal $VERY_BASIC hello panic/panic
154154
TEST_TARGET=wasm32-wasi run_tests_minimal $VERY_BASIC wasm
155155
TEST_TARGET=wasm32-unknown-unknown run_tests_minimal $VERY_BASIC wasm

src/shims/unix/foreign_items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
714714
this.write_int(super::UID, dest)?;
715715
}
716716

717-
"getpwuid_r"
717+
"getpwuid_r" | "__posix_getpwuid_r"
718718
if this.frame_in_std() => {
719719
let [uid, pwd, buf, buflen, result] =
720720
this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;

src/shims/unix/solarish/foreign_items.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use rustc_span::Symbol;
2-
use rustc_target::abi::{Align, Size};
32
use rustc_target::spec::abi::Abi;
43

54
use crate::*;
@@ -19,30 +18,6 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
1918
) -> InterpResult<'tcx, EmulateItemResult> {
2019
let this = self.eval_context_mut();
2120
match link_name.as_str() {
22-
// Allocation
23-
"memalign" => {
24-
let [align, size] =
25-
this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
26-
let align = this.read_target_usize(align)?;
27-
let size = this.read_target_usize(size)?;
28-
29-
// memalign requires the size to be greater than 0, the alignment to be a power of 2
30-
// to be, at least, of word size in which EINVAL is emitted
31-
// and a null pointer is returned.
32-
// https://docs.oracle.com/cd/E88353_01/html/E37843/memalign-3c.html
33-
if !align.is_power_of_two() || align < this.pointer_size().bytes() || size == 0 {
34-
this.set_last_error(this.eval_libc("EINVAL"))?;
35-
this.write_null(dest)?;
36-
} else {
37-
let ptr = this.allocate_ptr(
38-
Size::from_bytes(size),
39-
Align::from_bytes(align).unwrap(),
40-
MiriMemoryKind::C.into(),
41-
)?;
42-
this.write_pointer(ptr, dest)?;
43-
}
44-
}
45-
4621
// Miscellaneous
4722
"___errno" => {
4823
let [] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;

0 commit comments

Comments
 (0)