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 @@ -5765,6 +5765,12 @@ fn test_aix(target: &str) {
57655765 // The field 'data' is actually a unnamed union in the AIX header.
57665766 "pollfd_ext" if field. ident ( ) == "data" => true ,
57675767
5768+ // On AIX, <stat.h> declares 'tv_nsec' as 'long', but the
5769+ // underlying system calls return a 32-bit value in both 32-bit
5770+ // and 64-bit modes. In the 'libc' crate it is declared as 'i32'
5771+ // to match the system call. Skip this field.
5772+ "timespec" if field. ident ( ) == "tv_nsec" => true ,
5773+
57685774 _ => false ,
57695775 }
57705776 } ) ;
Original file line number Diff line number Diff line change @@ -263,6 +263,15 @@ s! {
263263 pub tv_nsec: c_int,
264264 }
265265
266+ // On AIX, <stat.h> declares 'tv_nsec' as 'long', but the underlying
267+ // system calls return a 4-byte value in both 32-bit and 64-bit modes.
268+ // It is declared as 'c_int' here to avoid using the other undefined 4
269+ // bytes in the 64-bit mode.
270+ pub struct timespec {
271+ pub tv_sec: time_t,
272+ pub tv_nsec: c_int,
273+ }
274+
266275 pub struct statfs64 {
267276 pub f_version: c_int,
268277 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