Another thing I noticed rectifying the Android tree is that the
selinux/Android.mk upstream is empty, but the secondary levels are
present, any reason that hasn't been pushed?

On Wed, Sep 21, 2016 at 2:53 PM, William Roberts
<bill.c.robe...@gmail.com> wrote:
> On Wed, Sep 21, 2016 at 2:48 PM, William Roberts
> <bill.c.robe...@gmail.com> wrote:
>> On Sep 21, 2016 13:16, "Stephen Smalley" <s...@tycho.nsa.gov> wrote:
>>>
>>> On 09/21/2016 04:11 PM, William Roberts wrote:
>>> > On Sep 21, 2016 13:06, "Stephen Smalley" <s...@tycho.nsa.gov
>>> > <mailto:s...@tycho.nsa.gov>> wrote:
>>> >>
>>> >> On 09/21/2016 03:57 PM, Roberts, William C wrote:
>>> >> > Correction, it’s just fgets_unlocked, it appears to support the
>>> >> > others.
>>> >>
>>> >> Seems like a bug in bionic, but we can work around it by:
>>> >> #ifdef ANDROID
>>> >> #define fgets_unlocked(x) fgets(x)
>>> >> #endif
>>> >>
>>> >> in selinux_internal.h or some similar internal header.
>>> >>
>>> >> It avoids unnecessary locking overheads when dealing with FILE
>>> >> descriptors that are only used locally and guaranteed to not be shared
>>> >> by multiple threads.
>>> >
>>> > I know what it does and why, but was it really that necessary?
>>>
>>> The patch came from Red Hat.  Anyway, we use the _unlocked functions
>>> throughout, and the fact that bionic supports all of them except that
>>> one function suggests that we should just use a fix like the above
>>> rather than dropping it.
>>
>> I'm not arguing the fix, just wondering if it was blazingly fast. I didn't
>> find the definition or a define in bionic for fgets_unlocked, but when I set
>> _GNUC define, it seemed to build OK.
>
> That's an incorrect statement, that was only for the host built
> against glibc where
> _GNU_SOURCE needs to be defined. For Android, yes the simplest way is as
> you suggest.
>
>
> --
> Respectfully,
>
> William C Roberts



-- 
Respectfully,

William C Roberts

_______________________________________________
Selinux mailing list
Selinux@tycho.nsa.gov
To unsubscribe, send email to selinux-le...@tycho.nsa.gov.
To get help, send an email containing "help" to selinux-requ...@tycho.nsa.gov.

Reply via email to