[host][darwin]: fix utmpx database parsing#1990
Merged
shirou merged 1 commit intoshirou:masterfrom Jan 14, 2026
Merged
Conversation
ef8def2 to
66eee5c
Compare
Owner
|
Thank you for your swift PR. This PR changes previously exported types like Utmpx to unexported. This might be a breaking change, but I think it's acceptable since these types were likely not intended to be part of the public API. I don't have a Mac machine, so I cannot verify this PR works correctly, but it looks good to me. @nook24, could you verify this PR solves your issue? |
|
I successfully tested this on an M4 and Intel Mac. My results: macOS 26.2 - arm64 macOS 15.6.1 - Intel Linux (for comparison) This was my testing code: https://github.com/nook24/gopsutil-user-test Thanks for this quick fix! Awesome |
This was referenced Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close #1989
Fixed the parsing logic in
UsersWithContext()to align with the current implementation ofgetutxent(), which uses the compatibility structutmpx32to read the utmpx database file/var/run/utmpx.Since
utmpx32is not available in the system headers, the struct definition must be manually copied from the Darwin Libc source.