Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hurd: fix definition of utsname struct #3992

Merged
merged 1 commit into from
Oct 20, 2024

Conversation

pinotree
Copy link
Contributor

@pinotree pinotree commented Oct 19, 2024

  • drop the domainname field, as it is not actually used
  • add a private _UTSNAME_LENGTH constant matching the helper libc one, to ease declaring the struct
  • bump the size of the other fields to _UTSNAME_LENGTH

@rustbot
Copy link
Collaborator

rustbot commented Oct 19, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @tgross35 (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@pinotree
Copy link
Contributor Author

@sthibaul this should fix crashes when using this struct (by calling uname()); because of this, I'm nominating this for a backport in libc-0.2, even if "breaking".

@rustbot label stable-nominated

@rustbot rustbot added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Oct 19, 2024
@pinotree
Copy link
Contributor Author

@sthibaul
Copy link
Contributor

agreed!

@tgross35
Copy link
Contributor

Thanks for the sources, agreed that we can backport this (thanks for the ack @sthibaul).

Could you add const _UTSNAME_LENGTH: usize = 1024; and use that to make it a bit more consistent and greppable?

- drop the "domainname" field, as it is not actually used
- add a private "_UTSNAME_LENGTH" constant matching the helper libc one,
  to ease declaring the struct
- bump the size of the other fields to "_UTSNAME_LENGTH"
@pinotree
Copy link
Contributor Author

Could you add const _UTSNAME_LENGTH: usize = 1024; and use that to make it a bit more consistent and greppable?

Makes sense, done so -- thanks for the suggestion!

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@tgross35 tgross35 added this pull request to the merge queue Oct 20, 2024
Merged via the queue into rust-lang:main with commit b76c4bc Oct 20, 2024
41 checks passed
@pinotree pinotree deleted the hurd-fix-utsname branch October 20, 2024 08:30
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Nov 6, 2024
- drop the "domainname" field, as it is not actually used
- add a private "_UTSNAME_LENGTH" constant matching the helper libc one,
  to ease declaring the struct
- bump the size of the other fields to "_UTSNAME_LENGTH"

(backport <rust-lang#3992>)
(cherry picked from commit 158cd30)
@tgross35 tgross35 mentioned this pull request Nov 6, 2024
@tgross35 tgross35 added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review stable-applied This PR has been cherry-picked to libc's stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants