[illumos-Developer] sed from FreeBSD, REG_STARTEND

Garrett D'Amore garrett at damore.org
Fri Aug 6 07:08:00 PDT 2010


So FreeBSD sed depends on a macro called REG_STARTEND, which allows the 
caller to indicate where in the substring the regular expression should 
be applied.  Legacy Solaris does not support this function.

I had disabled this code and left the macro undefined in the illumos 
libc.  However, it would be extremely simple to add this macro and 
enable the resulting code (which is only about 6 lines if I recall 
properly).

The concerns I had about doing this relate to extending the Solaris 
API.  I would not like to have a situation where applications built on 
illumos did not work on Solaris.  Although sed is the only consumer I 
know of for this particular functionality.

One possible way around this would be to only expose the macro in a 
private header, and only allow other consolidation members (e.g. sed) to 
use it.

Another approach is to simply make sed carry its own copy of the regex code.

So, what are the opinions here (please remember that I'm final arbiter 
for now as I have not yet appointed a developer council, but I want to 
hear any good logical rationales):

a) just expose REG_STARTEND to everyone
b) expose it only to consolidation members
c) don't support it all in libc, and force sed to carry a separate copy

I'm leaning quite strongly towards "b" for now, but this felt like a 
decision that may be "architectural" enough to justify a quick review.

     -- Garrett

On 08/06/10 04:49, Joerg Schilling wrote:
> Roland Mainz<roland.mainz at nrubsig.org>  wrote:
>
>    
>> I've uploaded a first _test_ version of the { /usr/bin/sed,
>> /usr/xpg4/bin/sed, /usr/bin/tr and /usr/bin pax } replacement binaries
>> for i386 to http://www.nrubsig.org/people/gisburn/work/solaris/illumos/posixcore20100701_i386_001.tar.bz2
>>      
> ast-sed has the same bug as the FreeBSD did have last year: incorrect backslash
> 	handling. We cannot replace programs in a way that cause existing scripts
> 	to fail.
>
> ast-tr does not work correctly with "tr '[:upper:]' '[:lower:]'"
> 	ÖÄÜ remain uppercase...
>
> What kind of tests have been applied to these programs?
>
>
> BTW: What is the porting state for tr and sed from FreeBSD?
>
> Jörg
>
>    




More information about the Developer mailing list