From 9fd9f597af5fa18d78959f48ecbf7df8f34a26c0 Mon Sep 17 00:00:00 2001 From: Xing Xue Date: Tue, 6 Jan 2026 14:04:55 -0500 Subject: [PATCH] Only test addresses of cmsghdrs that are multiples of the size of cmsghdr. --- libc-test/tests/cmsg.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libc-test/tests/cmsg.rs b/libc-test/tests/cmsg.rs index 2295e78aae1f..f72139e41cc1 100644 --- a/libc-test/tests/cmsg.rs +++ b/libc-test/tests/cmsg.rs @@ -73,6 +73,14 @@ mod t { mhdr.msg_controllen = (160 - trunc) as _; for cmsg_payload_len in 0..64 { + // AIX does not apply any alignment or padding to ancillary + // data and CMSG_ALIGN() is a noop. So only test addresses + // that are multiples of the size of cmsghdr here. + if cfg!(target_os = "aix") && cmsg_payload_len % std::mem::size_of::() != 0 + { + continue; + } + let mut current_cmsghdr_ptr = pcmsghdr; assert!(!current_cmsghdr_ptr.is_null()); let mut count = 0;