Skip to content

adds sockaddr_iucv#5041

Open
clayton615 wants to merge 6 commits intorust-lang:mainfrom
clayton615:main
Open

adds sockaddr_iucv#5041
clayton615 wants to merge 6 commits intorust-lang:mainfrom
clayton615:main

Conversation

@clayton615
Copy link
Copy Markdown

This adds the sockaddr_iucv define in netiucv/iucv. It is primarily used on the s390x platform when linux is running under z/VM, but is present on all the linux systems I've been able to test on.

Description

Adds support for sockaddr_iucv

Sources

https://github.com/torvalds/linux/blob/5619b098e2fbf3a23bf13d91897056a1fe238c6d/include/net/iucv/iucv.h

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot label +stable-nominated

This adds the sockaddr_iucv define in netiucv/iucv.
It is primarily used on the s390x platform when linux is running under
z/VM, but is present on all the linux systems I've been able to test on.
@rustbot rustbot added S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Apr 2, 2026
@clayton615
Copy link
Copy Markdown
Author

I blocked all of 32bit PPC, it's only missing on ppc32le apparently, but since IUCV is only really useful on s390x I think it's fine. Everywhere else, the kernel headers exist, so I don't think it hurts to include it.

@clayton615
Copy link
Copy Markdown
Author

Nevermind, I'm realizing I have no clue how to tell what archs have the header vs which don't. I know I want it on s390x to work, and at least x86 so that rust analyzer won't scream while I'm writing code around it.

@clayton615
Copy link
Copy Markdown
Author

Huzzah, all tests pass and I think I've done this all correctly.
Apologies for the churn, if you're thinking "This guy has no clue what he's doing" you're right, this is my first contribution to any project.
Let me know if I've done anything wrong or need to change something.

Comment on lines +239 to +244
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)

Comment on lines +245 to +250
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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants