Removal of the 6.x kernel compat code from libc

Peter Wemm peter at wemm.org
Fri Apr 17 17:10:25 UTC 2015


On Friday, April 17, 2015 09:28:24 AM John Baldwin wrote:
> On Friday, April 17, 2015 03:07:43 PM Stefan Esser wrote:
> > Could we get rid of check_utility_compat(3) on that occasion?
> > 
> > It is only used (AFAIK) to select FreeBSD-4 compatible behaviour of
> > expr(1), which can also be selected with option "-e" and env variable
> > COMPAT_EXPR.
> > 
> > I doubt that anybody relies on non-POSIX behaviour that has been
> > deprecated for some 15 years ...
> > 
> > We'll need to preserve a stub function for check_utility_compat(3),
> > I'm afraid, but I think we can remove the environment variable and
> > the actual checking for a sym-link named "/etc/compat-FreeBSD-4-util"
> > at startup of expr. (I bet, nobody even knew that the behaviour of
> > expr could be changed with above sym-link ...)
> > 
> > If there is consensus, I could prepare a patch to remove the check
> > and to update the man-page for expr (just for -CURRENT, no MFC).
> 
> I would not be surprised if Y!BSD depends on this and uses it in 11 FWIW. :)

I'm sorry to say, but yes.  We do actually us this on 10.x and 11.x at work, 
although it's worse than you can imagine.  I just did a quick diff and I see:

==== //depot/vendor/FreeBSD/stable/10/bin/expr/expr.y#2 (text+ko) - 
//depot/yahoo/ybsd_10/src/bin/expr/expr.y#3 (text+ko) ==== content
@@ -270,6 +270,8 @@
        int c;
 
        setlocale(LC_ALL, "");
+       if (getenv("NO_EXPR_COMPAT") == NULL)
+               setenv("EXPR_COMPAT", "1", 1);
        if (getenv("EXPR_COMPAT") != NULL
            || check_utility_compat("expr")) {
                av = argv + 1;

I'm not going to do an annotate to see who did that..  However, we can 
maintain patches locally if needed.

I'm not even sure *why* its there.  I might have removed the code that 
depended on it.  Let me do some research.  With a bit of luck, it might be 
academic for us now.
-- 
Peter Wemm - peter at wemm.org; peter at FreeBSD.org; peter at yahoo-inc.com; KI6FJV
UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20150417/aa95a27b/attachment.sig>


More information about the freebsd-arch mailing list