Are the Linux capabilities (libcap.so) library available for use with Android? If not, how can I compile it?
I would like to use the capabilities-related API in
sys/capabilities.h, which is included with the NDK. But when I try to call functions like
cap_get_proc(), I get “undefined reference” error.
Lots of discussion out there on this topic… google around a bit:
I would imagine that using this api would go way, way beyond the contract in the Android framework. It might work on some devices, but not on others.
In fact, there’s no guarantee, afaik, that Android even runs under Linux. For example, the new Blackberry devices run Blackberry’s proprietary OS, but still run Android apps.
Finally, the version of Linux that most Android devices run is a highly-stripped-down version. They didn’t include any features that the Android API doesn’t need. If Android doesn’t need libcap, then it’s probably not included.
Perhaps you could tell us exactly what it is you’re trying to do.
Here is the link – https://github.com/scopichmu/libcap-for-Android. This is original libcap (was cloned from https://kernel.googlesource.com/pub/scm/linux/kernel/git/morgan/libcap) with supporting of android ndk build. You can build now libcap.so, setcap and getcap for android.
Here someone compiled it and described: