don't feel bad: the Android tree has the same problem --- even bionic itself didn't always get this right :-) we're spotting these now because we're actually trying to use bionic on non-Android Linux too. On Thu, May 11, 2017 at 5:18 PM, William Roberts <bill.c.roberts@xxxxxxxxx> wrote: > On Thursday, May 11, 2017, Tom Cherry via Selinux <selinux@xxxxxxxxxxxxx> > wrote: >> >> This check is not specific to Android devices. If libselinux were used >> with Bionic on a normal Linux system this check would still be needed. >> >> Signed-off-by: Tom Cherry <tomcherry@xxxxxxxxxx> >> --- >> libselinux/src/procattr.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/libselinux/src/procattr.c b/libselinux/src/procattr.c >> index ebc0adec..48dd8aff 100644 >> --- a/libselinux/src/procattr.c >> +++ b/libselinux/src/procattr.c >> @@ -22,8 +22,8 @@ static pthread_key_t destructor_key; >> static int destructor_key_initialized = 0; >> static __thread char destructor_initialized; >> >> -#ifndef __ANDROID__ >> -/* Android declares this in unistd.h and has a definition for it */ >> +#ifndef __BIONIC__ >> +/* Bionic declares this in unistd.h and has a definition for it */ >> static pid_t gettid(void) >> { >> return syscall(__NR_gettid); >> -- >> 2.13.0.rc2.291.g57267f2277-goog > > > > Ack.. thanks for this. There might be other places I used Android when I > should have used bionic > > > > > -- > Respectfully, > > William C Roberts > > -- Elliott Hughes - http://who/enh - http://jessies.org/~enh/ Android native code/tools questions? Mail me/drop by/add me as a reviewer.