@@ -180,6 +180,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
180180 & [ Os :: Linux , Os :: Android , Os :: MacOs , Os :: Solaris , Os :: Illumos ] ,
181181 link_name,
182182 ) ?;
183+
183184 let [ uname] = this. check_shim_sig (
184185 shim_sig ! ( extern "C" fn ( * mut _) -> i32 ) ,
185186 link_name,
@@ -296,6 +297,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
296297 "flock" => {
297298 // Currently this function does not exist on all Unixes, e.g. on Solaris.
298299 this. check_target_os ( & [ Os :: Linux , Os :: FreeBsd , Os :: MacOs , Os :: Illumos ] , link_name) ?;
300+
299301 let [ fd, op] = this. check_shim_sig (
300302 shim_sig ! ( extern "C" fn ( i32 , i32 ) -> i32 ) ,
301303 link_name,
@@ -495,6 +497,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
495497 & [ Os :: Linux , Os :: FreeBsd , Os :: Solaris , Os :: Illumos , Os :: Android ] ,
496498 link_name,
497499 ) ?;
500+
498501 let [ fd, offset, len] = this. check_shim_sig (
499502 shim_sig ! ( extern "C" fn ( i32 , libc:: off_t, libc:: off_t) -> i32 ) ,
500503 link_name,
@@ -560,6 +563,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
560563 & [ Os :: Linux , Os :: Android , Os :: FreeBsd , Os :: Solaris , Os :: Illumos ] ,
561564 link_name,
562565 ) ?;
566+
563567 let [ pipefd, flags] = this. check_shim_sig (
564568 shim_sig ! ( extern "C" fn ( * mut _, i32 ) -> i32 ) ,
565569 link_name,
@@ -743,6 +747,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
743747 "reallocarray" => {
744748 // Currently this function does not exist on all Unixes, e.g. on macOS.
745749 this. check_target_os ( & [ Os :: Linux , Os :: FreeBsd , Os :: Android ] , link_name) ?;
750+
746751 let [ ptr, nmemb, size] =
747752 this. check_shim_sig_lenient ( abi, CanonAbi :: C , link_name, args) ?;
748753 let ptr = this. read_pointer ( ptr) ?;
@@ -1020,6 +1025,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
10201025 & [ Os :: FreeBsd , Os :: Linux , Os :: Android , Os :: Solaris , Os :: Illumos ] ,
10211026 link_name,
10221027 ) ?;
1028+
10231029 let [ clock_id, flags, req, rem] =
10241030 this. check_shim_sig_lenient ( abi, CanonAbi :: C , link_name, args) ?;
10251031 let result = this. clock_nanosleep ( clock_id, flags, req, rem) ?;
@@ -1028,6 +1034,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
10281034 "sched_getaffinity" => {
10291035 // Currently this function does not exist on all Unixes, e.g. on macOS.
10301036 this. check_target_os ( & [ Os :: Linux , Os :: FreeBsd , Os :: Android ] , link_name) ?;
1037+
10311038 let [ pid, cpusetsize, mask] =
10321039 this. check_shim_sig_lenient ( abi, CanonAbi :: C , link_name, args) ?;
10331040 let pid = this. read_scalar ( pid) ?. to_u32 ( ) ?;
@@ -1072,6 +1079,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
10721079 "sched_setaffinity" => {
10731080 // Currently this function does not exist on all Unixes, e.g. on macOS.
10741081 this. check_target_os ( & [ Os :: Linux , Os :: FreeBsd , Os :: Android ] , link_name) ?;
1082+
10751083 let [ pid, cpusetsize, mask] =
10761084 this. check_shim_sig_lenient ( abi, CanonAbi :: C , link_name, args) ?;
10771085 let pid = this. read_scalar ( pid) ?. to_u32 ( ) ?;
@@ -1140,6 +1148,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
11401148 & [ Os :: Linux , Os :: MacOs , Os :: FreeBsd , Os :: Illumos , Os :: Solaris , Os :: Android ] ,
11411149 link_name,
11421150 ) ?;
1151+
11431152 let [ buf, bufsize] =
11441153 this. check_shim_sig_lenient ( abi, CanonAbi :: C , link_name, args) ?;
11451154 let buf = this. read_pointer ( buf) ?;
@@ -1172,6 +1181,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
11721181 & [ Os :: Linux , Os :: FreeBsd , Os :: Illumos , Os :: Solaris , Os :: Android ] ,
11731182 link_name,
11741183 ) ?;
1184+
11751185 let [ ptr, len, flags] =
11761186 this. check_shim_sig_lenient ( abi, CanonAbi :: C , link_name, args) ?;
11771187 let ptr = this. read_pointer ( ptr) ?;
@@ -1185,6 +1195,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
11851195 // This function is non-standard but exists with the same signature and
11861196 // same behavior (eg never fails) on FreeBSD and Solaris/Illumos.
11871197 this. check_target_os ( & [ Os :: FreeBsd , Os :: Illumos , Os :: Solaris ] , link_name) ?;
1198+
11881199 let [ ptr, len] = this. check_shim_sig_lenient ( abi, CanonAbi :: C , link_name, args) ?;
11891200 let ptr = this. read_pointer ( ptr) ?;
11901201 let len = this. read_target_usize ( len) ?;
@@ -1208,6 +1219,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
12081219 & [ Os :: Linux , Os :: FreeBsd , Os :: Illumos , Os :: Solaris , Os :: Android , Os :: MacOs ] ,
12091220 link_name,
12101221 ) ?;
1222+
12111223 // This function looks and behaves exactly like miri_start_unwind.
12121224 let [ payload] = this. check_shim_sig_lenient ( abi, CanonAbi :: C , link_name, args) ?;
12131225 this. handle_miri_start_unwind ( payload) ?;
0 commit comments