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

Add klogctl to linux and android #3777

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

sgasse
Copy link
Contributor

@sgasse sgasse commented Jul 19, 2024

@rustbot
Copy link
Collaborator

rustbot commented Jul 19, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (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

@sgasse
Copy link
Contributor Author

sgasse commented Jul 19, 2024

@rustbot author

@sgasse sgasse force-pushed the sgasse/feature/klog_on_linux_like branch from 3cdb3bd to da65e15 Compare July 22, 2024 07:35
@sgasse sgasse changed the title Add klogctl and KLOG constants on linux_like Add klogctl to linux and android Jul 22, 2024
@sgasse
Copy link
Contributor Author

sgasse commented Jul 22, 2024

Dear reviewer, some notes 🙂

  • klogctl is used in some android native binaries but also exists for linux.
  • The KLOG_* constants are only defined in user space on android.
    • man7 also describes those constants as SYSLOG_ACTION_* for linux, however that does not seem to be the case on every linux machine. CI fails finding them and on my (Ubuntu 20.04), the man page says:
    • The type argument determines the action taken by this function. The list below specifies the values for type. The symbolic names are defined in the kernel source, but are not exported to user space; you will either need to use the numbers, or define the names yourself.

CI seems to be green except for the MacOS runs. I did not touch anything MacOS-related, so I would guess the fails are unrelated.

@sgasse
Copy link
Contributor Author

sgasse commented Jul 22, 2024

@rustbot review

@tgross35
Copy link
Contributor

Could you target main please? Otherwise lgtm, with one nit above.

@rustbot label +stable-nominated
@rustbot author

@rustbot rustbot added stable-nominated This PR should be considered for cherry-pick to libc's stable release branch S-waiting-on-author and removed S-waiting-on-review labels Aug 12, 2024
For android, we also add the `KLOG_*` constants. For linux, they are
defined in source but not exported to user space.
@sgasse sgasse changed the base branch from libc-0.2 to main August 14, 2024 13:42
@bors
Copy link
Contributor

bors commented Aug 14, 2024

☔ The latest upstream changes made this pull request unmergeable. Please resolve the merge conflicts.

@sgasse sgasse force-pushed the sgasse/feature/klog_on_linux_like branch from da65e15 to ece907b Compare August 14, 2024 13:43
@sgasse
Copy link
Contributor Author

sgasse commented Aug 14, 2024

Thank you for the review @tgross35 ! I updated the argument name as suggested in your review. Next I changed the base of the PR to main, rebased locally on upstream/main and pushed it (hopefully not breaking anything and not generating noise due to the base change).

@sgasse
Copy link
Contributor Author

sgasse commented Aug 14, 2024

@rustbot review

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!

@tgross35 tgross35 added this pull request to the merge queue Aug 14, 2024
Merged via the queue into rust-lang:main with commit 1ffe0bd Aug 14, 2024
39 checks passed
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Aug 17, 2024
For android, we also add the `KLOG_*` constants. For linux, they are
defined in source but not exported to user space.

(backport <rust-lang#3777>)
(cherry picked from commit ece907b)
@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 Aug 17, 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.

5 participants