How to get libcap (Linux capabilities library) for Android?-ThrowExceptions

Exception or error:

Are the Linux capabilities ( 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.

How to solve:

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 – This is original libcap (was cloned from with supporting of android ndk build. You can build now, setcap and getcap for android.


Here someone compiled it and described:

Leave a Reply

Your email address will not be published. Required fields are marked *