How to get libcap (Linux capabilities library) for Android?
Asked Answered
D

4

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.

Disrelish answered 30/12, 2010 at 21:34 Comment(1)
In my NDK I cannot find capabilities.h file. Can you specify a path that you use?Callable
E
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.

Erasmo answered 6/1, 2013 at 18:9 Comment(0)
M
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.

Mirthless answered 12/10, 2016 at 13:0 Comment(0)
S
0

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

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

Subway answered 4/8, 2012 at 18:13 Comment(0)
T
-1

Here someone compiled it and described:

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

Trollop answered 25/9, 2012 at 23:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.