[Toybox] getline(), getdelim() and clearenv() compat

Rob Landley rob at landley.net
Fri Mar 16 04:42:23 PDT 2012


On 03/13/2012 05:16 AM, Georgi Chorbadzhiyski wrote:
> Around 03/13/2012 11:03 AM, Georgi Chorbadzhiyski scribbled:
>> Around 03/13/2012 09:59 AM, Georgi Chorbadzhiyski scribbled:
>>> On 13.3.2012 г. 07:10, Rob Landley wrote:
>>>> 0006 if you could investigate why posix-2008 functions don't work on
>>>> macosx that would be nice. It seems like they _should_, I'd like to
>>>> understand why they don't before trying to replace them.
>>>
>>> I'll look into that today.
>>
>> Neither getline(), nor getdelim() exist on Android and OS X. I have
>> checked several free software projects and they all provide compat
>> version of these two functions.
> 
> I have implemented getline(), getdelim() /and clearenv()/ and compile
> them only when needed. With these compat functions toysh and xargs can
> be compiled unchanged on Android and OS X /I have update android and
> osx2 branches @github/.
> 
> I'm testing for __APPLE__ and __ANDROID__ and it seems to work.
> 
> Android will need compat implementation of forkpty() and definitions
> of sethostname(), swapoff() and swapon().

I moved the new code to lib/portability.c and the header stuff to
lib/portability.h.

Thanks,

Rob

 1331898143.0


More information about the Toybox mailing list