How can I add a Linux system-level API without recompiling the kernel? - Stack Overflow

时间: 2025-01-06 admin 业界

I'm porting a semaphore API from another platform to Linux. This API is somewhat close to the Posix named semaphore API, but there's just enough difference in behavior to make layering it on top of Posix semaphore calls not viable.

I don't want to require building a custom kernel to use this software, so my tentative plan is to create a new ioctl driver and a small wrapper library that converts the old API calls to call through to the ioctl.

What options are there for adding a new system-level API like this? Is using ioctl viable for this, or is there a better option?