pppd: On 32-bit Linux <3.8 force to ioctl() counters.#580
Merged
paulusmack merged 1 commit intoApr 2, 2026
Conversation
paulusmack
reviewed
Apr 1, 2026
Collaborator
paulusmack
left a comment
There was a problem hiding this comment.
Basically looks fine.
| static int (*func)(int, struct pppd_stats*) = NULL; | ||
|
|
||
| if (!func) { | ||
| #if (SIZEOF_UNSIGNED_LONG == 4) |
Collaborator
There was a problem hiding this comment.
I'm curious whether SIZEOF_UNSIGNED_LONG could ever be different from sizeof(unsigned long).
Contributor
Author
There was a problem hiding this comment.
The problem is you can't #if sizeof(T) ... because T isn't a pre-processor construct. Tried this first :).
1d29daf to
13c4c28
Compare
This is to enable detecting wrap-around, and the sysfs overhead serves no purpose since they don't contain 64-bit counters either way. This assumes sizeof(long) is dictated by the word size for all arches, ie, sizeof(long) == 4 for all 32-bit arches, and sizeof(long) == 8 for all 64-bit arches. Closes: ppp-project#578 Signed-off-by: Jaco Kroon <jaco@uls.co.za>
13c4c28 to
ef8facc
Compare
Collaborator
|
Thanks. I edited the description to reflect the fact that the architectural word size is actually irrelevant. |
Contributor
Author
Thank you! |
Member
|
@jkroonza: Thanks for your PR and @paulusmack for merging! |
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.
This is to enable detecting wrap-around, and the sysfs overhead serves no purpose since they don't contain 64-bit counters either way.
This assumes sizeof(long) is dictated by the word size for all arches, ie, sizeof(long) == 4 for all 32-bit arches, and sizeof(long) == 8 for all 64-bit arches.
Closes: #578