33

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.

tomix86
  • 1,336
  • 2
  • 18
  • 29
zer0stimulus
  • 22,306
  • 30
  • 110
  • 141

4 Answers4

1

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.

Edward Falk
  • 9,991
  • 11
  • 77
  • 112
1

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.

scopichmu
  • 135
  • 11
0

Lots of discussion out there on this topic... google around a bit:

http://permalink.gmane.org/gmane.comp.handhelds.android.ndk/4075

While-E
  • 1,527
  • 2
  • 20
  • 37
-1

Here someone compiled it and described:

http://blog.umitproject.org/2011/05/libpcap-for-android.html

bluszcz
  • 4,054
  • 4
  • 33
  • 52