Skip to content

Commit 602a3dc

Browse files
committed
Auto merge of rust-lang#2304 - LegNeato:shim-fstat64-mac, r=oli-obk
Support (stat/fstat/lstat)64 on macos "In order to accommodate advanced capabilities of newer file systems, the struct stat, struct statfs, and struct dirent data structures were updated in Mac OSX 10.5." "TRANSITIONAL DESCRIPTION (NOW DEPRECATED) The fstat64, lstat64 and stat64 routines are equivalent to their corresponding non-64-suffixed routine, when 64-bit inodes are in effect. They were added before there was support for the symbol variants, and so are now deprecated. Instead of using these, set the _DARWIN_USE_64_BIT_INODE macro before including header files to force 64-bit inode support. The stat64 structure used by these deprecated routines is the same as the stat structure when 64-bit inodes are in effect (see above)." "HISTORY An lstat() function call appeared in 4.2BSD. The stat64(), fstat64(), and lstat64() system calls first appeared in Mac OS X 10.5 (Leopard) and are now deprecated in favor of the corresponding symbol variants. The fstatat() system call appeared in OS X 10.10"
2 parents d118a94 + a1473ea commit 602a3dc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/shims/unix/macos/foreign_items.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
3333
let result = this.close(result)?;
3434
this.write_scalar(Scalar::from_i32(result), dest)?;
3535
}
36-
"stat" | "stat$INODE64" => {
36+
"stat" | "stat64" | "stat$INODE64" => {
3737
let [path, buf] =
3838
this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
3939
let result = this.macos_stat(path, buf)?;
4040
this.write_scalar(Scalar::from_i32(result), dest)?;
4141
}
42-
"lstat" | "lstat$INODE64" => {
42+
"lstat" | "lstat64" | "lstat$INODE64" => {
4343
let [path, buf] =
4444
this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
4545
let result = this.macos_lstat(path, buf)?;
4646
this.write_scalar(Scalar::from_i32(result), dest)?;
4747
}
48-
"fstat" | "fstat$INODE64" => {
48+
"fstat" | "fstat64" | "fstat$INODE64" => {
4949
let [fd, buf] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
5050
let result = this.macos_fstat(fd, buf)?;
5151
this.write_scalar(Scalar::from_i32(result), dest)?;

0 commit comments

Comments
 (0)