File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -5587,6 +5587,12 @@ fn test_aix(target: &str) {
55875587 // The field 'data' is actually a unnamed union in the AIX header.
55885588 "pollfd_ext" if field. ident ( ) == "data" => true ,
55895589
5590+ // On AIX, <stat.h> declares 'tv_nsec' as 'long', but the
5591+ // underlying system calls return a 32-bit value in both 32-bit
5592+ // and 64-bit modes. In the 'libc' crate it is declared as 'i32'
5593+ // to match the system call. Skip this field.
5594+ "timespec" if field. ident ( ) == "tv_nsec" => true ,
5595+
55905596 _ => false ,
55915597 }
55925598 } ) ;
Original file line number Diff line number Diff line change @@ -264,6 +264,15 @@ s! {
264264 pub tv_nsec: c_int,
265265 }
266266
267+ // On AIX, <stat.h> declares 'tv_nsec' as 'long', but the underlying
268+ // system calls return a 4-byte value in both 32-bit and 64-bit modes.
269+ // It is declared as 'c_int' here to avoid using the other undefined 4
270+ // bytes in the 64-bit mode.
271+ pub struct timespec {
272+ pub tv_sec: time_t,
273+ pub tv_nsec: c_int,
274+ }
275+
267276 pub struct statfs64 {
268277 pub f_version: c_int,
269278 pub f_type: c_int,
Original file line number Diff line number Diff line change 6868
6969 // linux x32 compatibility
7070 // See https://sourceware.org/bugzilla/show_bug.cgi?id=16437
71- #[ cfg( not( target_env = "gnu" ) ) ]
71+ #[ cfg( all ( not( target_env = "gnu" ) , not ( target_os = "aix" ) ) ) ]
7272 pub struct timespec {
7373 pub tv_sec: time_t,
7474 #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ]
You can’t perform that action at this time.
0 commit comments