Skip to content

Commit cf82fdf

Browse files
xingxue-ibmtgross35
authored andcommitted
Fix the types of 'struct stat'/'stat stat64' fields 'st_*tim'.
1 parent e7cf1cc commit cf82fdf

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

libc-test/build.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5659,6 +5659,16 @@ fn test_aix(target: &str) {
56595659
// header does not define a separate standalone union type for it.
56605660
("ld_info", "_file") => true,
56615661

5662+
// On AIX, when _ALL_SOURCE is defined, the types of the following fields
5663+
// differ from those used when _XOPEN_SOURCE is defined. The former uses
5664+
// 'struct st_timespec', while the latter uses 'struct timespec'.
5665+
("stat", "st_atim") => true,
5666+
("stat", "st_mtim") => true,
5667+
("stat", "st_ctim") => true,
5668+
("stat64", "st_atim") => true,
5669+
("stat64", "st_mtim") => true,
5670+
("stat64", "st_ctim") => true,
5671+
56625672
_ => false,
56635673
}
56645674
});

src/unix/aix/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,9 +464,9 @@ s! {
464464
pub st_gid: crate::gid_t,
465465
pub st_rdev: dev_t,
466466
pub st_ssize: c_int,
467-
pub st_atim: st_timespec,
468-
pub st_mtim: st_timespec,
469-
pub st_ctim: st_timespec,
467+
pub st_atim: crate::timespec,
468+
pub st_mtim: crate::timespec,
469+
pub st_ctim: crate::timespec,
470470
pub st_blksize: blksize_t,
471471
pub st_blocks: blkcnt_t,
472472
pub st_vfstype: c_int,

src/unix/aix/powerpc64.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ s! {
6969
pub st_gid: crate::gid_t,
7070
pub st_rdev: crate::dev_t,
7171
pub st_ssize: c_int,
72-
pub st_atim: crate::st_timespec,
73-
pub st_mtim: crate::st_timespec,
74-
pub st_ctim: crate::st_timespec,
72+
pub st_atim: crate::timespec,
73+
pub st_mtim: crate::timespec,
74+
pub st_ctim: crate::timespec,
7575
pub st_blksize: crate::blksize_t,
7676
pub st_blocks: crate::blkcnt_t,
7777
pub st_vfstype: c_int,

0 commit comments

Comments
 (0)