Skip to content

Commit ac8b1b9

Browse files
committed
add _NSGetEnviron foreign function for macos
1 parent 6eccc80 commit ac8b1b9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/shims/foreign_items/posix/macos.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
4141
let result = this.macos_fstat(args[0], args[1])?;
4242
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
4343
}
44-
44+
// Environment related shims
45+
"_NSGetEnviron" => {
46+
this.write_scalar(this.memory.extra.environ.unwrap().ptr, dest)?;
47+
}
4548
// The only reason this is not in the `posix` module is because the `linux` item has a
4649
// different name.
4750
"opendir$INODE64" => {

0 commit comments

Comments
 (0)