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 builds and passes tests for me in both Alpine/musl and Debian/glibc.
The
sscanf()
only worked because glibc apparently doesn't implement the C99 standard here. musl tries to match 'exactly 15' when it sees%15c
and thus has trouble much of the time.Is there some need to specify a maximum length for the match? None seemed immediately obvious to me. As I understand it,
/proc/{pid}/stat
won't ever give us acomm
string more than 16 characters long, and we're storing it in a 16 character array, so I'm not entirely why we'd be limiting the length to 15 insscanf()
..?Although I have to admit I don't play in C often so I may well have missed something. If that is the case, could we truncate the string outside of
sscanf()
or definecomm[17]
instead?Similarly, I'm not sure if there's some reason to generally prefer
canonicalize_file_name()
overrealpath()
. All I do know is thatrealpath()
built for me against both musl and glibc.As for
-lobstack
inLIBS
, it's necessary for musl and didn't seem to impair my build against glibc. I was hesitant to add a distro-specific parameter toMakefile.PL
but I didn't see a mechanism elsewhere to do it. Perhaps you prefer not to have this added to Makefile.PL and let those building for musl sort it out themselves before building..?The 10 second sleep is mostly because I just got sick of pressing Ctrl-C at the end of every test. :) I assume the test doesn't really need to sit there and do nothing for 3 hours to confirm things are working..