@@ -347,7 +347,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
347
347
Some ( metadata) => metadata,
348
348
None => return Ok ( -1 ) ,
349
349
} ;
350
- stat_write_buf ( this, metadata, buf_op)
350
+ stat_macos_write_buf ( this, metadata, buf_op)
351
351
}
352
352
353
353
fn stat_or_lstat (
@@ -369,7 +369,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
369
369
Some ( metadata) => metadata,
370
370
None => return Ok ( -1 ) ,
371
371
} ;
372
- stat_write_buf ( this, metadata, buf_op)
372
+ stat_macos_write_buf ( this, metadata, buf_op)
373
373
}
374
374
375
375
fn statx (
@@ -427,17 +427,23 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
427
427
this. read_scalar ( dirfd_op) ?. to_machine_isize ( & * this. tcx ) ?. try_into ( ) . map_err ( |e| {
428
428
err_unsup_format ! ( "Failed to convert pointer sized operand to integer: {}" , e)
429
429
} ) ?;
430
- // we only support interpreting `path` as an absolute directory or as a directory relative
431
- // to `dirfd` when the latter is `AT_FDCWD`. The behavior of `statx` with a relative path
432
- // and a directory file descriptor other than `AT_FDCWD` is specified but it cannot be
433
- // tested from `libstd`. If you found this error, please open an issue reporting it.
430
+ // We only support:
431
+ // * interpreting `path` as an absolute directory,
432
+ // * interpreting `path` as a path relative to `dirfd` when the latter is `AT_FDCWD`, or
433
+ // * interpreting `dirfd` as any file descriptor when `path` is empty and AT_EMPTY_PATH is
434
+ // set.
435
+ // The behavior of `statx` with a relative path and a directory file descriptor other than
436
+ // `AT_FDCWD` is specified but it cannot be tested from `libstd`. If you found this error,
437
+ // please open an issue reporting it.
434
438
if !(
435
439
path. is_absolute ( ) ||
436
440
dirfd == this. eval_libc_i32 ( "AT_FDCWD" ) ? ||
437
441
( path. as_os_str ( ) . is_empty ( ) && empty_path_flag)
438
442
) {
439
443
throw_unsup_format ! (
440
- "Using statx with a relative path and a file descriptor different from `AT_FDCWD` is not supported"
444
+ "Using statx is only supported with absolute paths, relative paths with the file \
445
+ descriptor `AT_FDCWD`, and empty paths with the `AT_EMPTY_PATH` flag set and any \
446
+ file descriptor"
441
447
)
442
448
}
443
449
@@ -631,7 +637,7 @@ impl FileMetadata {
631
637
}
632
638
}
633
639
634
- fn stat_write_buf < ' tcx , ' mir > (
640
+ fn stat_macos_write_buf < ' tcx , ' mir > (
635
641
ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
636
642
metadata : FileMetadata ,
637
643
buf_op : OpTy < ' tcx , Tag > ,
0 commit comments