Skip to content

Commit 07d2325

Browse files
committed
More OSX debugging info
1 parent 1f63833 commit 07d2325

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/sys/socket/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,12 @@ impl<'a> Iterator for CmsgIterator<'a> {
452452
// Advance the internal pointer. Safe if mhdr and cmsghdr point
453453
// to valid data returned by recvmsg(2)
454454
self.cmsghdr = unsafe {
455+
println!("CMSG_NXRHDR({:?} len={:?})", hdr as *const _, hdr.cmsg_len);
456+
let pad = mem::align_of::<libc::cmsghdr>() - 1;
457+
println!(" pad={:?}", pad);
458+
println!(" next={:x}", hdr as *const _ as usize + hdr.cmsg_len as usize + pad & !pad);
455459
let p = CMSG_NXTHDR(self.mhdr as *const _, hdr as *const _);
456-
println!("Next cmsg @ {:?}", p);
460+
println!(" Next cmsg @ {:?}", p);
457461
p.as_ref()
458462
};
459463
cm

0 commit comments

Comments
 (0)