Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3776,6 +3776,7 @@ fn test_linux(target: &str) {
"netinet/ip.h",
"netinet/tcp.h",
"netinet/udp.h",
(!musl && (x86_64 || s390x), "netiucv/iucv.h"),
(l4re, "netpacket/packet.h"),
"poll.h",
"pthread.h",
Expand Down
18 changes: 18 additions & 0 deletions src/unix/linux_like/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,24 @@ s! {
}
}

cfg_if! {
if #[cfg(all(
any(target_arch = "x86_64", target_arch = "s390x"),
not(any(target_env = "musl", target_os = "android"))
))] {
s! {
pub struct sockaddr_iucv {
Copy link
Copy Markdown
Contributor

@tgross35 tgross35 Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put this in linux_like/linux/gnu; currently this is available on theoretical emscripten and l4re targets which I think probably doesn't make sense. I think you may also be able to drop the target_arch list too if you do that, and just leave it enabled everywhere.

(test config will need to be updated to match)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll try it under linux/gnu and see if the tests pass. Thanks.

pub siucv_family: crate::sa_family_t,
pub siucv_port: crate::in_port_t,
pub siucv_addr: crate::in_addr_t,
pub siucv_nodeid: [c_char; 8],
pub siucv_user_id: [c_char; 8],
pub siucv_name: [c_char; 8],
Copy link
Copy Markdown
Contributor

@tgross35 tgross35 Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per https://github.com/torvalds/linux/blob/7ca6d1cfec80ebe46cc063f3284c5896c344d9a1/include/net/iucv/af_iucv.h#L46-L50 all except for the first field are reserved. Does common access require using them or could we make them private in case things change?

Copy link
Copy Markdown
Author

@clayton615 clayton615 Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Port and Addr don't do anything as far as I know. Making them private should be fine. NodeID and UserID are used to specify your target z/VM ID to connect to, and Name is the application. However, my basic understanding of the C code is that NodeID is actually unused in the linux implementation, so I don't know if the right thing to do is make it private or leave it public in the hopes that some day it's fixed.

In other words, at least UserID and Name should be public. I'll defer to experience on NodeID.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't know of port and addr to do anything and they have a "reserved" comment, would you mind making them private? It's nice to be on the conservative side here because a private field also makes the struct effectively non-exhaustive so we can add fields in the future (just using #[non_exhaustive] would be great but it has a bug currently). And it's easy enough to undo that if we do need them on the future.

}
}
}
}

cfg_if! {
if #[cfg(not(any(target_os = "emscripten", target_os = "l4re")))] {
s! {
Expand Down