Clone of https://android.googlesource.com/platform/external/libselinux