Repository navigation
OpenBSD FFM port: add sysctl FFM bindings and utility - #3334
Conversation
Add OpenBsdLibcFunctions with FFM downcall bindings for: - sysctl(int[] mib, ...) — the int-MIB form (no sysctlbyname on OpenBSD) - getthrid() — returns calling thread's kernel ID - getrlimit() — resource limit queries (RLIMIT_NOFILE = 8) Add OpenBsdSysctlUtilFFM wrapping the raw sysctl binding with convenience methods for int/long/String/struct/buffer results, plus command-line fallbacks matching the JNA version's API. Tests are gated to @EnabledOnOs(OS.OPENBSD) and exercise both the native sysctl calls and the command-line fallbacks.
📝 WalkthroughWalkthroughThis pull request introduces comprehensive OpenBSD support for Java Foreign Function & Memory (FFM) operations. It adds low-level libc bindings for ChangesOpenBSD FFM System Integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3334 +/- ##
============================================
+ Coverage 69.53% 75.82% +6.29%
+ Complexity 2262 76 -2186
============================================
Files 461 461
Lines 17819 17819
Branches 2898 2898
============================================
+ Hits 12390 13511 +1121
+ Misses 3890 2667 -1223
- Partials 1539 1641 +102
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
OpenBsdLibcFunctionswith FFM downcall bindings forsysctl(int[] mib, ...),getthrid(), andgetrlimit()OpenBsdSysctlUtilFFMwrapping the raw sysctl binding with convenience methods for int/long/String/struct/buffer results, plus command-line fallbacks@EnabledOnOs(OS.OPENBSD)covering both native and command-line pathsThis is the low-level foundation for the OpenBSD FFM port — no consumers yet, just the bindings and utilities that later PRs will wire into platform classes.
Key differences from FreeBSD
sysctlbyname— everything goes throughsysctl(int[] mib, ...)getthrid()returns int directly (no out-pointer like FreeBSD'sthr_self)RLIMIT_NOFILE = 8(same as FreeBSD)Test plan
@EnabledOnOs(OS.OPENBSD))Refs #3332
Summary by CodeRabbit
New Features
Tests