[PATCH 2/2] Added support for compiling against Android bionic

walter harms wharms at bfs.de
Wed Jun 1 09:59:46 UTC 2011



Am 01.06.2011 10:28, schrieb Dan Fandrich:
> On Tue, May 31, 2011 at 08:42:50AM -0400, Rich Felker wrote:
>> On Mon, May 30, 2011 at 11:14:35PM -0700, Dan Fandrich wrote:
>> Sadly it looks like ttyname might also be missing. It's easily
>> implemented via readlink on /proc/self/fd/%d though, or some ioctl or
>> fstat to get the device/tty number.
> 
> If it's just a stub, and newer versions of Android also provide a
> ttyname_r stub, then I'll just drop that part of the patch.
> 
>>> Is PAGE_SIZE mandated somewhere to be defined in limits.h? I tried
>>> glibc, uclibc, libc5 and OpenWatcom (all on Linux) and none of them
>>> defines it in limits.h.
>>
>> If it's a constant, it's supposed to be defined there. If not, it
>> should not be defined anywhere. Unfortunately some bloatware fans are
>> into this whole "large pages" movement and want it considered
>> variable...
> 
> It does look like Walter Harms' suggestion of using sysconf() is the most
> portable way of getting this value. The attached patch makes that change.
> 
>>> The conditional in networking/interface.c isn't as obvious. I tried removing
>>> the UCLIBC clause altogether and it still compiled fine in uClibc 0.6.29,
>>> so perhaps it dates from an earlier version and could just be removed now.
>>
>> I suspect so. That would be nice...
> 
> I'll remove that as well and see if anyone complains. There are a number
> of other files that conditionally include net/ethernet.h (and usually
> netpacket/packet.h) only on newer glibc versions, so I'll switch
> those to using a macro in platform.h as well.  I'll test that a bit more
> and send an updated Android patch later.
> 

I have no idea how common _sc_pagesize is.
perhaps you should protect that _sc_pagesize like:


#ifndef PAGE_SIZE
#ifndef _sc_pagesize
# error "no way to find your PAGE_SIZE"
#endif

#define PAGE_SIZE { sysconf(_sc_pagesize): }


#endif


you get the idea.

re,
 wh


More information about the busybox mailing list