-
-
Notifications
You must be signed in to change notification settings - Fork 862
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
fix undefined symbol: gettid #2389 #2393
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! Comments inline. Also please add a change log entry.
oshi-core/src/main/java/oshi/software/os/linux/LinuxOperatingSystem.java
Outdated
Show resolved
Hide resolved
oshi-core/src/main/java/oshi/software/os/linux/LinuxOperatingSystem.java
Show resolved
Hide resolved
I played around with some microbenchmarking, with the syscall method vs. resolving the dynamic link of syscall = LinuxLibc.INSTANCE.syscall(code).intValue();
// vs.
proctask = ParseUtil.parseIntOrDefault(Files.readSymbolicLink(link).getFileName().toString(), 0); Not much difference between them, and pretty sure the proc approach is more portable.
|
Another test on an x86 system including the gettid native:
|
oshi-core/src/main/java/oshi/software/os/linux/LinuxOperatingSystem.java
Outdated
Show resolved
Hide resolved
Thanks for your contribution! I made a few tweaks and merged it. Let me know if there are any other changes needed, I'll probably get a release out tomorrow. |
Digging into this again from primary headers and not a summary page, I think this is slightly off.
I'll submit a quick fix for this. |
#2389
gettid
Glibc does not provide a wrapper for this system call; call it using syscall(2).