Hi!

----

<NOTE>Please note the _timeout_ is set to today 12.00AM PDT since we try
to hurry up now and try to catch the build B125</NOTE>

Here comes the final round of code review for the second update of the
ksh93 integration project: I created a webrev based on the 2009-09-25
snapshot of the ksh93-integration prototype022 tree against the OS/Net
Mercurial HEAD version.

The webrev can be found at
http://www.nrubsig.org/people/gisburn/work/solaris/ksh93_integration/ksh93_integration_update2_20090925_webrev/
; the only diffrerence to the previous webrev
(http://cr.opensolaris.org/~gisburn/ksh93_integration_update2_20090922_webrev/)
is the change for http://bugs.grommit.com/show_bug.cgi?id=639 ('Remove
/usr/bin/mkfifo and /usr/bin/tail+/usr/xpg4/bin/tail per C team request'
; patch URL is http://bugs.grommit.com/attachment.cgi?id=342).

I've attached the hg diff from the webrev as
"ksh93_integration_update2_20090925_onnv-gate.hg.patch.txt" for those
who can't reach the webrev...

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
-------------- next part --------------
--- old/usr/src/Makefile.ast    Fri Sep 25 05:23:41 2009
+++ new/usr/src/Makefile.ast    Fri Sep 25 05:23:40 2009
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -39,6 +39,7 @@
        -I$(LIBSHELLBASE)/common/include \
        -I$(ROOT)/usr/include/ast \
        -DKSHELL \
+       -DSHOPT_BGX \
        -DSHOPT_BRACEPAT \
        -DSHOPT_CMDLIB_BLTIN=0 \
        '-DSH_CMDLIB_DIR="/usr/ast/bin"' \
@@ -64,7 +65,7 @@
        -DERROR_CONTEXT_T=Error_context_t \
        '-DUSAGE_LICENSE=\
                "[-author?David Korn <dgk at research.att.com>]"\
-               "[-copyright?Copyright (c) 1982-2008 AT&T Intellectual 
Property]"\
+               "[-copyright?Copyright (c) 1982-2009 AT&T Intellectual 
Property]"\
                "[-license?http://www.opensource.org/licenses/cpl1.0.txt]"\
                "[--catalog?libshell]"'
 
--- old/usr/src/Makefile.lint   Fri Sep 25 05:23:44 2009
+++ new/usr/src/Makefile.lint   Fri Sep 25 05:23:42 2009
@@ -65,7 +65,6 @@
        cmd/chmod \
        cmd/chown \
        cmd/chroot \
-       cmd/cksum \
        cmd/clinfo \
        cmd/cmd-crypto \
        cmd/cmd-inet/lib \
@@ -82,9 +81,7 @@
        cmd/cmd-inet/usr.lib/wanboot \
        cmd/cmd-inet/usr.sadm \
        cmd/cmd-inet/usr.sbin \
-       cmd/cmp \
        cmd/col \
-       cmd/comm \
        cmd/compress \
        cmd/consadm \
        cmd/coreadm \
@@ -95,7 +92,6 @@
        cmd/ctrun \
        cmd/ctstat \
        cmd/ctwatch \
-       cmd/cut \
        cmd/date \
        cmd/dd \
        cmd/deroff \
@@ -172,7 +168,6 @@
        cmd/iscsitsvc \
        cmd/isns \
        cmd/itadm \
-       cmd/join \
        cmd/kbd \
        cmd/killall \
        cmd/last \
@@ -187,7 +182,6 @@
        cmd/logger \
        cmd/login \
        cmd/logins \
-       cmd/logname \
        cmd/ls \
        cmd/luxadm \
        cmd/lvm \
@@ -287,7 +281,6 @@
        cmd/syseventd \
        cmd/syslogd \
        cmd/tabs \
-       cmd/tee \
        cmd/th_tools \
        cmd/tip \
        cmd/touch \
@@ -302,7 +295,6 @@
        cmd/vt \
        cmd/wall \
        cmd/wbem \
-       cmd/wc \
        cmd/who \
        cmd/whodo \
        cmd/wracct \
--- old/usr/src/cmd/Makefile    Fri Sep 25 05:23:46 2009
+++ new/usr/src/cmd/Makefile    Fri Sep 25 05:23:44 2009
@@ -88,14 +88,11 @@
        chmod           \
        chown           \
        chroot          \
-       cksum           \
        clear           \
        clinfo          \
        cmd-crypto      \
        cmd-inet        \
-       cmp             \
        col             \
-       comm            \
        compress        \
        consadm         \
        coreadm         \
@@ -108,7 +105,6 @@
        ctrun           \
        ctstat          \
        ctwatch         \
-       cut             \
        datadm          \
        date            \
        dc              \
@@ -218,7 +214,6 @@
        isns            \
        itadm           \
        java            \
-       join            \
        kbd             \
        keyserv         \
        killall         \
@@ -243,7 +238,6 @@
        logger          \
        login           \
        logins          \
-       logname         \
        look            \
        ls              \
        luxadm          \
@@ -293,7 +287,6 @@
        pagesize        \
        passmgmt        \
        passwd          \
-       paste           \
        pathchk         \
        pbind           \
        pcidr           \
@@ -401,7 +394,6 @@
        tbl             \
        tcopy           \
        tcpd            \
-       tee             \
        terminfo        \
        th_tools        \
        tic             \
@@ -421,7 +413,6 @@
        uadmin          \
        ul              \
        uname           \
-       uniq            \
        units           \
        unlink          \
        unpack          \
@@ -438,7 +429,6 @@
        w               \
        wall            \
        wbem            \
-       wc              \
        which           \
        who             \
        whodo           \
@@ -544,12 +534,9 @@
        chgrp           \
        chmod           \
        chown           \
-       cksum           \
        cmd-crypto      \
        cmd-inet        \
-       cmp             \
        col             \
-       comm            \
        compress        \
        consadm         \
        coreadm         \
@@ -561,7 +548,6 @@
        ctrun           \
        ctstat          \
        ctwatch         \
-       cut             \
        datadm          \
        date            \
        dc              \
@@ -612,7 +598,6 @@
        iscsid          \
        isns            \
        itadm           \
-       join            \
        kbd             \
        krb5            \
        ksh             \
@@ -626,7 +611,6 @@
        logadm          \
        logger          \
        logins          \
-       logname         \
        ls              \
        luxadm          \
        lvm             \
@@ -650,7 +634,6 @@
        pack            \
        passwd          \
        passmgmt        \
-       paste           \
        pathchk         \
        pfexec          \
        pg              \
@@ -710,7 +693,6 @@
        tabs            \
        tar             \
        tbl             \
-       tee             \
        time            \
        tnf             \
        touch           \
@@ -721,7 +703,6 @@
        ttymon          \
        ul              \
        uname           \
-       uniq            \
        units           \
        unlink          \
        unpack          \
@@ -732,7 +713,6 @@
        volrmmount      \
        w               \
        wbem            \
-       wc              \
        who             \
        whodo           \
        wracct          \
--- old/usr/src/cmd/ast/msgcc/Makefile  Fri Sep 25 05:23:49 2009
+++ new/usr/src/cmd/ast/msgcc/Makefile  Fri Sep 25 05:23:47 2009
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -39,7 +39,7 @@
        -D_PACKAGE_ast \
        '-DUSAGE_LICENSE=\
                "[-author?Glenn Fowler <gsf at research.att.com>]"\
-               "[-copyright?Copyright (c) 1986-2008 AT&T Intellectual 
Property]"\
+               "[-copyright?Copyright (c) 1986-2009 AT&T Intellectual 
Property]"\
                "[-license?http://www.opensource.org/licenses/cpl1.0.txt]"\
                "[--catalog?msgcc]"'
 
--- old/usr/src/cmd/ast/msgcc/msgcc.sh  Fri Sep 25 05:23:51 2009
+++ new/usr/src/cmd/ast/msgcc/msgcc.sh  Fri Sep 25 05:23:49 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 2000-2008 AT&T Intellectual Property          #
+#          Copyright (c) 2000-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
--- old/usr/src/cmd/ast/msgcc/msgcpp.c  Fri Sep 25 05:23:53 2009
+++ new/usr/src/cmd/ast/msgcc/msgcpp.c  Fri Sep 25 05:23:52 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 2000-2008 AT&T Intellectual Property          *
+*          Copyright (c) 2000-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/cmd/ast/msgcc/msgcvt.c  Fri Sep 25 05:23:56 2009
+++ new/usr/src/cmd/ast/msgcc/msgcvt.c  Fri Sep 25 05:23:54 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 2000-2008 AT&T Intellectual Property          *
+*          Copyright (c) 2000-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/cmd/ast/msgcc/msggen.c  Fri Sep 25 05:23:58 2009
+++ new/usr/src/cmd/ast/msgcc/msggen.c  Fri Sep 25 05:23:56 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 2000-2008 AT&T Intellectual Property          *
+*          Copyright (c) 2000-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/cmd/ast/msgcc/msgget.c  Fri Sep 25 05:24:00 2009
+++ new/usr/src/cmd/ast/msgcc/msgget.c  Fri Sep 25 05:23:59 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 2000-2008 AT&T Intellectual Property          *
+*          Copyright (c) 2000-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/cmd/cksum/Makefile      Fri Sep 25 05:24:03 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,47 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-#ident "%Z%%M% %I%     %E% SMI"
-#
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# cmd/cksum/Makefile
-
-PROG= cksum
-
-include ../Makefile.cmd
-
-CFLAGS += $(CCVERBOSE)
-CPPFLAGS += -D_FILE_OFFSET_BITS=64
-
-.KEEP_STATE:
-
-all: $(PROG)
-
-install: all $(ROOTPROG)
-
-clean:
-
-lint:  lint_PROG
-
-include ../Makefile.targ
--- old/usr/src/cmd/cksum/cksum.c       Fri Sep 25 05:24:05 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,262 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident  "%Z%%M% %I%     %E% SMI"
-
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <locale.h>
-#include <libgen.h>
-
-#define        NBUF    4096            /* Read this much at a time */
-#define        BSIZE   512             /* Bytes per block */
-
-typedef        unsigned long   CRC;    /* 32 bit (at least) crc size */
-
-static uchar_t buf[NBUF];      /* Input buffer */
-static uchar_t tflag;          /* More than one input file */
-static uchar_t many;
-static CRC     filecrc;        /* CRC for this file */
-static CRC     totcrc;         /* Total of all files */
-static long long totbytes;     /* Total bytes read */
-static ulong_t bsize = 1;      /* block size */
-
-static int     sum(const char *fn);
-static int     usage(void);
-static CRC     docrcposix(CRC crcval, uchar_t *bp, ulong_t n);
-static CRC     postprocess(CRC S, long long n);
-
-static CRC     (*crcfunc)(CRC crcval, uchar_t *bp, ulong_t n) = docrcposix;
-static void    m_crcposix(ulong_t *, const uchar_t *, size_t);
-
-/*
- * Mainline for cksum.
- */
-int
-main(int argc, char *argv[])
-{
-       int     c;
-       int     exstat = 0;
-
-       (void) setlocale(LC_ALL, "");
-
-#if !defined(TEXT_DOMAIN)
-#define        TEXT_DOMAIN     "SYS_TEST"
-#endif
-       (void) textdomain(TEXT_DOMAIN);
-
-       tflag = many = 0;
-       totbytes = totcrc = 0;
-       while ((c = getopt(argc, argv, "")) != -1) {
-               switch (c) {
-               case 't':               /* this is non-functional for now */
-                       tflag++;
-                       break;
-               default:
-                       return (usage());
-               }
-       }
-
-       /* Sum from standard input? */
-       if ((many = optind < argc) == 0)
-               return (sum(NULL));
-
-       /* Sum each file argument. */
-       for (; optind < argc; ++optind)
-               exstat |= sum(argv[optind]);
-
-       if (tflag) {
-               (void) printf("%lu", postprocess(totcrc, totbytes));
-               (void) printf(gettext("\t%lld\t   Total\n"),
-                       (long long)((totbytes + bsize - 1) / bsize));
-       }
-       return (exstat);
-}
-
-/*
- * Compute checksum for one file.
- */
-static int
-sum(const char *fn)
-{
-       int     n;
-       int     fd;
-       long long bytes = 0;
-
-       if (fn == NULL || (fn[0] == '-' && fn[1] == '\0'))
-               fd = 0;
-       else if ((fd = open(fn, O_RDONLY)) < 0) {
-               (void) fprintf(stderr, gettext("cksum: input file \"%s\": "),
-                       fn);
-               perror("");
-               return (1);
-       }
-       filecrc = 0;
-       while ((n = read(fd, (char *)buf, sizeof (buf))) > 0) {
-               bytes += n;
-               filecrc = (*crcfunc) (filecrc, buf, n);
-               if (tflag)
-                       totcrc = (*crcfunc) (totcrc, buf, n);
-       }
-       (void) close(fd);
-       totbytes += bytes;
-       (void) printf("%lu", postprocess(filecrc, bytes));
-       (void) printf("\t%lld", (long long)((bytes + bsize - 1) / bsize));
-       if (many) {
-               (void) printf("\t%s", (fn[0] == '-' && fn[1] == '\0') ?
-                       gettext("[standard input]") : fn);
-       }
-       if (n < 0)
-               (void) fputs(gettext(" [read error]"), stdout);
-       (void) putchar('\n');
-       return (n == 0 ? 0 : 1);
-}
-
-
-/*
- * Do CRC-POSIX function by calling a library entry point that has a
- * slightly different calling sequence.
- */
-static CRC
-docrcposix(CRC crcval, uchar_t *bp, ulong_t n)
-{
-       m_crcposix(&crcval, bp, n);
-       return (crcval);
-}
-
-/*
- * Sum algorithms require various kinds of post-processing.
- * The 'S' and 'R' variables are from the POSIX.2 (Draft 8?) description
- * of the "sum" utility.
- * This code makes no assumption about word size except that a
- * "CRC" type holds at least 32 bits.
- */
-static CRC
-postprocess(CRC S, long long n)
-{
-       /*
-        * POSIX tacks on significant bytes of the length so that
-        * different length sequences of '\0' have different sums;
-        * then it complements sum.
-        */
-       uchar_t char_n[sizeof (n)];
-       ulong_t i;
-
-       for (i = 0; n != 0; n >>= 8, ++i)
-               char_n[i] = n & 0xFF;
-       return (~docrcposix(S, char_n, i));
-}
-
-/*
- * usage message for cksum
- */
-static int
-usage()
-{
-       (void) fprintf(stderr, gettext("Usage: cksum [file ...]\n"));
-       return (2);
-}
-
-/*
- * crcposix -- compute posix.2 compatable 32 bit CRC
- *
- * The POSIX.2 (draft 10) CRC algorithm.
- * This is a 32 bit CRC with polynomial
- *     x**32 + x**26 + x**23 + x**22 + x**16 + x**12 + x**11 + x**10 +
- *     x**8 + x**7 + x**5 + x**4 + x**2 + x**1 + x**0
- */
-
-/* layout is from the POSIX.2 Rationale */
-static ulong_t crctab_posix[256] = {
-       0x00000000,
-       0x04C11DB7, 0x09823B6E, 0x0D4326D9, 0x130476DC, 0x17C56B6B,
-       0x1A864DB2, 0x1E475005, 0x2608EDB8, 0x22C9F00F, 0x2F8AD6D6,
-       0x2B4BCB61, 0x350C9B64, 0x31CD86D3, 0x3C8EA00A, 0x384FBDBD,
-       0x4C11DB70, 0x48D0C6C7, 0x4593E01E, 0x4152FDA9, 0x5F15ADAC,
-       0x5BD4B01B, 0x569796C2, 0x52568B75, 0x6A1936C8, 0x6ED82B7F,
-       0x639B0DA6, 0x675A1011, 0x791D4014, 0x7DDC5DA3, 0x709F7B7A,
-       0x745E66CD, 0x9823B6E0, 0x9CE2AB57, 0x91A18D8E, 0x95609039,
-       0x8B27C03C, 0x8FE6DD8B, 0x82A5FB52, 0x8664E6E5, 0xBE2B5B58,
-       0xBAEA46EF, 0xB7A96036, 0xB3687D81, 0xAD2F2D84, 0xA9EE3033,
-       0xA4AD16EA, 0xA06C0B5D, 0xD4326D90, 0xD0F37027, 0xDDB056FE,
-       0xD9714B49, 0xC7361B4C, 0xC3F706FB, 0xCEB42022, 0xCA753D95,
-       0xF23A8028, 0xF6FB9D9F, 0xFBB8BB46, 0xFF79A6F1, 0xE13EF6F4,
-       0xE5FFEB43, 0xE8BCCD9A, 0xEC7DD02D, 0x34867077, 0x30476DC0,
-       0x3D044B19, 0x39C556AE, 0x278206AB, 0x23431B1C, 0x2E003DC5,
-       0x2AC12072, 0x128E9DCF, 0x164F8078, 0x1B0CA6A1, 0x1FCDBB16,
-       0x018AEB13, 0x054BF6A4, 0x0808D07D, 0x0CC9CDCA, 0x7897AB07,
-       0x7C56B6B0, 0x71159069, 0x75D48DDE, 0x6B93DDDB, 0x6F52C06C,
-       0x6211E6B5, 0x66D0FB02, 0x5E9F46BF, 0x5A5E5B08, 0x571D7DD1,
-       0x53DC6066, 0x4D9B3063, 0x495A2DD4, 0x44190B0D, 0x40D816BA,
-       0xACA5C697, 0xA864DB20, 0xA527FDF9, 0xA1E6E04E, 0xBFA1B04B,
-       0xBB60ADFC, 0xB6238B25, 0xB2E29692, 0x8AAD2B2F, 0x8E6C3698,
-       0x832F1041, 0x87EE0DF6, 0x99A95DF3, 0x9D684044, 0x902B669D,
-       0x94EA7B2A, 0xE0B41DE7, 0xE4750050, 0xE9362689, 0xEDF73B3E,
-       0xF3B06B3B, 0xF771768C, 0xFA325055, 0xFEF34DE2, 0xC6BCF05F,
-       0xC27DEDE8, 0xCF3ECB31, 0xCBFFD686, 0xD5B88683, 0xD1799B34,
-       0xDC3ABDED, 0xD8FBA05A, 0x690CE0EE, 0x6DCDFD59, 0x608EDB80,
-       0x644FC637, 0x7A089632, 0x7EC98B85, 0x738AAD5C, 0x774BB0EB,
-       0x4F040D56, 0x4BC510E1, 0x46863638, 0x42472B8F, 0x5C007B8A,
-       0x58C1663D, 0x558240E4, 0x51435D53, 0x251D3B9E, 0x21DC2629,
-       0x2C9F00F0, 0x285E1D47, 0x36194D42, 0x32D850F5, 0x3F9B762C,
-       0x3B5A6B9B, 0x0315D626, 0x07D4CB91, 0x0A97ED48, 0x0E56F0FF,
-       0x1011A0FA, 0x14D0BD4D, 0x19939B94, 0x1D528623, 0xF12F560E,
-       0xF5EE4BB9, 0xF8AD6D60, 0xFC6C70D7, 0xE22B20D2, 0xE6EA3D65,
-       0xEBA91BBC, 0xEF68060B, 0xD727BBB6, 0xD3E6A601, 0xDEA580D8,
-       0xDA649D6F, 0xC423CD6A, 0xC0E2D0DD, 0xCDA1F604, 0xC960EBB3,
-       0xBD3E8D7E, 0xB9FF90C9, 0xB4BCB610, 0xB07DABA7, 0xAE3AFBA2,
-       0xAAFBE615, 0xA7B8C0CC, 0xA379DD7B, 0x9B3660C6, 0x9FF77D71,
-       0x92B45BA8, 0x9675461F, 0x8832161A, 0x8CF30BAD, 0x81B02D74,
-       0x857130C3, 0x5D8A9099, 0x594B8D2E, 0x5408ABF7, 0x50C9B640,
-       0x4E8EE645, 0x4A4FFBF2, 0x470CDD2B, 0x43CDC09C, 0x7B827D21,
-       0x7F436096, 0x7200464F, 0x76C15BF8, 0x68860BFD, 0x6C47164A,
-       0x61043093, 0x65C52D24, 0x119B4BE9, 0x155A565E, 0x18197087,
-       0x1CD86D30, 0x029F3D35, 0x065E2082, 0x0B1D065B, 0x0FDC1BEC,
-       0x3793A651, 0x3352BBE6, 0x3E119D3F, 0x3AD08088, 0x2497D08D,
-       0x2056CD3A, 0x2D15EBE3, 0x29D4F654, 0xC5A92679, 0xC1683BCE,
-       0xCC2B1D17, 0xC8EA00A0, 0xD6AD50A5, 0xD26C4D12, 0xDF2F6BCB,
-       0xDBEE767C, 0xE3A1CBC1, 0xE760D676, 0xEA23F0AF, 0xEEE2ED18,
-       0xF0A5BD1D, 0xF464A0AA, 0xF9278673, 0xFDE69BC4, 0x89B8FD09,
-       0x8D79E0BE, 0x803AC667, 0x84FBDBD0, 0x9ABC8BD5, 0x9E7D9662,
-       0x933EB0BB, 0x97FFAD0C, 0xAFB010B1, 0xAB710D06, 0xA6322BDF,
-       0xA2F33668, 0xBCB4666D, 0xB8757BDA, 0xB5365D03, 0xB1F740B4
-};
-
-/*
- * crcposix -- compute posix.2 compatible 32 bit CRC
- */
-void
-m_crcposix(crcp, bp, n)
-ulong_t *crcp;
-const uchar_t *bp;
-size_t n;
-{
-       while (n-- > 0)
-           *crcp = (*crcp<<8) ^ crctab_posix[(uchar_t)((*crcp>>24)^*bp++)];
-}
--- old/usr/src/cmd/cmp/Makefile        Fri Sep 25 05:24:07 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,45 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-#ident "%Z%%M% %I%     %E% SMI"
-#
-# Copyright (c) 1989, 1996 by Sun Microsystems, Inc.
-# All rights reserved.
-#
-
-PROG= cmp
-
-include ../Makefile.cmd
-
-CPPFLAGS += -D_FILE_OFFSET_BITS=64
-
-.KEEP_STATE:
-
-all: $(PROG) 
-
-install: all $(ROOTPROG)
-
-clean:
-
-lint:  lint_PROG
-
-include ../Makefile.targ
--- old/usr/src/cmd/cmp/cmp.c   Fri Sep 25 05:24:09 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,194 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/* Portions Copyright 2006 Stephen P. Potter */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*     Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/*       All Rights Reserved   */
-
-#pragma ident  "%Z%%M% %I%     %E% SMI"
-
-/*
- *     compare two files
- */
-
-#include       <stdio.h>
-#include       <stdlib.h>
-#include       <ctype.h>
-#include       <locale.h>
-#include       <sys/types.h>
-
-FILE   *file1, *file2;
-
-char   *arg;
-
-int    eflg;
-int    lflg = 1;
-
-offset_t       line = 1;
-offset_t       chr = 0;
-offset_t       skip1;
-offset_t       skip2;
-
-offset_t       otoi(char *);
-
-static void narg(void);
-static void barg(void);
-static void earg(void);
-
-int
-main(int argc, char **argv)
-{
-       int             c;
-       int             c1, c2;
-
-       (void) setlocale(LC_ALL, "");
-#if !defined(TEXT_DOMAIN)      /* Should be defined by cc -D */
-#define        TEXT_DOMAIN "SYS_TEST"  /* Use this only if it weren't */
-#endif
-       (void) textdomain(TEXT_DOMAIN);
-
-       while ((c = getopt(argc, argv, "ls")) != EOF)
-               switch (c) {
-                       case 'l':
-                               lflg = 2;
-                               break;
-                       case 's':
-                               lflg = 0;
-                               break;
-                       case '?':
-                       default:
-                               narg();
-               }
-       argv += optind;
-       argc -= optind;
-       if (argc < 2 || argc > 4)
-               narg();
-
-       arg = argv[0];
-       if (arg[0] == '-' && arg[1] == 0)
-               file1 = stdin;
-       else if ((file1 = fopen(arg, "r")) == NULL)
-               barg();
-
-       arg = argv[1];
-       if (arg[0] == '-' && arg[1] == 0)
-               file2 = stdin;
-       else if ((file2 = fopen(arg, "r")) == NULL)
-               barg();
-
-       if (file1 == stdin && file2 == stdin)
-               narg();
-
-       if (argc > 2)
-               skip1 = otoi(argv[2]);
-       if (argc > 3)
-               skip2 = otoi(argv[3]);
-       while (skip1) {
-               if ((c1 = getc(file1)) == EOF) {
-                       arg = argv[0];
-                       earg();
-               }
-               skip1--;
-       }
-       while (skip2) {
-               if ((c2 = getc(file2)) == EOF) {
-                       arg = argv[1];
-                       earg();
-               }
-               skip2--;
-       }
-
-       for (;;) {
-               chr++;
-               c1 = getc(file1);
-               c2 = getc(file2);
-               if (c1 == c2) {
-                       if (c1 == '\n')
-                               line++;
-                       if (c1 == EOF) {
-                               if (eflg)
-                                       return (1);
-                               return (0);
-                       }
-                       continue;
-               }
-               if (lflg == 0)
-                       return (1);
-               if (c1 == EOF) {
-                       arg = argv[0];
-                       earg();
-               }
-               if (c2 == EOF)
-                       earg();
-               if (lflg == 1) {
-                       (void) printf(
-                           gettext("%s %s differ: char %lld, line %lld\n"),
-                           argv[0], arg, chr, line);
-                       return (1);
-               }
-               eflg = 1;
-               (void) printf("%6lld %3o %3o\n", chr, c1, c2);
-       }
-}
-
-offset_t
-otoi(s)
-char *s;
-{
-       offset_t v;
-       int base;
-
-       v = 0;
-       base = 10;
-       if (*s == '0')
-               base = 8;
-       while (isdigit(*s))
-               v = v*base + *s++ - '0';
-       return (v);
-}
-
-static void
-narg()
-{
-       (void) fprintf(stderr,
-           gettext("usage: cmp [-l | -s] file1 file2 [skip1] [skip2]\n"));
-       exit(2);
-}
-
-static void
-barg()
-{
-       if (lflg)
-               (void) fprintf(stderr, gettext("cmp: cannot open %s\n"), arg);
-       exit(2);
-}
-
-static void
-earg()
-{
-       (void) fprintf(stderr, gettext("cmp: EOF on %s\n"), arg);
-       exit(1);
-}
--- old/usr/src/cmd/comm/Makefile       Fri Sep 25 05:24:11 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,45 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-#ident "%Z%%M% %I%     %E% SMI"
-#
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-PROG= comm
-
-include ../Makefile.cmd
-
-CFLAGS += $(CCVERBOSE)
-
-.KEEP_STATE:
-
-all: $(PROG) 
-
-install: all $(ROOTPROG)
-
-clean:
-
-lint:  lint_PROG
-
-include ../Makefile.targ
--- old/usr/src/cmd/comm/comm.c Fri Sep 25 05:24:13 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,256 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*     Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/*       All Rights Reserved   */
-
-
-#pragma ident  "%Z%%M% %I%     %E% SMI"
-
-/*
- *     process common lines of two files
- */
-
-#include       <locale.h>
-#include       <stdio.h>
-#include       <stdlib.h>
-#include       <string.h>
-
-static int compare(char *, char *);
-static int rd(FILE *, char *);
-static FILE *openfil(char *);
-static void copy(FILE *, char *, int);
-static void usage(void);
-static void wr(char *, int);
-
-#define        LB      2050    /* P1003.2 minimum (2048) + 2 */
-
-#define        RDTWO(ib1, lb1, ib2, lb2) \
-       { \
-               if (rd(ib1, lb1) < 0) { \
-                       if (rd(ib2, lb2) < 0) \
-                               exit(0); \
-                       copy(ib2, lb2, 2); \
-               } \
-               if (rd(ib2, lb2) < 0) \
-                       copy(ib1, lb1, 1); \
-       }
-
-static int     one;
-static int     two;
-static int     three;
-
-static char    ldr[3][3] = {"", "\t", "\t\t"};
-
-static FILE    *ib1;
-static FILE    *ib2;
-static int     is_c_locale;
-
-int
-main(int argc, char **argv)
-{
-       int     l = 1;
-       int     c;              /* used for getopt() */
-       char    lb1[LB], lb2[LB], *collate;
-
-       (void) setlocale(LC_ALL, "");
-#if !defined(TEXT_DOMAIN)      /* Should be defined by cc -D */
-#define        TEXT_DOMAIN "SYS_TEST"  /* Use this only if it weren't */
-#endif
-       (void) textdomain(TEXT_DOMAIN);
-
-       if ((collate = setlocale(LC_COLLATE, NULL)) == NULL) {
-               (void) fprintf(stderr,
-                       gettext("Query of LC_COLLATE category failed\n"));
-               exit(4);
-       }
-
-       is_c_locale = (strcmp("C", collate) == 0) ? 1 : 0;
-       while ((c = getopt(argc, argv, "123")) != EOF)
-               switch (c) {
-               case '1':
-                       if (!one) {
-                               one = 1;
-                               ldr[1][0] = ldr[2][l--] = '\0';
-                       }
-                       break;
-               case '2':
-                       if (!two) {
-                               two = 1;
-                               ldr[2][l--] = '\0';
-                       }
-                       break;
-               case '3':
-                       three = 1;
-                       break;
-
-               default:
-                       usage();
-               }
-
-       argc -= optind;
-       argv  = &argv[optind];
-
-       if (argc != 2)
-               usage();
-       ib1 = openfil(argv[0]);
-       ib2 = openfil(argv[1]);
-       RDTWO(ib1, lb1, ib2, lb2);
-       for (;;) {
-               switch (compare(lb1, lb2)) {
-                       case 0:
-                               wr(lb1, 3);
-                               RDTWO(ib1, lb1, ib2, lb2);
-                               continue;
-
-                       case 1:
-                               wr(lb1, 1);
-                               if (rd(ib1, lb1) < 0)
-                                       copy(ib2, lb2, 2);
-                               continue;
-
-                       case 2:
-                               wr(lb2, 2);
-                               if (rd(ib2, lb2) < 0)
-                                       copy(ib1, lb1, 1);
-                               continue;
-                       /*
-                        * case "3" means lines are equal in collation,
-                        * but not identical (not very likely)
-                        */
-                       case 3:
-                               wr(lb1, 1);
-                               wr(lb2, 2);
-                               RDTWO(ib1, lb1, ib2, lb2);
-                               continue;
-               }
-       }
-       /* NOTREACHED */
-       return (0);
-}
-
-static int
-rd(file, buf)
-FILE *file;
-char *buf;
-{
-       register int i, j;
-       i = j = 0;
-       while ((j = getc(file)) != EOF) {
-               *buf = (char)j;
-               if (*buf == '\n' || i > LB-2) {
-                       *buf = '\0';
-                       return (0);
-               }
-               i++;
-               buf++;
-       }
-       return (-1);
-}
-
-static void
-wr(str, n)
-char *str;
-int n;
-{
-       switch (n) {
-               case 1:
-                       if (one)
-                               return;
-                       break;
-
-               case 2:
-                       if (two)
-                               return;
-                       break;
-
-               case 3:
-                       if (three)
-                               return;
-       }
-       (void) printf("%s%s\n", ldr[n-1], str);
-}
-
-static void
-copy(ibuf, lbuf, n)
-FILE *ibuf;
-char *lbuf;
-int n;
-{
-       do {
-               wr(lbuf, n);
-       } while (rd(ibuf, lbuf) >= 0);
-
-       exit(0);
-}
-
-static int
-compare(a, b)
-char *a, *b;
-{
-       register char *ra, *rb;
-       int ret;
-
-       ra = a - 1;
-       rb = b - 1;
-       while (*++ra == *++rb)
-               if (*ra == '\0')
-                       return (0);
-
-       /* For "C" locale, just compare bytes */
-       if (is_c_locale) {
-               if (*ra < *rb)
-                       return (1);
-               return (2);
-       }
-       /* For other locales, call locale-sensitive compare routine */
-       else {
-               ret = strcoll(a, b);
-               return (ret == 0 ? 3 : (ret < 0 ? 1 : 2));
-       }
-}
-
-static FILE *
-openfil(s)
-char *s;
-{
-       FILE *b;
-       if (s[0] == '-' && s[1] == 0)
-               b = stdin;
-       else if ((b = fopen(s, "r")) == NULL) {
-               (void) fprintf(stderr, "comm: ");
-               perror(s);
-               exit(2);
-       }
-       return (b);
-}
-
-static void
-usage()
-{
-       (void) fprintf(stderr, gettext("usage: comm [-123] file1 file2\n"));
-       exit(2);
-}
--- old/usr/src/cmd/cut/Makefile        Fri Sep 25 05:24:15 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,47 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-#ident "%Z%%M% %I%     %E% SMI"
-#
-# Copyright (c) 1989, 1996 by Sun Microsystems, Inc.
-# All rights reserved.
-#
-
-PROG= cut
-
-include ../Makefile.cmd
-
-CPPFLAGS += -D_FILE_OFFSET_BITS=64
-
-XGETFLAGS += -a -x $(PROG).xcl
-
-.KEEP_STATE:
-
-all: $(PROG) 
-
-install: all $(ROOTPROG)
-
-clean:
-
-lint:  lint_PROG
-
-include ../Makefile.targ
--- old/usr/src/cmd/cut/cut.c   Fri Sep 25 05:24:17 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,627 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*     Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/*       All Rights Reserved   */
-
-#
-/* cut : cut and paste columns of a table (projection of a relation) */
-/* Release 1.5; handles single backspaces as produced by nroff    */
-
-#include <stdio.h>     /* make: cc cut.c */
-#include <ctype.h>
-#include <limits.h>
-#include <locale.h>
-#include <wchar.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-
-#define        MAX_RANGES      MAX_INPUT       /* maximum number of ranges */
-                                       /* as input args */
-
-static void    bfunc(void);
-static void    bnfunc(void);
-static void    cfunc(void);
-static void    ffunc(void);
-static wchar_t *read_line(FILE *);
-static void    process_list(char *);
-static void    diag(const char *);
-static void    usage(void);
-
-static wchar_t wdel = '\t';
-static int     dellen;
-static int     supflag = 0;
-static int     rstart[MAX_RANGES];
-static int     rend[MAX_RANGES];
-static int     nranges = 0;
-static FILE    *inptr;
-static char    dummy[MB_LEN_MAX];
-
-static wchar_t *linebuf = NULL;
-static int     bufsiz;
-
-int
-main(int argc, char **argv)
-{
-       int     c;
-       char    *list;
-       int     status = 0;
-       int     bflag, nflag, cflag, fflag, dflag, filenr;
-       void    (*funcp)();
-
-       bflag = nflag = cflag = fflag = dflag = 0;
-
-       (void) setlocale(LC_ALL, "");
-
-#if !defined(TEXT_DOMAIN)              /* Should be defined by cc -D */
-#define        TEXT_DOMAIN     "SYS_TEST"      /* Use this only if it weren't. 
*/
-#endif
-       (void) textdomain(TEXT_DOMAIN);
-
-       while ((c = getopt(argc, argv, "b:c:d:f:ns")) != EOF)
-               switch (c) {
-                       case 'b':
-                               if (fflag || cflag)
-                                       usage();
-                               bflag++;
-                               list = optarg;
-                               break;
-
-                       case 'c':
-                               if (fflag || bflag)
-                                       usage();
-                               cflag++;
-                               list = optarg;
-                               break;
-
-                       case 'd':
-                               dellen = mbtowc(&wdel, optarg, MB_CUR_MAX);
-                               if (dellen == -1) {
-                                       diag("no delimiter specified");
-                               } else if (dellen != strlen(optarg))
-                                       diag("invalid delimiter");
-                               dflag++;
-                               break;
-
-                       case 'f':
-                               if (bflag || cflag)
-                                       usage();
-                               fflag++;
-                               list = optarg;
-                               break;
-
-                       case 'n':
-                               nflag++;
-                               break;
-
-                       case 's':
-                               supflag++;
-                               break;
-
-                       case '?':
-                               usage();
-               }
-
-       argv = &argv[optind];
-       argc -= optind;
-
-       /* you must use one and only one option -b, -c, or -f */
-       if (!(cflag || fflag || bflag))
-               usage();
-
-       /*
-        * Make sure combination of options is correct
-        */
-       if (nflag) {
-               if (cflag || fflag) {
-                       (void) fprintf(stderr, gettext(
-                           "cut: -n may only be used with -b\n"));
-                       usage();
-               }
-       }
-
-       if (dflag || supflag) {
-               if (bflag || cflag) {
-                       if (dflag)
-                               (void) fprintf(stderr, gettext(
-                                   "cut: -d may only be used with -f\n"));
-                       if (supflag)
-                               (void) fprintf(stderr, gettext(
-                                   "cut: -s may only be used with -f\n"));
-                       usage();
-               }
-       }
-
-       process_list(list);
-
-       if (cflag) {
-               funcp = cfunc;
-       } else if (bflag) {
-               if (nflag)
-                       funcp = bnfunc;
-               else
-                       funcp = bfunc;
-       } else { /* fflag */
-               funcp = ffunc;
-       }
-
-       if (nranges == 0)
-               diag("no list specified");
-
-       filenr = 0;
-       do {    /* for all input files */
-               if (argc == 0 || strcmp(argv[filenr], "-") == 0)
-                       inptr = stdin;
-               else {
-                       if ((inptr = fopen(argv[filenr], "r")) == NULL) {
-                               (void) fprintf(stderr, "cut: %s: %s\n",
-                                   argv[filenr], strerror(errno));
-                               status = 1;
-                               continue;
-                       }
-                       /*
-                        * ftell() is used to check whether the file is an
-                        * open file descriptor and if the file is associate
-                        * with the a pipe, a FIFO,or a socket if file cannot
-                        * be opened ftell() can be used to check the status
-                        * of the file
-                        */
-                       if (ftell(inptr) == -1) {
-                               (void) fprintf(stderr, "cut: %s: %s\n",
-                                   argv[filenr], strerror(errno));
-                               status = 1;
-                               continue;
-                       }
-               }
-               (*funcp)();
-               (void) fclose(inptr);
-       } while (++filenr < argc);
-       return (status);
-}
-
-/* parse range list argument and set-up rstart/rend array */
-void
-process_list(char *list)
-{
-       int inrange = 0;
-       int start = 0;
-       int num = 0;
-       char *rlist = list;
-       char *p;
-       int i, j;
-       int tmp;
-
-       /* first, parse list of ranges */
-       do {
-               p = rlist;
-               switch (*p) {
-                       case '-':
-                               if (inrange)
-                                       diag("invalid range specifier");
-
-                               inrange = 1;
-                               if (num == 0)
-                                       start = 1;
-                               else {
-                                       start = num;
-                                       num = 0;
-                               }
-                               break;
-
-                       case '\0':
-                       case ',':
-                       case ' ':
-                       case '\t':
-                               /*
-                                * this is temporary - it will change
-                                * when the isblank() routine becomes
-                                * available.
-                                */
-                               if (nranges == MAX_RANGES)
-                                       diag("too many ranges specified");
-
-                               if (inrange) {
-                                       if (num == 0)
-                                               num = INT_MAX;
-                                       if (num < start)
-                                               diag("ranges must be "
-                                                   "increasing");
-                                       rstart[nranges] = start;
-                                       rend[nranges] = num;
-                                       nranges++;
-                               } else {
-                                       rstart[nranges] = num;
-                                       rend[nranges] = num;
-                                       nranges++;
-                               }
-
-                               num = 0;
-                               start = 0;
-                               inrange = 0;
-
-                               if (*p == '\0')
-                                       continue;
-                               break;
-
-                       default:
-                               if (!isdigit(*p))
-                                       diag("invalid character in range");
-                               num = atoi(p);
-                               while (isdigit(*rlist))
-                                       rlist++;
-                               continue;
-               }
-               rlist++;
-       } while (*p != '\0');
-
-       /* then, consolidate ranges where possible */
-       for (i = 0; i < (nranges - 1); i++) {
-               for (j = i + 1; j < nranges; j++) {
-                       if (rstart[i] != 0 && rend[i] != 0 &&
-                           (!(rend[i] < rstart[j] || rstart[i] > rend[j]))) {
-                               if (rstart[i] < rstart[j])
-                                       rstart[j] = rstart[i];
-                               if (rend[i] > rend[j])
-                                       rend[j] = rend[i];
-                               rstart[i] = 0;
-                               rend[i] = 0;
-                               break;
-                       }
-               }
-       }
-
-       /* then, weed out the zero'ed/consolidated entries */
-       for (i = 0; i < nranges; ) {
-               if (rstart[i] == 0 && rend[i] == 0) {
-                       for (j = i; j < (nranges - 1); j++) {
-                               rstart[j] = rstart[j+1];
-                               rend[j] = rend[j+1];
-                       }
-                       nranges--;
-               } else if (rstart[i] == 0 || rend[i] == 0) {
-                       diag("Internal error processing input");
-               } else {
-                       i++;
-               }
-       }
-
-       /* finally, sort the remaining entries */
-       for (i = 0; i < (nranges - 1); i++) {
-               for (j = i+1; j < nranges; j++) {
-                       if (rstart[i] > rend[j]) {
-                               tmp = rstart[i];
-                               rstart[i] = rstart[j];
-                               rstart[j] = tmp;
-
-                               tmp = rend[i];
-                               rend[i] = rend[j];
-                               rend[j] = tmp;
-                       }
-               }
-       }
-
-#ifdef DEBUG
-       /* dump ranges */
-       for (i = 0; i < nranges; i++) {
-               (void) printf("Range %d - start: %d end: %d\n", i, rstart[i],
-                   rend[i]);
-       }
-#endif
-}
-
-/* called when -c is used */
-/* print out those characters selected */
-
-void
-cfunc(void)
-{
-       wint_t  c;              /* current character */
-       int     pos = 0;        /* current position within line */
-       int     inrange = 0;    /* is 'pos' within a range */
-       int     rndx = 0;       /* current index into range table */
-
-       while ((c = fgetwc(inptr)) != EOF) {
-               if (c == '\n') {
-                       (void) putchar('\n');
-
-                       /* reset per-line variables */
-                       pos = 0;
-                       inrange = 0;
-                       rndx = 0;
-               } else {
-                       pos++;
-
-                       /*
-                        * check if current character is within range and,
-                        * if so, print it.
-                        */
-                       if (!inrange)
-                               if (pos == rstart[rndx])
-                                       inrange = 1;
-
-                       if (inrange) {
-                               (void) putwchar(c);
-                               if (pos == rend[rndx]) {
-                                       inrange = 0;
-                                       rndx++;
-                                       /*
-                                        * optimization -
-                                        * check for last range index
-                                        * and eat chars until newline
-                                        * if so.
-                                        */
-                               }
-                       }
-               }
-       }
-}
-
-void
-bfunc(void) /* called when -b is used but -n is not */
-{
-       int     c;              /* current character */
-       int     pos = 0;        /* current position within line */
-       int     inrange = 0;    /* is 'pos' within a range */
-       int     rndx = 0;       /* current index into range table */
-
-       while ((c = getc(inptr)) != EOF) {
-               if (c == L'\n') {
-                       (void) putchar('\n');
-
-                       /* reset per-line variables */
-                       pos = 0;
-                       inrange = 0;
-                       rndx = 0;
-               } else {
-                       pos++;
-
-                       /*
-                        * check if current character is within range and,
-                        * if so, print it.
-                        */
-                       if (!inrange)
-                               if (pos == rstart[rndx])
-                                       inrange = 1;
-
-                       if (inrange) {
-                               (void) putchar(c);
-                               if (pos == rend[rndx]) {
-                                       inrange = 0;
-                                       rndx++;
-                                       /*
-                                        * optimization -
-                                        * check for last range index
-                                        * and eat chars until newline
-                                        * if so.
-                                        */
-                               }
-                       }
-               }
-       }
-}
-
-
-void
-bnfunc(void) /* called when -b -n is used */
-{
-       wint_t  c;              /* current character */
-       int     pos = 0;        /* current position within line */
-       int     inrange = 0;    /* is 'pos' within a range */
-       int     rndx = 0;       /* current index into range table */
-       int     wlen;           /* byte length of current wide char */
-
-       while ((c = fgetwc(inptr)) != EOF) {
-               if (c == '\n') {
-                       (void) putchar('\n');
-
-                       /* reset per-line variables */
-                       pos = 0;
-                       inrange = 0;
-                       rndx = 0;
-               } else {
-                       if (rndx >= nranges)
-                               continue;
-
-                       if ((wlen = wctomb(dummy, c)) < 0)
-                               diag("invalid multibyte character");
-                       pos += wlen;
-
-                       /*
-                        * when trying to figure this out, remember that
-                        * pos is actually pointing to the start byte of
-                        * the next char.
-                        */
-
-                       /*
-                        * if char starts after beginning of range,
-                        * for the moment, consider it in range.
-                        */
-                       if (!inrange && pos < rstart[rndx])
-                               continue;
-
-                       /*
-                        * If tail of the multibyte is out of the range.
-                        * do not print the character.
-                        * (See XCU4)
-                        */
-                       if (pos <= rend[rndx]) {
-                               inrange = 1;
-                               (void) putwchar(c);
-                               continue;
-                       }
-                       inrange = 0;
-                       while (++rndx < nranges && pos >= rstart[rndx]) {
-                               if (pos <= rend[rndx]) {
-                                       inrange = 1;
-                                       (void) putwchar(c);
-                                       break;
-                               }
-                       }
-               }
-       }
-}
-
-wchar_t *
-read_line(FILE *fp)
-{
-       wint_t  c;
-       wchar_t *cp;
-       int charcnt;
-
-       /* alloc the line buffer if it isn't already there */
-       if (linebuf == NULL) {
-               bufsiz = BUFSIZ - 1;
-               if ((linebuf = (wchar_t *)malloc((bufsiz + 1) *
-                   sizeof (wchar_t))) == NULL)
-                       diag("unable to allocate enough memory");
-       }
-
-       cp = linebuf;
-       charcnt = 0;
-       while ((c = fgetwc(fp)) != EOF) {
-               if (c == '\n') {
-                       *cp = NULL;
-                       return (linebuf);
-               } else {
-                       charcnt++;
-                       if (charcnt == bufsiz) {
-                               /*
-                                * there is no line length limitation so we
-                                * have to be ready to expand the line buffer.
-                                */
-                               bufsiz += BUFSIZ;
-                               if ((linebuf = (wchar_t *)realloc(linebuf,
-                                   (bufsiz + 1) * sizeof (wchar_t))) == NULL)
-                                       diag("unable to allocate "
-                                           "enough memory");
-
-                               cp = linebuf + charcnt - 1;
-                       }
-                       *cp++ = c;
-               }
-       }
-
-       if (cp != linebuf) {
-               *cp = NULL;
-               return (linebuf);
-       } else
-               return (NULL);
-}
-
-void
-ffunc(void)  /* called when -f is used */
-{
-       int     fpos;           /* current field position within line */
-       int     inrange;        /* is 'pos' within a range */
-       int     rndx;           /* current index into range table */
-       int     need_del;       /* need to put a delimiter char in output */
-       wchar_t *linep;         /* pointer to line buffer */
-       wchar_t *cp, *ncp;      /* working pointers into linebuf */
-
-       while ((linep = read_line(inptr)) != NULL) {
-
-               /* first, prune out line with no delimiters */
-               if (wcschr(linep, wdel) == NULL) {
-#if !defined(__lint)   /* lint doesn't grok "%ws" */
-                       if (!supflag)
-                               (void) printf("%ws\n", linep);
-#endif
-                       continue;
-               }
-
-               /* init per-line variable */
-               fpos = 1;
-               inrange = 0;
-               rndx = 0;
-               need_del = 0;
-
-               for (ncp = cp = linep; ncp != NULL; fpos++) {
-                       /* why continue processing if no more ranges? */
-                       if (rndx >= nranges)
-                               break;
-
-                       /* find the next field delimiter */
-                       ncp = wcschr(cp, wdel);
-
-                       if (!inrange)
-                               if (fpos == rstart[rndx])
-                                       inrange = 1;
-
-                       if (inrange) {
-                               if (need_del)
-                                       (void) putwchar(wdel);
-
-                               if (ncp == NULL) {
-                                       /*
-                                        * if there are no more delimiters
-                                        * and we are in the range, print
-                                        * out the rest of the line.
-                                        */
-#if !defined(__lint)   /* lint doesn't grok "%ws" */
-                                       (void) printf("%ws", cp);
-#endif
-                                       break;
-                               }
-                               else
-                                       while (cp != ncp)
-                                               (void) putwchar(*cp++);
-                               need_del = 1;
-
-                               if (fpos == rend[rndx]) {
-                                       inrange = 0;
-                                       rndx++;
-                               }
-                       }
-
-                       if (ncp != NULL)
-                               cp = ncp + 1;
-               }
-               (void) putchar('\n');
-       }
-}
-
-
-void
-diag(const char *s)
-{
-       (void) fprintf(stderr, "cut: ");
-       (void) fprintf(stderr, gettext(s));
-       (void) fprintf(stderr, "\n");
-       exit(2);
-}
-
-
-void
-usage(void)
-{
-       (void) fprintf(stderr, gettext(
-           "usage: cut -b list [-n] [filename ...]\n"
-           "       cut -c list [filename ...]\n"
-           "       cut -f list [-d delim] [-s] [filename]\n"));
-       exit(2);
-}
--- old/usr/src/cmd/cut/cut.xcl Fri Sep 25 05:24:19 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,29 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-msgid  ""
-msgid  "b:c:d:f:ns"
-msgid  "-"
-msgid  "r"
-msgid  "%ws\n"
-msgid  "%ws"
-msgid  "cut: "
-msgid  "\n"
--- old/usr/src/cmd/join/Makefile       Fri Sep 25 05:24:21 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,47 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-#ident "%Z%%M% %I%     %E% SMI"
-#
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-PROG= join
-
-include ../Makefile.cmd
-
-CFLAGS += $(CCVERBOSE)
-XGETFLAGS += -a -x join.xcl
-CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1
-
-.KEEP_STATE:
-
-all: $(PROG) 
-
-install: all $(ROOTPROG)
-
-clean:
-
-lint:  lint_PROG
-
-include ../Makefile.targ
--- old/usr/src/cmd/join/join.c Fri Sep 25 05:24:23 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,693 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*     Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/*       All Rights Reserved   */
-
-
-/*
- * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident  "%Z%%M% %I%     %E% SMI"
-
-/*     join F1 F2 on stuff */
-
-#include       <stdio.h>
-#include       <locale.h>
-#include       <stdlib.h>
-#include       <widec.h>
-#include       <string.h>
-#include       <limits.h>
-#include       <malloc.h>
-#include       <errno.h>
-#include       <unistd.h>
-
-
-static void    output(int, int);
-static int     cmp(wchar_t *, wchar_t *);
-static int     input(int);
-static void    Usage();
-static void    init_buf();
-static void    get_buf(int, int);
-static void    get_ppi(int);
-static void    get_olist(int);
-wchar_t        *wcsrchr(const wchar_t *, wchar_t);
-size_t wcslen(const wchar_t *);
-
-
-#define        JOINFIELD       9999
-#define        F1              0
-#define        F2              1
-#define        NFLD            LINE_MAX/2      /* max field per line */
-#define        NOFLD           (2*NFLD) /* number arguments to -o */
-#define        comp()          cmp(ppi[F1][j1], ppi[F2][j2])
-#define        get1()          n1 = input(F1)
-#define        get2()          n2 = input(F2)
-#define        putfield(string)                                \
-       if (string == (wchar_t *)NULL)                  \
-               (void) fputs(null, stdout);             \
-       else if (*string == (wchar_t)NULL)              \
-               (void) fputs(null, stdout);             \
-       else                                            \
-               (void) fputws(string, stdout)
-
-#define        max(a, b)       (a >= b ? a : b)
-int    CNFLD;  /* current number of fields per line */
-int    CNOFLD; /* current number of output fields */
-int    CBUFSIZE[2];    /* current size of input buffers */
-
-static FILE    *f[2];
-static wchar_t *buf[2];                /* input lines */
-static wchar_t **ppi[2];               /* pointers to fields in lines */
-static int     j1      = 1;            /* join of this field of file 1 */
-static int     j2      = 1;            /* join of this field of file 2 */
-static int     *olist;                 /* output these fields */
-static int     *olistf;                /* from these files */
-static int     no      = 0;            /* number of entries in olist */
-static wchar_t sep1    = L' ';         /* default field separator */
-static wchar_t sep2    = L'\t';
-static char    *null   = "";
-static int     aflg    = 0;
-static int     vflg    = 0;
-static int     tflg    = 0;
-
-int
-main(int argc, char *argv[])
-{
-       int     i, j;
-       int     n1, n2;
-       off_t   top2, bot2;
-       int     cmpresult;
-       int     opt, filenumber;
-       int     nextargopt;
-       size_t  t;
-       char    buffer1[BUFSIZ];
-       char    tmpfile[20];
-       int     fd;
-
-       (void) setlocale(LC_ALL, "");
-#if !defined(TEXT_DOMAIN)      /* Should be defined by cc -D */
-#define        TEXT_DOMAIN "SYS_TEST"  /* Use this only if it weren't */
-#endif
-
-       (void) textdomain(TEXT_DOMAIN);
-
-       (void) init_buf(); /* allocate buffers */
-
-       /* check for non-standard "-j#" option, last 2 arguments are files */
-       for (i = 1; i < (argc - 2); i++) {
-               if (strcmp(argv[i], "--") == 0)
-                       break;
-
-               if (strcmp(argv[i], "-j1") == 0) {
-                       if (i == argc - 3)
-                               Usage();
-
-                       j1 = (int)strtol(argv[i+1], (char **)NULL, 10);
-                       for (j = i; j < argc - 1; j++) {
-                               argv[j] = argv[j+2];
-                       }
-                       argc -= 2;
-                       i--;
-               } else if (strcmp(argv[i], "-j2") == 0) {
-                       if (i >= argc - 3)
-                               Usage();
-
-                       j2 = (int)strtol(argv[i+1], (char **)NULL, 10);
-                       for (j = i; j < argc - 1; j++) {
-                               argv[j] = argv[j+2];
-                       }
-                       argc -= 2;
-                       i--;
-               }
-
-       }
-
-       /* check for non-standard "-o" option, last 2 arguments are files */
-       for (i = 1; i < argc - 2; i++) {
-
-               /* stop looking for -o if "--" */
-               if (strcmp(argv[i], "--") == 0)
-                       break;
-
-               if (strncmp(argv[i], "-o", 2) == 0) {
-                       if (argv[i][2] == '\0') {
-                               for (j = i; j < argc; j++) {
-                                       argv[j] = argv[j+1];
-                               }
-                               argc--;
-                       } else {
-                               argv[i] += 2 + (int)strspn(&argv[i][2], " ");
-                       }
-
-                       if (i == argc - 2)
-                               Usage();
-
-                       for (no = 0; (no < 2*CNFLD) && (i < argc - 2); no++) {
-                               if (no > CNOFLD - 1) {
-                                       /* Get larger table for outlists */
-                                       /* (CNOFLD is updated.) */
-                                       get_olist(CNOFLD + NOFLD);
-                               }
-
-                               if (strncmp(argv[i], "1.", 2) == 0) {
-                                       olistf[no] = F1;
-                                       olist[no] = (int)strtol(&argv[i][2],
-                                           (char **)NULL, 10);
-                                       nextargopt = 2 + (int)
-                                           strspn(&argv[i][2], "0123456789");
-                               } else if (strncmp(argv[i], "2.", 2) == 0) {
-                                       olistf[no] = F2;
-                                       olist[no] = (int)strtol(&argv[i][2],
-                                           (char **)NULL, 10);
-                                       nextargopt = 2 + (int)
-                                           strspn(&argv[i][2], "0123456789");
-                               } else if (argv[i][0] == '0') {
-                                       olistf[no] = JOINFIELD;
-                                       nextargopt = 1;
-                               } else
-                                       break;
-
-                               if (olist[no] > CNFLD)
-                                       get_ppi(olist[no]);
-
-                               if (argv[i][nextargopt] == '\0') {
-                                       for (j = i; j < argc; j++) {
-                                               argv[j] = argv[j+1];
-                                       }
-                                       argc--;
-                               } else if ((argv[i][nextargopt] == ' ') ||
-                                   (argv[i][nextargopt] == ',')) {
-                                       argv[i] += nextargopt + 1;
-                               } else
-                                       Usage();
-                       }
-               }
-       }
-
-       /* get other options */
-       while ((opt = getopt(argc, argv, "1:2:a:e:j:t:v:")) != EOF) {
-               switch (opt) {
-               case '1':
-                       j1 = (int)strtol(optarg, (char **)NULL, 10);
-                       break;
-
-               case '2':
-                       j2 = (int)strtol(optarg, (char **)NULL, 10);
-                       break;
-
-               case 'a':
-               case 'v':
-                       filenumber = (int)strtol(optarg, (char **)NULL, 10);
-                       if ((filenumber != 1) && (filenumber != 2))
-                               Usage();
-
-                       aflg |= filenumber;
-                       if (opt == 'v')
-                               vflg |= filenumber;
-                       break;
-
-               case 'e':
-                       null = optarg;
-                       break;
-
-               case 'j':
-                       j1 = j2 = (int)strtol(optarg, (char **)NULL, 10);
-                       break;
-
-               case 't':
-                       tflg = 1;
-                       (void) mbtowc(&sep1, optarg, MB_CUR_MAX);
-                       sep2 = sep1;
-                       break;
-               }
-       }
-       if (j1 > CNFLD || j2 > CNFLD)
-               get_ppi(max(j1, j2));
-
-       /* check options */
-       if ((j1 > CNFLD) || (j2 > CNFLD) || (j1 <= 0) || (j2 <= 0)) {
-               (void) fprintf(stderr, gettext(
-                   "join: bad join field number\n"));
-               Usage();
-       }
-
-       /* 0 origin */
-       for (i = 0; i < no; i++)
-               olist[i]--;
-       j1--;
-       j2--;
-
-       if (argc - optind != 2)
-               Usage();
-
-       if (strcmp(argv[optind], "-") == 0)
-               f[F1] = stdin;
-       else if ((f[F1] = fopen(argv[optind], "r")) == NULL) {
-               perror(argv[optind]);
-               exit(1);
-       }
-
-       if (strcmp(argv[optind+1], "-") == 0) {
-               (void) strncpy(tmpfile, "/tmp/joinXXXXXX", 20);
-               if ((fd = mkstemp(tmpfile)) < 0) {
-                       perror(gettext("join: cannot create tmpfile"));
-                       exit(1);
-               }
-               if ((f[F2] = fdopen(fd, "w+")) == NULL) {
-                       perror(gettext("join: cannot open tmpfile"));
-                       exit(1);
-               }
-               /* tmpfile is automatically removed on exit */
-               (void) unlink(tmpfile);
-
-               while ((t = fread(buffer1, 1, BUFSIZ, stdin)) != 0) {
-                       if ((fwrite(buffer1, 1, t, f[F2])) != t) {
-                               (void) fprintf(stderr, gettext(
-                                       "join: cannot write to tmpfile\n"));
-                               exit(1);
-                       }
-               }
-               (void) fflush(f[F2]);
-               rewind(f[F2]);
-       } else if ((f[F2] = fopen(argv[optind+1], "r")) == NULL) {
-               perror(argv[optind+1]);
-               exit(1);
-       }
-
-       /* set bottom mark on file2 */
-       bot2 = ftello(f[F2]);
-
-       /* input a line from each file */
-       get1();
-       get2();
-
-       /* while lines in both files or -a|v and lines in ether file */
-       while (((n1 > 0) && (n2 > 0)) || ((aflg != 0) && ((n1 + n2) > 0))) {
-
-               /* compare join fields */
-               cmpresult = comp();
-
-               /* joinfiled1 > joinfield2 or file1 exasted */
-               if (((n1 > 0) && (n2 > 0) && (cmpresult > 0)) || (n1 == 0)) {
-
-                       /* outputing unpaired ? */
-                       if (aflg & 2)
-                               output(0, n2);
-
-                       /* mark bottom of file2 */
-                       bot2 = ftello(f[F2]);
-
-                       /* input line from file2 */
-                       get2();
-
-               /* joinfiled1 < joinfield2 or file2 exasted */
-               } else if (((n1 > 0) && (n2 > 0) && (cmpresult < 0)) ||
-                   (n2 == 0)) {
-
-                       /* outputing unpaired ? */
-                       if (aflg & 1)
-                               output(n1, 0);
-
-                       /* input line from file1 */
-                       get1();
-
-               /* line1 and line2 not empty and joinfield1 == joinfield2 */
-               } else {
-                       /* for lines in file2 that match join field */
-                       while (n2 > 0 && comp() == 0) {
-
-                               /* if not -v output line */
-                               if (!vflg)
-                                       output(n1, n2);
-
-                               /* mark top of file2 */
-                               top2 = ftello(f[F2]);
-
-                               /* input line from file2 */
-                               get2();
-                       }
-
-                       /* back to bottom line in file2 */
-                       (void) fseeko(f[F2], (off_t)bot2, SEEK_SET);
-
-                       /* input line form file1 and file2 */
-                       get2();
-                       get1();
-
-                       for (;;) {
-                               /* compare join fields */
-                               cmpresult = comp();
-
-                               /*
-                                * line1 and line2 not empty and
-                                * joinfield1 == joinfield2
-                                */
-                               if (n1 > 0 && n2 > 0 && cmpresult == 0) {
-
-                                       /* if not -v output line */
-                                       if (!vflg)
-                                               output(n1, n2);
-
-                                       /* input line from file2 */
-                                       get2();
-
-                               /* joinfiled1 < joinfield2 or file2 exasted */
-                               } else if (n1 > 0 && n2 > 0 && cmpresult < 0 ||
-                                   n2 == 0) {
-
-                                       /* seek to bottom of file2 */
-                               (void) fseeko(f[F2], (off_t)bot2, SEEK_SET);
-
-                                       /* input line form file1 and file2 */
-                                       get2();
-                                       get1();
-
-                               /* file1 exasted or joinfile1 > joinfield2 */
-                               } else {
-                                       /* seek to top of file2 */
-                               (void) fseeko(f[F2], (off_t)top2, SEEK_SET);
-
-                                       /* set bottom at top */
-                                       bot2 = top2;
-
-                                       /* input line form file2 */
-                                       get2();
-
-                                       break;
-                               }
-                       }
-               }
-       }
-       return (0);
-}
-
-
-static int
-input(int n)           /* get input line and split into fields */
-{
-       int i, c;
-       wchar_t *bp;
-       wchar_t *tbp;
-       wchar_t **pp;
-       int     nread;
-
-       bp = buf[n];
-       pp = ppi[n];
-
-       errno = 0;
-       if (fgetws(bp, CBUFSIZE[n], f[n]) == (wchar_t *)NULL) {
-               if (errno) {
-                       perror("join");
-                       exit(1);
-               }
-               return (0);
-       } else {
-               if (errno == EILSEQ) {
-                       (void) fprintf(stderr, gettext(
-                       "join: invalid char following \""));
-                       (void) fputws(bp, stderr);
-                       (void) fprintf(stderr, "\":  ");
-                       perror("");
-                       exit(1);
-               } else if (errno) {
-                       perror("join");
-                       exit(1);
-               }
-
-               /* Check for long lines */
-               if (((wchar_t *)wcsrchr((wchar_t *)bp, L'\n')
-                       == (wchar_t *)NULL) && (size_t)wcslen((wchar_t *)bp)
-                       == (size_t)(CBUFSIZE[n] - 1)) {
-                       tbp = bp;
-                       nread = CBUFSIZE[n] - 1;
-                       while ((wchar_t *)wcsrchr((wchar_t *)tbp, L'\n')
-                               == (wchar_t *)NULL) {
-                               /* Increase buffer by LINE_MAX */
-                               /* (CBUFSIZE[n] is updated.) */
-                               get_buf(n, CBUFSIZE[n] + LINE_MAX);
-                               bp = buf[n];
-                               tbp = buf[n] + nread;
-
-                               /* Read rest of line */
-                               errno = 0;
-                               if (fgetws(tbp, LINE_MAX + 1, f[n])
-                                       ==  (wchar_t *)NULL) {
-                                       if (errno) {
-                                               perror("join");
-                                               exit(1);
-                                       }
-                                       break;
-                               } else if (errno == EILSEQ) {
-                                       (void) fprintf(stderr, gettext(
-                                       "join: invalid char following \""));
-                                       (void) fputws(bp, stderr);
-                                       (void) fprintf(stderr, "\":  ");
-                                       perror("");
-                                       exit(1);
-                               } else if (errno) {
-                                       perror("join");
-                                       exit(1);
-                               }
-                               nread += (size_t)wcslen((wchar_t *)tbp);
-                       }
-               }
-       }
-
-       bp = buf[n];
-       i = 0;
-       do {
-               i++;
-               /* Check for overflow of ppi[n] */
-               if (i > CNFLD - 1) {    /* account for 0 termination */
-                       /* Reallocate larger buffers (CNFLD is updated.) */
-                       get_ppi(CNFLD + NFLD);
-                       /* Restore local pointer */
-                       pp = &ppi[n][i-1];
-               }
-               if (!tflg)      /* strip multiples */
-                       while ((c = *bp) == sep1 || c == sep2) {
-                               bp++;   /* skip blanks */
-                       }
-               *pp++ = bp;     /* record beginning */
-               while ((c = *bp) != sep1 && c != L'\n' &&
-                               c != sep2 && c != L'\0') {
-                       bp++;
-               }
-               *bp++ = L'\0';  /* mark end by overwriting blank */
-       } while ((c != L'\n') && (c != L'\0') && (pp != &ppi[n][CNFLD]));
-
-       *pp = (wchar_t *)NULL;
-
-
-       return (i);
-}
-
-
-static void
-output(on1, on2)       /* print items from olist */
-int on1, on2;
-{
-       int i;
-
-       if (no <= 0) {  /* default case */
-               if (on1)
-                       putfield(ppi[F1][j1]);
-               else
-                       putfield(ppi[F2][j2]);
-               for (i = 0; i < on1; i++)
-                       if (i != j1) {
-                               (void) putwchar(sep1);
-                               putfield(ppi[F1][i]);
-                       }
-               for (i = 0; i < on2; i++)
-                       if (i != j2) {
-                               (void) putwchar(sep1);
-                               putfield(ppi[F2][i]);
-                       }
-               (void) putwchar(L'\n');
-       } else {
-               for (i = 0; i < no; i++) {
-                       if (olistf[i] == F1 && on1 <= olist[i] ||
-                               olistf[i] == F2 && on2 <= olist[i]) {
-                               (void) fputs(null, stdout);
-                       } else if (olistf[i] == JOINFIELD) {
-                               if (on1)
-                                       putfield(ppi[F1][j1]);
-                               else
-                                       putfield(ppi[F2][j2]);
-                       } else
-                               putfield(ppi[olistf[i]][olist[i]]);
-
-                       if (i < no - 1)
-#if defined(__lint)    /* lint doesn't grok "%wc" */
-                               /* EMPTY */;
-#else
-                               (void) printf("%wc", sep1);
-#endif
-                       else
-                               (void) putwchar(L'\n');
-               }
-       }
-}
-
-
-static int
-cmp(s1, s2)
-wchar_t *s1, *s2;
-{
-       int     rc;
-
-       if (s1 == (wchar_t *)NULL) {
-               if (s2 == (wchar_t *)NULL)
-                       rc = 0;
-               else
-                       rc = -1;
-       } else if (s2 == (wchar_t *)NULL)
-               rc = 1;
-       else
-               rc = wscoll(s1, s2);
-
-       return (rc);
-}
-
-
-static void
-Usage()
-{
-       (void) fprintf(stderr, gettext(
-       "usage: join [-a file_number | -v file_number] [-o list [-e string]]\n"
-       "            [-t char] [-1 field] [-2 field] file1 file2\n\n"
-       "       join [-a file_number] [-j field] [-j1 field] [-j2 field]\n"
-       "            [-o list [-e string]] [-t char] file1 file2\n"));
-       exit(1);
-}
-
-/*
- *  Allocate memory for buffers.
- */
-static void
-init_buf()
-{
-       (void) get_buf(F1, LINE_MAX);
-       (void) get_buf(F2, LINE_MAX);
-       (void) get_ppi(NFLD);
-       (void) get_olist(NOFLD);
-}
-
-
-static void
-get_ppi(nfld)
-int nfld;
-{
-       int i;
-
-       for (i = 0; i < 2; i++) {
-               if (ppi[i]) {
-                       if ((ppi[i] = (wchar_t **)realloc((char *)ppi[i],
-                               (unsigned)(nfld * sizeof (wchar_t *))))
-                                       == NULL) {
-                               (void) fprintf(stderr,
-                               gettext("realloc pointer table failed\n"));
-                               exit(1);
-                       }
-               } else {
-                       if ((ppi[i] = (wchar_t **)calloc((unsigned)nfld,
-                               (unsigned)sizeof (wchar_t *))) == NULL) {
-                               (void) fprintf(stderr,
-                                   gettext("calloc pointer table failed\n"));
-                               exit(1);
-                       }
-               }
-       }
-
-       CNFLD = nfld;
-}
-
-
-static void
-get_buf(i, size)
-int i;
-int size;
-{
-       if (buf[i]) {
-               if ((buf[i] = (wchar_t *)
-                       realloc(buf[i], (unsigned)(size * sizeof (wchar_t))))
-                           == NULL) {
-                       (void) fprintf(stderr,
-                           gettext("realloc input buffer failed\n"));
-                       exit(1);
-               }
-       } else {
-               if ((buf[i] = (wchar_t *)
-                       calloc((unsigned)size, (unsigned)sizeof (wchar_t)))
-                               == NULL) {
-                       (void) fprintf(stderr,
-                               gettext("calloc input buffer failed\n"));
-                       exit(1);
-               }
-       }
-
-       CBUFSIZE[i] = size;
-}
-
-
-static void
-get_olist(onfld)
-int onfld;
-{
-       if (olist) {
-               if ((olist = (int *)realloc((wchar_t *)olist,
-                       (unsigned)(onfld * sizeof (int)))) == NULL) {
-                       (void) fprintf(stderr,
-                           gettext("realloc olist failed\n"));
-                       exit(1);
-               }
-       } else {
-               if ((olist = (int *)
-                       calloc((unsigned)onfld, (unsigned)sizeof (int)))
-                           == NULL) {
-                       (void) fprintf(stderr,
-                                   gettext("calloc olist failed\n"));
-                       exit(1);
-               }
-       }
-
-       if (olistf) {
-               if ((olistf = (int *)realloc((wchar_t *)olistf,
-                       (unsigned)(onfld * sizeof (int)))) == NULL) {
-                       (void) fprintf(stderr,
-                           gettext("realloc olistf failed\n"));
-               exit(1);
-               }
-       } else {
-               if ((olistf = (int *)
-                   calloc((unsigned)onfld, (unsigned)sizeof (int)))
-                       == NULL) {
-                   (void) fprintf(stderr, gettext("calloc olistf failed\n"));
-                       exit(1);
-               }
-       }
-
-       CNOFLD = onfld;
-}
--- old/usr/src/cmd/join/join.xcl       Fri Sep 25 05:24:25 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,26 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-msgid ""
-msgid "%wc"
-msgid "\n"
-msgid "join: "
-msgid "r"
--- old/usr/src/cmd/ksh/Makefile.testshell      Fri Sep 25 05:24:27 2009
+++ new/usr/src/cmd/ksh/Makefile.testshell      Fri Sep 25 05:24:25 2009
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -101,7 +101,7 @@
            printf "# which ksh='%s', ksh93='%s'\n" \
                "$$(which ksh)" "$$(which ksh93)" ; \
        ) ; \
-       if [[ "$$(isalist)" != ~(E)$(LIBSHELLMACH) ]] ; then \
+       if [[ "$$(isalist)" != ~(F)$(LIBSHELLMACH) ]] ; then \
            printf \
                "# ISA='%s' not available on this system, skipping tests...\n" \
                "$(LIBSHELLMACH)" ; \
@@ -135,6 +135,7 @@
                            "$$(basename "$${test_item}")" \
                            "$${mode%:*}"; \
                        ( \
+                           ulimit -s 65536 ; \
                            test_output="$$( ( \
                                export \
                                    SHELL="$(SRC)/cmd/ksh/$(LIBSHELLMACH)/ksh" \
--- old/usr/src/cmd/ksh/builtins/Makefile       Fri Sep 25 05:24:29 2009
+++ new/usr/src/cmd/ksh/builtins/Makefile       Fri Sep 25 05:24:28 2009
@@ -30,29 +30,43 @@
 ALIASPROG= \
        bg \
        cd \
+       cksum \
+       cmp \
+       comm \
        command \
+       cut \
        fc \
        fg \
        getopts \
        hash \
        jobs \
+       join \
        kill \
+       logname \
+       paste \
+       print \
        read \
        rev \
        sleep \
        sum \
+       tee \
        test \
        type \
        ulimit \
        umask \
        unalias \
-       wait
+       uniq \
+       wait \
+       wc
 
 include ../../Makefile.cmd
+$(SPARC_BLD)include ../../Makefile.cmd.64
 
 ROOTALIASPROG= $(ALIASPROG:%=$(ROOTBIN)/%)
 
 FILEMODE= 555
+OWNER= root
+GROUP= bin
 
 .KEEP_STATE:
 
@@ -61,8 +75,6 @@
 $(ROOTBIN)/%: $(ROOTBIN)/alias
        $(INS.link)
 
-include ../../Makefile.cmd
-
 .KEEP_STATE:
 
 # Set common AST build flags (e.g., needed to support the math stuff).
@@ -73,12 +85,19 @@
 
 SRCS=  $(OBJECTS:%.o=%.c)
 
-LDLIBS += -lshell -last
+GROUP= bin
+LDLIBS += -lshell -lcmd -last
 
 CPPFLAGS = \
        $(DTEXTDOM) $(DTS_ERRNO) \
        -I$(ROOT)/usr/include/ast
 
+# Enable workaround for a crash in /usr/bin/alias when invalid
+# options are passed (e.g. $ /usr/bin/alias -c #). The shell
+# code will call an error handler which does a |longjmp()| but
+# somehow the code failed to do the |setjmp()| before this point.
+CPPFLAGS += -DWORKAROUND_FOR_ALIAS_CRASH
+
 CFLAGS += \
        $(ASTCFLAGS)
 CFLAGS64 += \
--- old/usr/src/cmd/ksh/builtins/alias.c        Fri Sep 25 05:24:32 2009
+++ new/usr/src/cmd/ksh/builtins/alias.c        Fri Sep 25 05:24:30 2009
@@ -33,8 +33,99 @@
 
 #include <shell.h>
 #include <nval.h>
+#include <cmdext.h>
 #include <stdio.h>
 
+typedef struct {
+       const char *name;
+       int (* func)(int, char **, void *);
+} bfastpathrec;
+
+/*
+ * List of libcmd builtins which do not require a |Shell_t| context.
+ * This list was automatically generated from <ast/cmdext.h>
+ */
+static const
+bfastpathrec fastpath_builtins[] =
+{
+       /* This list must be alphabetically sorted for |strcmp()| usage */
+       { "basename",   b_basename      },
+       { "cat",        b_cat           },
+       { "chgrp",      b_chgrp         },
+       { "chmod",      b_chmod         },
+       { "chown",      b_chown         },
+       { "cksum",      b_cksum         },
+       { "cmp",        b_cmp           },
+       { "comm",       b_comm          },
+       { "cp",         b_cp            },
+       { "cut",        b_cut           },
+       { "date",       b_date          },
+       { "dirname",    b_dirname       },
+       { "egrep",      b_egrep         },
+       { "expr",       b_expr          },
+       { "fds",        b_fds           },
+       { "fgrep",      b_fgrep         },
+       { "fmt",        b_fmt           },
+       { "fold",       b_fold          },
+       { "getconf",    b_getconf       },
+       { "grep",       b_grep          },
+       { "head",       b_head          },
+       { "id",         b_id            },
+       { "join",       b_join          },
+       { "ln",         b_ln            },
+       { "logname",    b_logname       },
+       { "md5sum",     b_md5sum        },
+       { "mkdir",      b_mkdir         },
+       { "mkfifo",     b_mkfifo        },
+       { "mktemp",     b_mktemp        },
+       { "mv",         b_mv            },
+       { "paste",      b_paste         },
+       { "pathchk",    b_pathchk       },
+       { "pids",       b_pids          },
+       { "readlink",   b_readlink      },
+       { "rev",        b_rev           },
+       { "rm",         b_rm            },
+       { "rmdir",      b_rmdir         },
+       { "stty",       b_stty          },
+       { "sum",        b_sum           },
+       { "sync",       b_sync          },
+       { "tail",       b_tail          },
+       { "tee",        b_tee           },
+       { "tty",        b_tty           },
+       { "uname",      b_uname         },
+       { "uniq",       b_uniq          },
+       { "wc",         b_wc            },
+       { "xgrep",      b_xgrep         },
+       { NULL,         (int (*)(int, char **, void *))NULL }
+};
+
+static inline
+const bfastpathrec *
+find_bfastpathrec(const char *name)
+{
+       unsigned int i;
+       signed int cmpres;
+       for (i = 0; fastpath_builtins[i].name != NULL; i++) {
+               cmpres = strcmp(fastpath_builtins[i].name, name);
+               if (cmpres == 0)
+                       return (&fastpath_builtins[i]);
+               else if (cmpres > 0)
+                       return (NULL);
+
+       }
+       return (NULL);
+}
+
+static inline
+int
+fastpath_builtin_main(const bfastpathrec *brec, int argc, char *argv[])
+{
+       setlocale(LC_ALL, ""); /* calls |_ast_setlocale()| */
+
+       return ((*brec->func)(argc, argv, NULL));
+}
+
+
 /* Builtin script, original derived from alias.sh */
 static const char *script = "\n"
 /* Get name of builtin */
@@ -58,12 +149,27 @@
 "if [[ \"${cmd}\" == \"command\" ]] ; then\n"
        "command \"$...@\"\n"
 "else\n"
+#ifdef WORKAROUND_FOR_ALIAS_CRASH
+/*
+ * Work around a crash in /usr/bin/alias when invalid options are
+ * passed (e.g. $ /usr/bin/alias -c #). The shell code will call
+ * an error handler which does a |longjmp()| but somehow the code
+ * failed to do the |setjmp()| before this point.
+ * Putting the "alias" command in a subshell avoids the crash.
+ * Real cause of the issue is under investigation and a fix be
+ * delivered with the next ast-ksh update.
+ */
+       "( \"${cmd}\" \"$...@\" )\n"
+#else
        "\"${cmd}\" \"$...@\"\n"
+#endif /* WORKAROUND_FOR_ALIAS_CRASH */
 "fi\n"
 "exitval=$?";
 
+
+static inline
 int
-main(int argc, char *argv[])
+script_builtin_main(int argc, char *argv[])
 {
        int i;
        Shell_t *shp;
@@ -97,4 +203,36 @@
        nv_close(np);
 
        return (exitval);
+}
+
+int
+main(int argc, char *argv[])
+{
+       const char *progname;
+       const bfastpathrec *brec;
+       char execnamebuff[PATH_MAX+1];
+
+       /* Get program name */
+       if (pathprog(argv[0], execnamebuff, sizeof (execnamebuff)) <= 0)
+               error(ERROR_exit(1), "could not determinate exec name.");
+
+       progname = (const char *)strrchr(execnamebuff, '/');
+       if (progname != NULL) {
+               progname++;
+       }
+       else
+       {
+               progname = execnamebuff;
+       }
+
+       /* Execute command... */
+       if (brec = find_bfastpathrec(progname)) {
+               /* ... either via a fast path (calling the code directly) ... */
+               return (fastpath_builtin_main(brec, argc, argv));
+       }
+       else
+       {
+               /* ... or from within a full shell. */
+               return (script_builtin_main(argc, argv));
+       }
 }
--- old/usr/src/cmd/logname/Makefile    Fri Sep 25 05:24:34 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,45 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-#ident "%Z%%M% %I%     %E% SMI"
-#
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-PROG= logname
-
-include ../Makefile.cmd
-
-CFLAGS += $(CCVERBOSE)
-
-.KEEP_STATE:
-
-all: $(PROG) 
-
-install: all $(ROOTPROG)
-
-clean:
-
-lint:  lint_PROG
-
-include ../Makefile.targ
--- old/usr/src/cmd/logname/logname.c   Fri Sep 25 05:24:36 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,54 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*     Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/*       All Rights Reserved   */
-
-
-#pragma ident  "%Z%%M% %I%     %E% SMI"
-
-#include <unistd.h>
-#include <libintl.h>
-#include <locale.h>
-#include <stdio.h>
-
-int
-main(void)
-{
-       char *name;
-
-       (void) setlocale(LC_ALL, "");
-#if !defined(TEXT_DOMAIN)              /* Should be defined by cc -D */
-#define        TEXT_DOMAIN "SYS_TEST"          /* Use this only if it weren't 
*/
-#endif
-       (void) textdomain(TEXT_DOMAIN);
-
-       if ((name = getlogin()) == NULL)
-               return (1);
-       (void) puts(name);
-       return (0);
-}
--- old/usr/src/cmd/nsadmin/ksh.kshrc   Fri Sep 25 05:24:38 2009
+++ new/usr/src/cmd/nsadmin/ksh.kshrc   Fri Sep 25 05:24:36 2009
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -35,6 +35,8 @@
        set -o gmacs
        # enable multiline input mode
        set -o multiline
+       # enable globstar mode (match subdirs with **/)
+       set -o globstar
 fi
 
 # Set a default prompt (<username>@<hostname>:<path><"($|#) ">) if
@@ -66,10 +68,12 @@
 # - Make sure to use absolute paths (e.g. /usr/bin/hostname) to make
 #   sure PS1 works in cases where PATH does not contain /usr/bin/
 if [[ "$(set)" != ~(E)PS1= && "${PS1}" == '' ]] ; then
-       PS1='$(printf "%*s\r%s" COLUMNS "")${logna...@$(/usr/bin/hostname):$(
-               ellip="$(
+       PS1='$(set +o xtrace +o errexit
+                printf "%*s\r%s" COLUMNS ""
+                printf "%...@%s:" "${LOGNAME}" "$(/usr/bin/hostname)"
+               ellip="${
                        [[ "${LC_ALL}/${LANG}" == ~(Elr)(.*UTF-8/.*|/.*UTF-8) 
]] &&
-                               printf "\u[2026]\n" || print "..." )"
+                               printf "\u[2026]\n" || print "..." ; }"
                p="${PWD/~(El)${HOME}/\~}"
                (( ${#p} > 30 )) &&
                        print -r -n -- "${ellip}${p:${#p}-30:30}" ||
--- old/usr/src/cmd/paste/Makefile      Fri Sep 25 05:24:41 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,46 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-#ident "%Z%%M% %I%     %E% SMI"
-#
-# Copyright (c) 1989,1996 by Sun Microsystems, Inc.
-# All rights reserved.
-#
-
-PROG= paste
-
-include ../Makefile.cmd
-
-XGETFLAGS += -a -x $(PROG).xcl
-CPPFLAGS += -D_FILE_OFFSET_BITS=64
-
-.KEEP_STATE:
-
-all: $(PROG) 
-
-install: all $(ROOTPROG)
-
-clean:
-
-lint:  lint_PROG
-
-include ../Makefile.targ
--- old/usr/src/cmd/paste/paste.c       Fri Sep 25 05:24:43 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,268 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 1994 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*
- *     Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
- *       All Rights Reserved
- */
-
-#pragma ident  "%Z%%M% %I%     %E% SMI"
-
-#include <stdio.h>
-#include <locale.h>
-#include <widec.h>
-#include <stdlib.h>
-#include <limits.h>
-
-
-#define        MAXOPNF 12      /* maximal no. of open files (not with -s 
option) */
-#define        MAXOPNF_STR     "12"
-#define        RUB     '\177'
-
-
-/*
- * Function prototypes
- */
-static void    diag(char *, char *);
-static int     move(char *, wchar_t *);
-static void    usage();
-
-int
-main(int argc, char **argv)
-{
-       int             i, j, k, eofcount, nfiles, maxline, glue;
-       int             delcount = 1;
-       int             onefile  = 0;
-       register        int c;
-       wchar_t         del[LINE_MAX];
-       wchar_t         outbuf[LINE_MAX], l, t;
-       register        wchar_t *p;
-       FILE            *inptr[MAXOPNF];
-       int             arg_ind;
-       int             file_ind;
-       int             error = 0;
-
-
-       /* Get locale variables from environment */
-       (void) setlocale(LC_ALL, "");
-
-#if !defined(TEXT_DOMAIN)      /* Should be defined by cc -D */
-#define        TEXT_DOMAIN "SYS_TEST"  /* Use this only if it weren't */
-#endif
-       (void) textdomain(TEXT_DOMAIN);
-
-       del[0] = '\t';
-       maxline = LINE_MAX -2;
-
-       /* Get command arguments */
-       while ((c = getopt(argc, argv, "d:s")) != EOF) {
-               switch (c) {
-               case 'd' :
-                       delcount = move(optarg, del);
-                       if (delcount < 1)
-                               diag("paste: no delimiters\n", NULL);
-                       break;
-
-               case 's' :
-                       onefile++;
-                       break;
-
-               case '?':
-                       usage();
-
-                       /* NOTREACHED */
-                       break;
-               }
-       }
-
-       if (!onefile) { /* not -s option: parallel line merging */
-
-               /* Find explicit stdin and file names */
-               for (file_ind = 0, arg_ind = optind; arg_ind < argc &&
-                   file_ind < MAXOPNF; arg_ind++) {
-                       if (argv[arg_ind][0] == '-' &&
-                           argv[arg_ind][1] == '\0') {
-                               inptr[file_ind++] = stdin;
-                       } else if (arg_ind >= optind) {
-                               inptr[file_ind++] = fopen(argv[arg_ind], "r");
-                               if (inptr[file_ind -1] == NULL) {
-                                       diag("paste: cannot open %s\n",
-                                           argv[arg_ind]);
-                               }
-                       }
-               }
-               if (arg_ind < argc) {
-                       char    maxopnf_buf[LINE_MAX];
-                       (void) sprintf(maxopnf_buf, "%d", MAXOPNF);
-                       diag("paste: too many files- limit %s\n", maxopnf_buf);
-               }
-               nfiles = file_ind;
-
-               do {
-                       p = &outbuf[0];
-                       eofcount = 0;
-                       j = k = 0;
-                       for (i = 0; i < nfiles; i++) {
-                               while ((c = fgetwc(inptr[i])) != '\n' &&
-                                   c != EOF) {
-                                       if (++j <= maxline)
-                                               *p++ = c;
-                                       else {
-                                               diag(
-                                                   "paste: line too long\n",
-                                                   NULL);
-                                       }
-                               }
-                               if ((l = del[k]) != RUB)
-                                       *p++ = l;
-
-                               k = (k + 1) % delcount;
-
-                               if (c == EOF)
-                                       eofcount++;
-                       }
-                       if (l != RUB)
-                               *--p = '\n';
-                       else
-                               *p = '\n';
-                       *++p = 0;
-                       if (eofcount < nfiles)
-                               (void) printf("%ws", outbuf);
-               } while (eofcount < nfiles);
-
-       } else { /* -s option: serial file pasting (old 127 paste command) */
-
-               for (i = optind; i < argc; i++) {
-                       p = &outbuf[0];
-                       glue = 0;
-                       j = 0;
-                       k = 0;
-                       t = 0;
-                       if (argv[i][0] == '-' &&
-                           argv[i][1] == '\0') {
-                               inptr[0] = stdin;
-                       } else if (i >= optind) {
-                               inptr[0] = fopen(argv[i], "r");
-                               if (inptr[0] == NULL) {
-                                   (void) fprintf(stderr, gettext(
-                                       "paste: cannot open %s\n"), argv[i]);
-                                   error = 1;
-                               }
-                       }
-
-                       /* Argument not a file name */
-                       if (inptr[0] == NULL) {
-                               continue;
-                       }
-
-                       while ((c = fgetwc(inptr[0])) != EOF) {
-                               if (j >= maxline) {
-                                       t = *--p;
-                                       *++p = 0;
-                                       (void) printf("%ws", outbuf);
-                                       p = &outbuf[0];
-                                       j = 0;
-                               }
-                               if (glue) {
-                                       glue = 0;
-                                       l = del[k];
-                                       if (l != RUB) {
-                                               *p++ = l;
-                                               t = l;
-                                               j++;
-                                       }
-                                       k = (k + 1) % delcount;
-                               }
-                               if (c != '\n') {
-                                       *p++ = c;
-                                       t = c;
-                                       j++;
-                               } else glue++;
-                       }
-                       if (t != '\n') {
-                               *p++ = '\n';
-                               j++;
-                       }
-                       if (j > 0) {
-                               *p = 0;
-                               (void) printf("%ws", outbuf);
-                       }
-               }
-       }
-       return (error);
-}
-
-
-static void
-diag(char *s, char *arg)
-{
-       (void) fprintf(stderr, gettext(s), arg);
-       exit(1);
-}
-
-
-static int
-move(char *from, wchar_t *to)
-{
-       int i, n;
-       wchar_t wc;
-
-       i = 0;
-       while (*from) {
-               n = mbtowc(&wc, from, MB_CUR_MAX);
-               if (n <= 0)
-                       return (0); /* invalid character as a delimiter */
-               from += n;
-               if (wc != L'\\') *to++ = wc;
-               else {
-                       n = mbtowc(&wc, from, MB_CUR_MAX);
-                       if (n <= 0)
-                               return (0);
-                       from += n;
-                       switch (wc) {
-                               case L'0' : *to++ = RUB;
-                                               break;
-                               case L't' : *to++ = L'\t';
-                                               break;
-                               case L'n' : *to++ = L'\n';
-                                               break;
-                               default  : *to++ = wc;
-                                               break;
-                       }
-               }
-               i++;
-       }
-       return (i);
-}
-
-
-static void
-usage()
-{
-       (void) fprintf(stderr, gettext(
-       "usage: paste [-s] [-d list] file  \n\n"));
-       exit(1);
-}
--- old/usr/src/cmd/paste/paste.xcl     Fri Sep 25 05:24:45 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,24 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-msgid ""
-msgid "%ws"
-msgid "r"
--- old/usr/src/cmd/shcomp/Makefile     Fri Sep 25 05:24:47 2009
+++ new/usr/src/cmd/shcomp/Makefile     Fri Sep 25 05:24:45 2009
@@ -27,6 +27,7 @@
 SHELL=/usr/bin/ksh93
 
 include ../Makefile.cmd
+$(SPARC_BLD)include ../Makefile.cmd.64
 
 .KEEP_STATE:
 
@@ -42,6 +43,7 @@
 
 SRCS=  $(OBJECTS:%.o=$(LIBSHELLSRC)/%.c)
 
+GROUP= bin
 LDLIBS += -lshell -last
 
 # 1. Make sure that the -D/-U defines in CFLAGS below are in sync
--- old/usr/src/cmd/tee/Makefile        Fri Sep 25 05:24:49 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,50 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-#ident "%Z%%M% %I%     %E% SMI"
-#
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-PROG= tee
-
-include ../Makefile.cmd
-
-CFLAGS += $(CCVERBOSE)
-CPPFLAGS += -D_FILE_OFFSET_BITS=64
-
-#
-# For messaging catalogue file
-XGETFLAGS += -a -x tee.xcl
-
-.KEEP_STATE:
-
-all: $(PROG) 
-
-install: all $(ROOTPROG)
-
-clean:
-
-lint:  lint_PROG
-
-include ../Makefile.targ
--- old/usr/src/cmd/tee/tee.c   Fri Sep 25 05:24:51 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,141 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*     Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/*       All Rights Reserved   */
-
-#pragma ident  "%Z%%M% %I%     %E% SMI"
-
-/*
- * tee - pipe fitting
- */
-
-#include <stdlib.h>
-#include <limits.h>
-#include <signal.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <locale.h>
-
-#define        min(a, b)       ((a) > (b) ? (b) : (a))
-#define        MAXFILES 20
-
-static void stash(int);
-
-static int ofiles = 0;
-static int ispipe = 0;         /* output goes to pipe or special file */
-static int openf[MAXFILES] = { 1 };
-static char in[PIPE_BUF];
-static const char *usage = "usage: tee [-ai] [file...]\n";
-
-int
-main(int argc, char **argv)
-{
-       int             w;
-       int             c;
-       int             aflag           = 0;
-       int             errorcode       = 0;
-       struct stat     buf;
-
-
-       (void) setlocale(LC_ALL, "");
-#if    !defined(TEXT_DOMAIN)   /* Should be defined by cc -D */
-#define        TEXT_DOMAIN "SYS_TEST"  /* Use this only if it weren't. */
-#endif
-       (void) textdomain(TEXT_DOMAIN);
-
-       while ((c = getopt(argc, argv, "ai")) != EOF) {
-               switch (c) {
-                       case 'a':
-                               aflag++;
-                               break;
-                       case 'i':
-                               (void) signal(SIGINT, SIG_IGN);
-                               break;
-                       case '?':
-                               (void) fprintf(stderr, gettext(usage));
-                               exit(1);
-               }
-       }
-       argc -= optind;
-       argv = &argv[optind];
-
-       (void) fstat(1, &buf);
-       if (S_ISFIFO(buf.st_mode) || S_ISCHR(buf.st_mode))
-               ispipe++;
-
-       openf[ofiles++] = 1;
-       while (argc-- > 0 && ofiles < MAXFILES) {
-               openf[ofiles] = open(argv[0],
-                   O_WRONLY|O_CREAT|(aflag ? O_APPEND:O_TRUNC), 0666);
-               if (openf[ofiles] < 0) {
-                       (void) fprintf(stderr, "tee: ");
-                       perror(argv[0]);
-                       errorcode++;
-               } else {
-                       if (fstat(openf[ofiles], &buf) >= 0) {
-                               if (S_ISCHR(buf.st_mode))
-                                       ispipe++;
-                               ofiles++;
-                       } else {
-                               (void) fprintf(stderr, "tee: ");
-                               perror(argv[0]);
-                               errorcode++;
-                       }
-               }
-               argv++;
-       }
-       if (argc >= 0 && ofiles >= MAXFILES) {
-               argv--;
-               (void) fprintf(stderr, gettext("tee: too many input files; "
-                   "ignoring file(s) listed after %s\n"), argv[0]);
-               errorcode++;
-       }
-
-       while ((w = read(0, in, PIPE_BUF)) > 0)
-               stash(w);
-       if (w < 0) {
-               (void) fprintf(stderr, gettext("tee: read error on input\n"));
-               exit(1);
-       }
-       return (errorcode);
-}
-
-static void
-stash(int nbytes)
-{
-       register int k, i, chunk, nb;
-
-       chunk = ispipe ? PIPE_BUF : nbytes;
-       for (i = 0; i < nbytes; i += chunk) {
-               nb = min(chunk, nbytes - i);
-               for (k = 0; k < ofiles; k++)
-                       (void) write(openf[k], in+i, nb);
-       }
-}
--- old/usr/src/cmd/tee/tee.xcl Fri Sep 25 05:24:53 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,23 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-msgid  ""
-msgid  "ai"
--- old/usr/src/cmd/uniq/Makefile       Fri Sep 25 05:24:55 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,46 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-#ident "%Z%%M% %I%     %E% SMI"
-#
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-PROG= uniq
-
-include ../Makefile.cmd
-
-CFLAGS += $(CCVERBOSE)
-
-XGETFLAGS += -a -x uniq.xcl
-.KEEP_STATE:
-
-all: $(PROG) 
-
-install: all $(ROOTPROG)
-
-clean:
-
-lint:  lint_PROG
-
-include ../Makefile.targ
--- old/usr/src/cmd/uniq/uniq.c Fri Sep 25 05:24:57 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,642 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*     Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/*       All Rights Reserved   */
-
-
-#pragma ident  "%Z%%M% %I%     %E% SMI"
-
-/*
- * uniq: delete repeated lines within a file.
- *
- * uniq [-c|-d|-u][-f fields][-s char] [input_file [output_file]]
- * OR:
- * uniq [-c|-d|-u][-n][+m] [input_file [output_file]]
- */
-
-#include <stdio.h>
-#include <ctype.h>
-#include <locale.h>
-#include <stdlib.h>
-#include <libintl.h>
-#include <string.h>
-#include <wchar.h>
-#include <wctype.h>
-
-#define        isWblank(c)     \
-       ((c == 0x09 || c == 0x20) ? 1 : (iswctype((c), _ISBLANK|_ISSPACE)))
-
-
-#define        BLOCKSIZE 1000  /* How much line buffer to allocate at a time */
-
-static int     mcount = 0;     /* # of mutually exclusive flags used   */
-static int     fields = 0;     /* # of fields to be ignored            */
-static int     letters = 0;    /* # of letters to be ignored           */
-static int     linec;
-static char    mode;           /* = [c, d, u]                          */
-static int     uniq;
-static int     mac;            /* our modified argc, after parseargs() */
-static char    **mav;          /* our modified argv, after parseargs() */
-static char    *skip();
-
-/*
- * according to spec 1170 (draft April 8, 1994), there are two
- * ways to use uniq; and both ways are mutually exclusive. we use modeflag
- * to insure that the user doesn't mix these mutually exclusive flags.
- * if the [-f -s] flags are used, modeflag should be 1. if [-n +m] are
- * used, then modeflag should be 2. so the possible values for modeflag are:
- *     0:      [-f,-s] && [-n, +m] weren't specified. default to XBD.
- *     1:      either -f or -s was specified. XBD specification.
- *     2:      either -n or +m was specified. obsolescent usage.
- */
-#define        MODEFLAG_FS     1       /* modeflag bits: -f or -s was 
specified */
-#define        MODEFLAG_NM     2       /* modeflag bits: -n or _m was 
specified */
-
-static int     modeflag = 0;   /* 0,1 = XBD spec. 2 = Obsolescent usage */
-
-
-static char    usage0[] = "uniq [-c|-d|-u][-f fields][-s char]";
-static char    usage1[] = "uniq [-c|-d|-u][-n][+m]";
-
-static void    printe();
-static int     gline(char **buf, int *size);
-static void    pline(char *buf);
-static int     equal(char *b1, char *b2);
-static void    parseargs(int ac, char **av);
-static void    usage();
-
-
-int
-main(int argc, char *argv[])
-{
-       int     c;                      /* for getopt(3C) parsing       */
-       char    *b1 = NULL, *b2 = NULL;
-       int     b1size = BLOCKSIZE, b2size = BLOCKSIZE;
-       FILE *temp;
-
-       (void) setlocale(LC_ALL, "");
-#if !defined(TEXT_DOMAIN)
-#define        TEXT_DOMAIN "SYS_TEST"
-#endif
-       (void) textdomain(TEXT_DOMAIN);
-
-       if ((b1 = ((char *) malloc((unsigned) BLOCKSIZE))) == NULL || (b2 =
-                       ((char *) malloc((unsigned) BLOCKSIZE))) == NULL)
-               printe(gettext("out of memory\n"), "");
-
-       parseargs(argc, argv);  /* reformat all arguments for getopt    */
-
-       /* handle all of uniq's arguments via getopt(3C):               */
-       while ((c = getopt(mac, mav, "n:m:cduf:s:")) != EOF) {
-               switch (c) {
-               case 'n':       /* parseargs() psuedo argument for -#   */
-                       modeflag |= MODEFLAG_NM;
-                       fields = atoi(optarg);
-                       break;
-
-               case 'm':       /* parseargs() psuedo argument for +#   */
-                       modeflag |= MODEFLAG_NM;
-                       letters = atoi(optarg);
-                       break;
-
-               case 'c':       /* -c: precede output lines             */
-                       /* FALLTHROUGH!                                 */
-               case 'd':       /* -d: suppress non-repeated lines      */
-                       /* FALLTHROUGH!                                 */
-               case 'u':       /* -u: suppress repeated lines          */
-                       mcount++;
-                       mode = c;
-                       break;
-
-               case 'f':       /* -f: ignore 1st fields on input lines */
-                       modeflag |= MODEFLAG_FS;
-                       if (isdigit((unsigned char)*optarg) != 0) {
-                               fields = atoi(optarg);
-                       } else {
-                               (void) fprintf(stderr, "uniq -f: %s: %s\n",
-                               gettext("bad fields value"), optarg);
-                               usage();
-                               exit(1);
-                       }
-                       break;
-
-               case 's':       /* -s: ignore 1st chars on comparisons  */
-                       modeflag |= MODEFLAG_FS;
-                       if (isdigit((unsigned char)*optarg) != 0) {
-                               letters = atoi(optarg);
-                       } else {
-                               (void) fprintf(stderr, "uniq -s: %s: %s\n",
-                               gettext("bad fields value"), optarg);
-                               usage();
-                               exit(1);
-                       }
-                       break;
-
-               default:
-                       usage();
-                       exit(2);
-                       break;
-               }
-       }
-
-       /* see if we have any mutually exclusive options:               */
-       if (mcount > 1) {
-               (void) fprintf(stderr,
-                   gettext("Mutually exclusive options were given!\n"));
-               usage();
-               exit(3);
-       }
-
-       /* see if the user mixed the old style usage with the new:      */
-       if (modeflag > MODEFLAG_NM) {
-               (void) fprintf(stderr, gettext(
-                       "Mutually exclusive command lines arguments!\n"));
-               usage();
-               exit(4);
-       }
-
-       /* if there are more arguments than getopt(3C) handled:         */
-       if (mav[optind] != (char *) NULL) {
-               /* if the user specified an input filename:             */
-               if (*mav[optind] != (char) NULL) {
-                       /* if the user didn't specify stdin:            */
-                       if (strcmp(mav[optind], "-") != 0) {
-                               if ((temp = fopen(mav[optind], "r")) == NULL) {
-                                       printe(gettext("cannot open %s\n"),
-                                       mav[optind]);
-                               }
-
-                               (void) fclose(temp);
-                               (void) freopen(mav[optind], "r", stdin);
-                       }
-               }
-
-               /* if the user specified an output filename:            */
-               if ((mav[optind + 1] != (char *) NULL) &&
-               (*mav[optind + 1] != (char) NULL)) {
-                       if (freopen(mav[optind + 1], "w", stdout) == NULL) {
-                               printe(gettext("cannot create %s\n"),
-                               mav[optind + 1]);
-                       }
-               }
-       }
-
-       if (gline(&b1, &b1size))
-               exit(0);
-       for (; ; ) {
-               linec++;
-               if (gline(&b2, &b2size)) {
-                       pline(b1);
-                       exit(0);
-               }
-               if (!equal(b1, b2)) {
-                       pline(b1);
-                       linec = 0;
-                       do {
-                               linec++;
-                               if (gline(&b1, &b1size)) {
-                                       pline(b2);
-                                       exit(0);
-                               }
-                       } while (equal(b1, b2));
-                       pline(b2);
-                       linec = 0;
-               }
-       }
-}
-
-/*
- * Get an input line, dynamically growing the buffer as necessary.
- */
-static int
-gline(buf, size)
-char **buf;
-int *size;
-{
-       register int    c, left = *size;
-       register char   *input = *buf;
-
-       while ((c = getchar()) != '\n')
-       {
-               if (c == EOF)
-                       return (1);
-
-               *input++ = c;
-               if (--left == 0)
-               {
-                       *buf = (char *) realloc(*buf, *size + BLOCKSIZE);
-                       if (*buf == NULL)
-                               printe(gettext("out of memory\n"), "");
-
-                       input = (*buf) + *size;
-                       left = BLOCKSIZE;
-                       *size += BLOCKSIZE;
-               }
-       }
-
-       *input = '\0';
-       return (0);
-}
-
-static void
-pline(buf)
-register char buf[];
-{
-
-       switch (mode) {
-
-       case 'u':
-               if (uniq) {
-                       uniq = 0;
-                       return;
-               }
-               break;
-
-       case 'd':
-               if (uniq) break;
-               return;
-
-       case 'c':
-               (void) printf("%4d ", linec);
-       }
-       uniq = 0;
-       (void) fputs(buf, stdout);
-       (void) putchar('\n');
-}
-
-/*
- * equal: see if two strings are the same, accounting for any skipping.
- *     similar to strcmp(), except that we call skip() first.
- *     output: 1 if the strings are the same. 0 otherwise.
- */
-static int
-equal(b1, b2)
-register char b1[], b2[];
-{
-       b1 = skip(b1);
-       b2 = skip(b2);
-
-       if (strcmp(b1, b2) == 0) {      /* if they're the same,         */
-               uniq++;
-               return (1);
-       }
-
-       return (0);
-}
-
-char *
-skip(char *s)
-{
-       int nf, nl;
-       int clen;               /* # bytes which comprise a mb char     */
-       wchar_t wc;             /* the xlated version of each mb char   */
-
-       nf = nl = 0;
-
-       /*
-        * we want to skip all user-specified fields first, and then
-        * any specified characters. so while there're fields to be
-        * skipped, examine each (possible m.b.) char. for each field,
-        * we first skip all blanks. then we skip any non-blank chars.
-        */
-
-       while (nf++ < fields) {
-               /* skip blank characters (s.b. or m.b) */
-               clen = mbtowc(&wc, s, MB_CUR_MAX);
-               while ((clen > 0) && isWblank(wc)) {
-                       s += clen;
-                       clen = mbtowc(&wc, s, MB_CUR_MAX);
-               }
-
-               if (clen == -1) {
-                       /*
-                        * illegal char found
-                        * treat it as a non-blank single byte char
-                        */
-                       s++;
-                       clen = mbtowc(&wc, s, MB_CUR_MAX);
-               } else if (clen == 0) {
-                       /* EOL found */
-                       break;
-               }
-
-               /* skip non-blank and illegal characters */
-               while (((clen > 0) && !isWblank(wc)) ||
-                       (clen == -1)) {
-                       s += clen > 0 ? clen : 1;
-                       clen = mbtowc(&wc, s, MB_CUR_MAX);
-               }
-
-               /* if we've encountered EOL */
-               if (clen == 0) {
-                       break;
-               }
-       }
-
-       /*
-        * skip all user-specified letters, s.b. or m.b.
-        */
-
-       while (nl++ < letters) {
-               clen = mbtowc(&wc, s, MB_CUR_MAX);
-
-               /* if we've encountered EOL */
-               if (clen == 0) {
-                       break;
-               }
-               s += clen > 0 ? clen : 1;
-
-       }
-       return (s);
-}
-
-static void
-printe(p, s)
-char *p, *s;
-{
-       (void) fprintf(stderr, p, s);
-       exit(1);
-}
-
-
-
-/*
- * parseargs():                modify the args
- *     this routine is used to transform all arguments into a format
- *     which is acceptable to getopt(3C), and which retains backwards
- *     Solaris 2.[0-4] compatibility.
- *
- *     This routine allows us to make full use of getopts, without any
- *     funny argument processing in main().
- *
- *     The other alternative would be to hand-craft the processed arguments
- *     during and after getopt(3C) - which usually leads to uglier code
- *     in main(). I've opted to keep the ugliness isolated down here,
- *     instead of in main().
- *
- *     We leave the following arguments unchanged:
- *             [-c | -d | -u], [-f fields] [-s char].
- *
- *     We modify the following arguments:
- *             -# (a.k.a. -n)  to "-n #"
- *             +# (a.k.a. +n)  to "-m #"
- *
- *     E.g. -3 gets changed to the psuedo argument "-n 3".
- *
- *     N.B.: we *DON'T* map -# to -f, nor +# to -s, as -/+ usage is
- *             mutually exclusive with -f & -s according to the
- *             spec 1170 man page.
- *
- *     Anything after the valid options is assumed to be input or
- *     output filenames.
- *
- */
-static void
-parseargs(ac, av)
-int ac;
-char **av;
-{
-       int i;                  /* current argument                     */
-       int fflag;              /* 0 = haven't found input/output file  */
-       int minusflag;          /* !0 = have hit a "--": end of flags   */
-       size_t sz;              /* size of the argument                 */
-       size_t mav_sz;          /* size of our psuedo argument space    */
-
-       i = mac = fflag = minusflag = 0;        /* proper initializations */
-
-       mav_sz = (size_t) ((ac + 1) * sizeof (char *));
-       if ((mav = malloc(mav_sz)) == (char **) NULL) {
-               perror("malloc failed");
-               exit(1);
-       }
-
-       /* for each argument, see if we need to change things:          */
-       while ((av[i] != (char *) NULL) && (av[i][0] != (char) NULL)) {
-               /*
-                * if we're doing argument processing, and we have
-                * a "+" sign, then it should be of the form: +#.
-                * map it to "-m #".
-                */
-               if ((fflag == 0) && (minusflag == 0) && (av[i][0] == '+')) {
-                       if ((av[i][1] == (char) NULL) ||
-                           (atoi(&av[i][1]) <= 0)) {
-                               /*
-                                * The user did not follow the + with a
-                                * positive decimal integer.
-                                * Exit here because we don't want getopt() to
-                                * print an error message about the -m option,
-                                * since it doesn't exist in the man page!
-                                */
-                               usage();
-                               exit(1);
-                       }
-                       /* since we're adding an arg, need to inc mav space */
-                       mav_sz += sizeof (char *);
-                       if ((mav = realloc(mav, mav_sz)) == (char **) NULL) {
-                               perror("realloc failed");
-                               exit(1);
-                       }
-
-                       if ((mav[mac] = malloc(sizeof ("-m") + 1)) ==
-                           (char *) NULL) {
-                               perror("malloc failed");
-                               exit(1);
-                       }
-
-                       (void) strcpy(mav[mac], "-m");
-                       ++mac;          /* prepare for 2nd argument     */
-
-
-                       /* add the arg to our modified space    */
-                       if ((mav[mac] = malloc(strlen(&av[i][1]) + 1)) ==
-                           (char *) NULL) {
-                               perror("malloc failed");
-                               exit(1);
-                       }
-
-                       (void) strcpy(mav[mac++], &av[i++][1]);
-                       continue;
-               }
-
-               /*
-                * Here we need to see if the user typed -#, where # is
-                * a positive integer.
-                * Allow for input file named "-" (standard input).
-                */
-               if ((fflag == 0) && (minusflag == 0) && (av[i][0] == '-') &&
-                   (av[i][1] != (char) NULL) && (atoi(&av[i][1]) > 0)) {
-                       /* this user did, so convert it to "-n #".      */
-
-                       /* since we're adding an arg, need to inc mav space */
-                       mav_sz += sizeof (char *);
-                       if ((mav = realloc(mav, mav_sz)) == (char **) NULL) {
-                               perror("realloc failed");
-                               exit(1);
-                       }
-
-                       if ((mav[mac] = malloc(sizeof ("-n") + 1)) ==
-                           (char *) NULL) {
-                               perror("malloc failed");
-                               exit(1);
-                       }
-
-                       (void) strcpy(mav[mac++], "-n");
-
-                       if ((mav[mac] = malloc(strlen(&av[i][1] + 1))) ==
-                           (char *) NULL) {
-                               perror("malloc failed");
-                               exit(1);
-                       }
-
-                       (void) strcpy(mav[mac++], &av[i++][1]);
-                       continue;
-               }
-
-               /* the rest should be normal argument processing:       */
-
-               /* first copy the argument:                             */
-               sz = strlen(&av[i][0]);
-               if ((mav[mac] = malloc(sz + 1)) == (char *) NULL) {
-                       perror("malloc failed");
-                       exit(1);
-               }
-
-               (void) strcpy(mav[mac], av[i]);
-
-               /* see if we need to do any further processing:         */
-               if ((av[i][0] == '-') && (av[i][1] != (char) NULL) &&
-               (minusflag == 0)) {
-
-                       switch (av[i][1]) {
-                       /*
-                        * start of all the other expected arguments.
-                        * here we keep continuing - eventually we'll
-                        * either run out of arguments, or we'll run
-                        * into the input & output files (after which
-                        * we terminate this loop).
-                        */
-
-                       /* flags without subarguments:                  */
-                       case    'c':    /* FALLTHROUGH                  */
-                       case    'd':    /* FALLTHROUGH                  */
-                       case    'u':
-                               break; /* no more processing required   */
-
-
-                       /* flags with required subarguments:            */
-                       case    'f':    /* FALLTHROUGH                  */
-                       case    's':
-                               if (av[i][2] == (char) NULL) {
-                                       /*
-                                        * The user has put white space
-                                        * between the option and its argument;
-                                        * alloc some space, & add the next
-                                        * arg.
-                                        */
-                                       ++mac;  /* inc our arg count    */
-                                       ++i;    /* mv to next (sub)arg  */
-
-                                       /*
-                                        * If there's no next argument, then
-                                        * simply return; getopt(3C) will
-                                        * print a message about the missing
-                                        * option argument.
-                                        */
-                                       if ((av[i] == (char *) NULL) ||
-                                           av[i][0] == (char) NULL)
-                                               return;
-                                       else {
-                                               /* add the subargument */
-                                               mav[mac] = malloc(
-                                                       strlen(&av[i][0]));
-                                               if (mav[mac] == (char *) NULL) {
-                                                       perror("malloc failed");
-                                                       exit(1);
-                                               }
-                                               (void) strcpy(mav[mac],
-                                                               &av[i][0]);
-                                       }
-                               }
-
-                               break;
-
-                       case    '-':    /* --: end of arguments         */
-                               minusflag = 1;
-                               break;
-
-                       default:
-                               /*
-                                * no flags == input/output file. inc
-                                * fflag, so that:
-                                *      - we do no further argument processing.
-                                *      - we know apriori that there will
-                                *              be no more than 2 files.
-                                * we leave if we hit the second file.
-                                */
-                               if (++fflag >= 2) {
-                                       /*
-                                        * we've copied the file argument
-                                        * already, so leave.
-                                        */
-                                       mav[++mac] = (char *) NULL;
-                                       return;
-                               }
-
-                               break;
-                       }
-               } else if (i > 0) {     /* if we're not the 1st arg     */
-                       /*
-                        * here it's not a flag, so it *must* be either
-                        * the input or the output file, including stdin.
-                        *
-                        * set fflag, so we don't mishandle the -[cdu] flags.
-                        */
-                       if (++fflag >= 2) {
-                               /*
-                                * we've copied the file argument
-                                * already, so leave.
-                                */
-                               mav[++mac] = (char *) NULL;
-                               return;
-                       }
-               }
-
-               mac++;
-               i++;
-       }
-
-       mav[mac] = (char *) NULL;
-}
-
-static void
-usage()
-{
-       (void) fprintf(stderr, "Usage:\t%s [input_file [output_file]]\n",
-               usage0);
-       (void) fprintf(stderr, "Or:\t%s [input_file [output_file]]\n",
-               usage1);
-}
--- old/usr/src/cmd/uniq/uniq.xcl       Fri Sep 25 05:24:59 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,25 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-msgid ""
-msgid "%4d "
-msgid "r"
-msgid "w"
--- old/usr/src/cmd/wc/Makefile Fri Sep 25 05:25:01 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,45 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-#ident "%Z%%M% %I%     %E% SMI"
-#
-# Copyright (c) 1989,1996 by Sun Microsystems, Inc.
-# All rights reserved.
-#
-
-PROG= wc
-
-include ../Makefile.cmd
-
-CPPFLAGS += -D_FILE_OFFSET_BITS=64
-
-.KEEP_STATE:
-
-all: $(PROG) 
-
-install: all $(ROOTPROG)
-
-clean:
-
-lint:  lint_PROG
-
-include ../Makefile.targ
--- old/usr/src/cmd/wc/wc.c     Fri Sep 25 05:25:03 2009
+++ /dev/null   Fri Sep 25 04:33:01 2009
@@ -1,266 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*     Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/*       All Rights Reserved   */
-
-
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident  "%Z%%M% %I%     %E% SMI"
-
-/*
- *     wc -- word and line count
- */
-
-#include       <stdio.h>
-#include       <limits.h>
-#include       <locale.h>
-#include       <wctype.h>
-#include       <stdlib.h>
-#include       <errno.h>
-#include       <string.h>
-#include       <euc.h>
-
-#undef BUFSIZ
-#define        BUFSIZ  4096
-unsigned char  b[BUFSIZ];
-
-FILE *fptr = stdin;
-unsigned long long     wordct;
-unsigned long long     twordct;
-unsigned long long     linect;
-unsigned long long     tlinect;
-unsigned long long     charct;
-unsigned long long     tcharct;
-unsigned long long     real_charct;
-unsigned long long     real_tcharct;
-
-int cflag = 0, mflag = 0, lflag = 0, wflag = 0;
-
-static void wcp(unsigned long long, unsigned long long,
-       unsigned long long, unsigned long long);
-static void usage(void);
-
-int
-main(int argc, char **argv)
-{
-       unsigned char *p1, *p2;
-       unsigned int c;
-       int     flag;
-       int     i, token;
-       int     status = 0;
-       wchar_t wc;
-       int     len, n, errflag;
-
-
-       (void) setlocale(LC_ALL, "");
-#if !defined(TEXT_DOMAIN)              /* Should be defined by cc -D */
-#define        TEXT_DOMAIN     "SYS_TEST"      /* Use this only if it weren't 
*/
-#endif
-       (void) textdomain(TEXT_DOMAIN);
-
-
-       while ((flag = getopt(argc, argv, "cCmlw")) != EOF) {
-               switch (flag) {
-               case 'c':
-                       if (mflag)
-                               usage();
-
-                       cflag++;
-                       break;
-
-               case 'C':
-               case 'm':               /* POSIX.2 */
-                       if (cflag)
-                               usage();
-                       mflag++;
-                       break;
-
-               case 'l':
-                       lflag++;
-                       break;
-
-               case 'w':
-                       wflag++;
-                       break;
-
-               default:
-                       usage();
-                       break;
-               }
-       }
-
-       argc -= optind;
-       argv = &argv[optind];
-
-       /*
-        * If no flags set, use defaults
-        */
-       if (cflag == 0 && mflag == 0 && lflag == 0 && wflag == 0) {
-               cflag = 1;
-               lflag = 1;
-               wflag = 1;
-       }
-
-       i = 0;
-       do {
-               if (argc > 0 && (fptr = fopen(argv[i], "r")) == NULL) {
-                       (void) fprintf(stderr, "wc: %s: %s\n",
-                           argv[i], strerror(errno));
-                       status = 2;
-                       continue;
-               }
-
-               p1 = p2 = b;
-               linect = 0;
-               wordct = 0;
-               charct = 0;
-               real_charct = 0;
-               token = 0;
-               errflag = 0;
-               for (;;) {
-                       if (p1 >= p2) {
-                               p1 = b;
-                               c = fread(p1, 1, BUFSIZ, fptr);
-                               if (c == 0) {
-                                       if (feof(fptr))
-                                               break;
-                                       /*
-                                        * skip the file and generate error
-                                        * message when failed to read the
-                                        * file.
-                                        */
-                                       if (ferror(fptr)) {
-                                               (void) fprintf(stderr, gettext(
-                                                   "wc: cannot read %s: %s\n"),
-                                                   argv[i], strerror(errno));
-                                               status = 2;
-                                               errflag = 1;
-                                               break;
-                                       }
-                               }
-                               charct += c;
-                               p2 = p1+c;
-                       }
-                       c = *p1++;
-                       real_charct++;
-                       if (ISASCII(c)) {
-                               if (isspace(c)) {
-                                       if (c == '\n')
-                                               linect++;
-                                       token = 0;
-                                       continue;
-                               }
-
-                               if (!token) {
-                                       wordct++;
-                                       token++;
-                               }
-                       } else {
-                               p1--;
-                               if ((len = (p2 - p1)) <
-                                               (unsigned int)MB_CUR_MAX) {
-                                       for (n = 0; n < len; n++)
-                                               b[n] = *p1++;
-                                       p1 = b;
-                                       p2 = p1 + n;
-                                       c = fread(p2, 1, BUFSIZ - n, fptr);
-                                       if ((int)c > 0) {
-                                               charct += c;
-                                               p2 += c;
-                                       }
-                               }
-
-                               if ((len = (p2 - p1)) >
-                                               (unsigned int)MB_CUR_MAX)
-                                       len = (unsigned int)MB_CUR_MAX;
-                               if ((len = mbtowc(&wc, (char *)p1, len)) > 0) {
-                                       p1 += len;
-                                       if (iswspace(wc)) {
-                                               token = 0;
-                                               continue;
-                                       }
-                               } else
-                                       p1++;
-                               if (!token) {
-                                       wordct++;
-                                       token++;
-                               }
-                       }
-               }
-               /* print lines, words, chars */
-printwc:
-               (void) fclose(fptr);
-               if (errflag)
-                       continue;
-
-               wcp(charct, wordct, linect, real_charct);
-               if (argc > 0) {
-                       (void) printf(" %s\n", argv[i]);
-               }
-               else
-                       (void) printf("\n");
-               tlinect += linect;
-               twordct += wordct;
-               tcharct += charct;
-               real_tcharct += real_charct;
-       } while (++i < argc);
-
-       if (argc > 1) {
-               wcp(tcharct, twordct, tlinect, real_tcharct);
-               (void) printf(" total\n");
-       }
-       return (status);
-}
-
-static void
-wcp(
-       unsigned long long charct,
-       unsigned long long wordct,
-       unsigned long long linect,
-       unsigned long long real_charct)
-{
-       if (lflag)
-               (void) printf((linect < 10000000) ? " %7llu" :
-                       " %llu", linect);
-
-       if (wflag)
-               (void) printf((wordct < 10000000) ? " %7llu" :
-                       " %llu", wordct);
-
-       if (cflag)
-               (void) printf((charct < 10000000) ? " %7llu" :
-                       " %llu", charct);
-       else if (mflag)
-               (void) printf((real_charct < 10000000) ? " %7llu" :
-                       " %llu", real_charct);
-}
-
-static void
-usage()
-{
-       (void) fprintf(stderr, gettext(
-               "usage: wc [-c | -m | -C] [-lw] [file ...]\n"));
-       exit(2);
-}
--- old/usr/src/lib/libast/Makefile.com Fri Sep 25 05:25:05 2009
+++ new/usr/src/lib/libast/Makefile.com Fri Sep 25 05:25:03 2009
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -235,6 +235,7 @@
        common/path/pathpath.o \
        common/path/pathposix.o \
        common/path/pathprobe.o \
+       common/path/pathprog.o \
        common/path/pathrepl.o \
        common/path/pathsetlink.o \
        common/path/pathshell.o \
@@ -372,6 +373,7 @@
        common/stdio/asprintf.o \
        common/stdio/clearerr.o \
        common/stdio/fclose.o \
+       common/stdio/fcloseall.o \
        common/stdio/fdopen.o \
        common/stdio/feof.o \
        common/stdio/ferror.o \
@@ -383,6 +385,7 @@
        common/stdio/fgetws.o \
        common/stdio/fileno.o \
        common/stdio/flockfile.o \
+       common/stdio/fmemopen.o \
        common/stdio/fopen.o \
        common/stdio/fprintf.o \
        common/stdio/fpurge.o \
@@ -406,6 +409,8 @@
        common/stdio/fwscanf.o \
        common/stdio/getc.o \
        common/stdio/getchar.o \
+       common/stdio/getdelim.o \
+       common/stdio/getline.o \
        common/stdio/getw.o \
        common/stdio/getwc.o \
        common/stdio/getwchar.o \
@@ -428,7 +433,6 @@
        common/stdio/sprintf.o \
        common/stdio/sscanf.o \
        common/stdio/stdio_c99.o \
-       common/stdio/stdio_gnu.o \
        common/stdio/swprintf.o \
        common/stdio/swscanf.o \
        common/stdio/tmpfile.o \
@@ -502,6 +506,7 @@
        common/string/strmode.o \
        common/string/strnacmp.o \
        common/string/strncopy.o \
+       common/string/strnpcmp.o \
        common/string/strntod.o \
        common/string/strntol.o \
        common/string/strntold.o \
@@ -510,7 +515,9 @@
        common/string/strntoul.o \
        common/string/strntonll.o \
        common/string/strntoull.o \
+       common/string/strnvcmp.o \
        common/string/stropt.o \
+       common/string/strpcmp.o \
        common/string/strperm.o \
        common/string/strpsearch.o \
        common/string/strsearch.o \
@@ -522,6 +529,7 @@
        common/string/strtonll.o \
        common/string/struid.o \
        common/string/struniq.o \
+       common/string/strvcmp.o \
        common/string/swapget.o \
        common/string/swapmem.o \
        common/string/swapop.o \
@@ -549,6 +557,7 @@
        common/tm/tmweek.o \
        common/tm/tmword.o \
        common/tm/tmxdate.o \
+       common/tm/tmxduration.o \
        common/tm/tmxfmt.o \
        common/tm/tmxgettime.o \
        common/tm/tmxleap.o \
@@ -704,7 +713,7 @@
        '-DCONF_LIBSUFFIX=".so"' \
        '-DCONF_LIBPREFIX="lib"' \
        -DERROR_CATALOG=\""libast"\" \
-       -D__OBSOLETE__=20080101 \
+       -D__OBSOLETE__=20090101 \
        -D_BLD_ast \
        -D_PACKAGE_ast \
        -D_BLD_DLL
@@ -727,9 +736,12 @@
 pics/common/misc/translate.o           := CERRWARN += 
-erroff=E_INTEGER_OVERFLOW_DETECTED
 pics/common/path/pathkey.o             := CERRWARN += 
-erroff=E_CONST_PROMOTED_UNSIGNED_LONG
 pics/common/port/astconf.o             := CERRWARN += 
-erroff=E_CONST_OBJ_SHOULD_HAVE_INITIZR
+pics/common/stdio/fflush.o             := CERRWARN += 
-erroff=E_NO_IMPLICIT_DECL_ALLOWED
+pics/common/stdio/getline.o            := CERRWARN += 
-erroff=E_NO_IMPLICIT_DECL_ALLOWED
 pics/common/sfio/sfmove.o              := CERRWARN += 
-erroff=E_NO_IMPLICIT_DECL_ALLOWED
 pics/common/sfio/sfrd.o                := CERRWARN += 
-erroff=E_NO_IMPLICIT_DECL_ALLOWED
 pics/common/sfio/sfvscanf.o            := CERRWARN += 
-erroff=E_END_OF_LOOP_CODE_NOT_REACHED
+pics/common/tm/tmxduration.o           := CERRWARN += 
-erroff=E_NO_IMPLICIT_DECL_ALLOWED
 
 .KEEP_STATE:
 
--- old/usr/src/lib/libast/amd64/include/ast/align.h    Fri Sep 25 05:25:07 2009
+++ new/usr/src/lib/libast/amd64/include/ast/align.h    Fri Sep 25 05:25:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/align.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/align.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_align_ast
 #define _def_align_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/include/ast/ast.h      Fri Sep 25 05:25:10 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast.h      Fri Sep 25 05:25:08 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -185,7 +185,7 @@
 #define mbcoll()       (ast.mb_xfrm!=0)
 #define mbwide()       (mbmax()>1)
 
-#define mbchar(p)      
(mbwide()?((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),mbmax()))>0?((p+=ast.tmp_int),ast.tmp_wchar):(p++,ast.tmp_int)):(*(unsigned
 char*)(p++)))
+#define mbchar(p)      
(mbwide()?((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),mbmax()))>0?((p+=ast.tmp_int),ast.tmp_wchar):(p+=ast.mb_sync+1,ast.tmp_int)):(*(unsigned
 char*)(p++)))
 #define mbinit()       
(mbwide()?(*ast.mb_towc)((wchar_t*)0,(char*)0,mbmax()):0)
 #define mbsize(p)      (mbwide()?(*ast.mb_len)((char*)(p),mbmax()):((p),1))
 #define mbconv(s,w)    (ast.mb_conv?(*ast.mb_conv)(s,w):((*(s)=(w)),1))
@@ -309,6 +309,7 @@
 extern __MANGLE__ char*                pathpath __PROTO__((char*, const char*, 
const char*, int));
 extern __MANGLE__ size_t               pathposix __PROTO__((const char*, 
char*, size_t));
 extern __MANGLE__ char*                pathprobe __PROTO__((char*, char*, 
const char*, const char*, const char*, int));
+extern __MANGLE__ size_t               pathprog __PROTO__((const char*, char*, 
size_t));
 extern __MANGLE__ char*                pathrepl __PROTO__((char*, const char*, 
const char*));
 extern __MANGLE__ int          pathsetlink __PROTO__((const char*, const 
char*));
 extern __MANGLE__ char*                pathshell __PROTO__((void));
@@ -329,6 +330,7 @@
 extern __MANGLE__ int          strmode __PROTO__((const char*));
 extern __MANGLE__ int          strnacmp __PROTO__((const char*, const char*, 
size_t));
 extern __MANGLE__ char*                strncopy __PROTO__((char*, const char*, 
size_t));
+extern __MANGLE__ int          strnpcmp __PROTO__((const char*, const char*, 
size_t));
 extern __MANGLE__ double               strntod __PROTO__((const char*, size_t, 
char**));
 extern __MANGLE__ _ast_fltmax_t        strntold __PROTO__((const char*, 
size_t, char**));
 extern __MANGLE__ long         strntol __PROTO__((const char*, size_t, char**, 
int));
@@ -337,7 +339,9 @@
 extern __MANGLE__ unsigned long        strntoul __PROTO__((const char*, 
size_t, char**, int));
 extern __MANGLE__ intmax_t             strntonll __PROTO__((const char*, 
size_t, char**, char*, int));
 extern __MANGLE__ uintmax_t    strntoull __PROTO__((const char*, size_t, 
char**, int));
+extern __MANGLE__ int          strnvcmp __PROTO__((const char*, const char*, 
size_t));
 extern __MANGLE__ int          stropt __PROTO__((const char*, const __V_*, 
int, int(*)(__V_*, const __V_*, int, const char*), __V_*));
+extern __MANGLE__ int          strpcmp __PROTO__((const char*, const char*));
 extern __MANGLE__ int          strperm __PROTO__((const char*, char**, int));
 extern __MANGLE__ __V_*                strpsearch __PROTO__((const __V_*, 
size_t, size_t, const char*, char**));
 extern __MANGLE__ __V_*                strsearch __PROTO__((const __V_*, 
size_t, size_t, Strcmp_f, const char*, __V_*));
@@ -350,6 +354,7 @@
 extern __MANGLE__ intmax_t             strtonll __PROTO__((const char*, 
char**, char*, int));
 extern __MANGLE__ int          struid __PROTO__((const char*));
 extern __MANGLE__ int          struniq __PROTO__((char**, int));
+extern __MANGLE__ int          strvcmp __PROTO__((const char*, const char*));
 
 #undef __MANGLE__
 #define __MANGLE__ __LINKAGE__
--- old/usr/src/lib/libast/amd64/include/ast/ast_botch.h        Fri Sep 25 
05:25:12 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_botch.h        Fri Sep 25 
05:25:10 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/botch.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/botch.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_botch_ast
 #define _def_botch_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/include/ast/ast_ccode.h        Fri Sep 25 
05:25:14 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_ccode.h        Fri Sep 25 
05:25:13 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/ccode
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/ccode
 by iffe version 2009-05-01 : : */
 #ifndef _def_ccode_ast
 #define _def_ccode_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/include/ast/ast_common.h       Fri Sep 25 
05:25:17 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_common.h       Fri Sep 25 
05:25:15 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/common
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/common
 by iffe version 2009-05-01 : : */
 #ifndef _AST_COMMON_H
 #define _AST_COMMON_H  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -177,9 +177,6 @@
 #define _typ_uintmax_t 1       /* uintmax_t is a type */
 
 #ifndef va_listref
-#define va_listref(p) (&(p))   /* pass va_list to varargs function */
-#define va_listval(p) (*(p))   /* retrieve va_list from va_arg(ap,va_listarg) 
*/
-#define va_listarg va_list*    /* va_arg() va_list type */
 #ifndef        va_start
 #if __STD_C
 #include <stdarg.h>
@@ -187,6 +184,9 @@
 #include <varargs.h>
 #endif
 #endif
+#define va_listref(p) (&(p))   /* pass va_list to varargs function */
+#define va_listval(p) (*(p))   /* retrieve va_list from va_arg(ap,va_listarg) 
*/
+#define va_listarg va_list*    /* va_arg() va_list type */
 #endif
 #ifndef _AST_STD_H
 #      if __STD_C && _hdr_stddef
--- old/usr/src/lib/libast/amd64/include/ast/ast_dir.h  Fri Sep 25 05:25:19 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_dir.h  Fri Sep 25 05:25:17 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/ast_dirent.h       Fri Sep 25 
05:25:21 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_dirent.h       Fri Sep 25 
05:25:19 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/dirent
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/dirent
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_dirent_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/include/ast/ast_fcntl.h        Fri Sep 25 
05:25:24 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_fcntl.h        Fri Sep 25 
05:25:22 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/fcntl.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/fcntl.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_fcntl_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/amd64/include/ast/ast_float.h        Fri Sep 25 
05:25:26 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_float.h        Fri Sep 25 
05:25:24 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/float
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/float
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_float_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/include/ast/ast_fs.h   Fri Sep 25 05:25:28 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_fs.h   Fri Sep 25 05:25:27 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/fs
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/fs
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_fs_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/include/ast/ast_iconv.h        Fri Sep 25 
05:25:31 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_iconv.h        Fri Sep 25 
05:25:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/iconv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/iconv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_iconv_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/include/ast/ast_lib.h  Fri Sep 25 05:25:33 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_lib.h  Fri Sep 25 05:25:31 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/lib
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/lib
 by iffe version 2009-05-01 : : */
 #ifndef _def_lib_ast
 #define _def_lib_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/include/ast/ast_limits.h       Fri Sep 25 
05:25:36 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_limits.h       Fri Sep 25 
05:25:34 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/limits.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/limits.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_limits_ast
 #define _def_limits_ast        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/include/ast/ast_map.h  Fri Sep 25 05:25:38 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_map.h  Fri Sep 25 05:25:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/map.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/map.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_map_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
@@ -219,6 +219,8 @@
 #define pathposix      _ast_pathposix
 #undef pathprobe
 #define pathprobe      _ast_pathprobe
+#undef pathprog
+#define pathprog       _ast_pathprog
 #undef pathrepl
 #define pathrepl       _ast_pathrepl
 #undef pathsetlink
--- old/usr/src/lib/libast/amd64/include/ast/ast_mmap.h Fri Sep 25 05:25:41 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_mmap.h Fri Sep 25 05:25:39 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/mmap
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/mmap
 by iffe version 2009-05-01 : : */
 #ifndef _def_mmap_ast
 #define _def_mmap_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -28,6 +28,7 @@
 #define _lib_mmap64    1       /* mmap64 interface and implementation work */
 #define _mmap_anon     1       /* use mmap MAP_ANON to get raw memory */
 #define _mmap_devzero  1       /* use mmap on /dev/zero to get raw memory */
+#define _mmap_worthy   2       /* mmap is good */
 
 /* some systems get it wrong but escape concise detection */
 #ifndef _NO_MMAP
--- old/usr/src/lib/libast/amd64/include/ast/ast_mode.h Fri Sep 25 05:25:43 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_mode.h Fri Sep 25 05:25:41 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/mode.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/mode.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_mode_ast
 #define _def_mode_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/include/ast/ast_namval.h       Fri Sep 25 
05:25:46 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_namval.h       Fri Sep 25 
05:25:44 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/ast_ndbm.h Fri Sep 25 05:25:48 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_ndbm.h Fri Sep 25 05:25:46 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/ndbm
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/ndbm
 by iffe version 2009-05-01 : : */
 #ifndef _def_ndbm_ast
 #define _def_ndbm_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/include/ast/ast_nl_types.h     Fri Sep 25 
05:25:50 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_nl_types.h     Fri Sep 25 
05:25:48 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/nl_types
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/nl_types
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_nl_types_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/include/ast/ast_param.h        Fri Sep 25 
05:25:53 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_param.h        Fri Sep 25 
05:25:51 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/param.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/param.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_param_ast
 #define _def_param_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/include/ast/ast_standards.h    Fri Sep 25 
05:25:55 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_standards.h    Fri Sep 25 
05:25:53 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,29 +19,11 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/standards
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/standards
 by iffe version 2009-05-01 : : */
 #ifndef _def_standards_ast
 #define _def_standards_ast     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-/* _ALL_SOURCE & _ISOC99_SOURCE & _POSIX_SOURCE & _POSIX_C_SOURCE & 
_XOPEN_SOURCE & __EXTENSIONS__ works */
-#ifndef _ALL_SOURCE
-#define _ALL_SOURCE    1
-#endif
-#ifndef _ISOC99_SOURCE
-#define _ISOC99_SOURCE 1
-#endif
-#ifndef _POSIX_SOURCE
-#define _POSIX_SOURCE  1
-#endif
-#ifndef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE        21000101L
-#endif
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE  9900
-#endif
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE    1
-#endif
+/* __EXTENSIONS__ works */
 #ifndef __EXTENSIONS__
 #define __EXTENSIONS__ 1
 #endif
--- old/usr/src/lib/libast/amd64/include/ast/ast_std.h  Fri Sep 25 05:25:57 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_std.h  Fri Sep 25 05:25:56 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -117,9 +117,18 @@
 #define __MANGLE__ __LINKAGE__         __EXPORT__
 #endif
 
+#if !_UWIN /* for ast54 compatibility */
+
 #undef getenv
 #define getenv         _ast_getenv
 
+#undef setenviron
+#define setenviron     _ast_setenviron
+
+extern __MANGLE__ char*                getenv __PROTO__((const char*));
+
+#endif
+
 #undef localeconv
 #define localeconv     _ast_localeconv
 
@@ -126,13 +135,9 @@
 #undef setlocale
 #define setlocale      _ast_setlocale
 
-#undef setenviron
-#define setenviron     _ast_setenviron
-
 #undef strerror
 #define strerror       _ast_strerror
 
-extern __MANGLE__ char*                getenv __PROTO__((const char*));
 extern __MANGLE__ struct lconv*        localeconv __PROTO__((void));
 extern __MANGLE__ char*                setenviron __PROTO__((const char*));
 extern __MANGLE__ char*                setlocale __PROTO__((int, const char*));
@@ -248,8 +253,9 @@
        int             (*mb_conv) __PROTO__((char*, wchar_t));
 
        uint32_t        env_serial;
+       uint32_t        mb_sync;
 
-       char            pad[944];
+       char            pad[940];
 
 } _Ast_info_t;
 
--- old/usr/src/lib/libast/amd64/include/ast/ast_stdio.h        Fri Sep 25 
05:26:00 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_stdio.h        Fri Sep 25 
05:25:58 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/stdio
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/stdio
 by iffe version 2009-05-01 : : */
                   
 #ifndef _SFSTDIO_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/include/ast/ast_sys.h  Fri Sep 25 05:26:02 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_sys.h  Fri Sep 25 05:26:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/sys
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/sys
 by iffe version 2009-05-01 : : */
                   
 #ifndef _AST_SYS_H
 #if !defined(__PROTO__)
@@ -125,7 +125,6 @@
 #include <limits.h>
 #include <fcntl.h>
 #include <locale.h>
-#include <sys/localedef.h>
 #define _hdr_time      1       /* #include <time.h> ok */
 #define _sys_time      1       /* #include <sys/time.h> ok */
 #define _sys_times     1       /* #include <sys/times.h> ok */
--- old/usr/src/lib/libast/amd64/include/ast/ast_time.h Fri Sep 25 05:26:05 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_time.h Fri Sep 25 05:26:03 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/time
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/time
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_time_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/include/ast/ast_tty.h  Fri Sep 25 05:26:07 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_tty.h  Fri Sep 25 05:26:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/tty
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/tty
 by iffe version 2009-05-01 : : */
 #ifndef _def_tty_ast
 #define _def_tty_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/include/ast/ast_version.h      Fri Sep 25 
05:26:10 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_version.h      Fri Sep 25 
05:26:08 2009
@@ -7,4 +7,4 @@
 #if !defined(__LINKAGE__)
 #define __LINKAGE__            /* 2004-08-11 transition */
 #endif
-#define _AST_VERSION   20080910L
+#define _AST_VERSION   20090202L
--- old/usr/src/lib/libast/amd64/include/ast/ast_vfork.h        Fri Sep 25 
05:26:12 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_vfork.h        Fri Sep 25 
05:26:10 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/vfork
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/vfork
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_vfork_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/include/ast/ast_wait.h Fri Sep 25 05:26:15 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_wait.h Fri Sep 25 05:26:13 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/wait
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/wait
 by iffe version 2009-05-01 : : */
 #ifndef _def_wait_ast
 #define _def_wait_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/include/ast/ast_wchar.h        Fri Sep 25 
05:26:17 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_wchar.h        Fri Sep 25 
05:26:15 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/wchar
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/wchar
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_wchar_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/include/ast/ast_windows.h      Fri Sep 25 
05:26:19 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ast_windows.h      Fri Sep 25 
05:26:18 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/bytesex.h  Fri Sep 25 05:26:22 2009
+++ new/usr/src/lib/libast/amd64/include/ast/bytesex.h  Fri Sep 25 05:26:20 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/ccode.h    Fri Sep 25 05:26:24 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ccode.h    Fri Sep 25 05:26:22 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/cdt.h      Fri Sep 25 05:26:26 2009
+++ new/usr/src/lib/libast/amd64/include/ast/cdt.h      Fri Sep 25 05:26:24 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/debug.h    Fri Sep 25 05:26:29 2009
+++ new/usr/src/lib/libast/amd64/include/ast/debug.h    Fri Sep 25 05:26:27 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -55,14 +55,17 @@
 #define DEBUG_ASSERT(p)                ((p) ? 0 : (debug_fatal(__FILE__, 
__LINE__),0))
 #define DEBUG_COUNT(n)         ((n) += 1)
 #define DEBUG_TALLY(c,n,v)     ((c) ? ((n) += (v)) : (n))
+#define DEBUG_INCREASE(n)      ((n) += 1)
+#define DEBUG_DECREASE(n)      ((n) -= 1)
 #define DEBUG_DECLARE(t,v)     t v
 #define DEBUG_SET(n,v)         ((n) = (v))
 #define DEBUG_PRINT(fd,s,v)    do {char 
_b[1024];write(fd,_b,sfsprintf(_b,sizeof(_b),s,v));} while(0)
 #define DEBUG_WRITE(fd,d,n)    write((fd),(d),(n))
 #define DEBUG_TEMP(temp)       (temp) /* debugging stuff that should be 
removed */
-#define DEBUG_RETURN(x)                (debug_fatal(__FILE__, __LINE__), (x))
-#define DEBUG_BREAK            (debug_fatal(__FILE__, __LINE__))
+#define DEBUG_BREAK            break
+#define DEBUG_CONTINUE         continue
 #define DEBUG_GOTO(label)      do { debug_fatal(__FILE__, __LINE__); goto 
label; } while(0)
+#define DEBUG_RETURN(x)                do { debug_fatal(__FILE__, __LINE__); 
return(x); } while(0)
 
 #else
 
@@ -75,17 +78,33 @@
 #define DEBUG_ASSERT(p)
 #define DEBUG_COUNT(n)
 #define DEBUG_TALLY(c,n,v)
+#define DEBUG_INCREASE(n)
+#define DEBUG_DECREASE(n)
 #define DEBUG_DECLARE(t,v)
 #define DEBUG_SET(n,v)
 #define DEBUG_PRINT(fd,s,v)
 #define DEBUG_WRITE(fd,d,n)
-#define DEBUG_KPV(x)
-#define DEBUG_RETURN(x)                return(x)
+#define DEBUG_TEMP(x)
 #define DEBUG_BREAK            break
+#define DEBUG_CONTINUE         continue
 #define DEBUG_GOTO(label)      goto label
+#define DEBUG_RETURN(x)                return(x)
 
 #endif
 
+#ifndef BREAK
+#define BREAK                  DEBUG_BREAK
+#endif
+#ifndef CONTINUE
+#define CONTINUE               DEBUG_CONTINUE
+#endif
+#ifndef GOTO
+#define GOTO(label)            DEBUG_GOTO(label)
+#endif
+#ifndef RETURN
+#define RETURN(x)              DEBUG_RETURN(x)
+#endif
+
 #if _BLD_ast && defined(__EXPORT__)
 #undef __MANGLE__
 #define __MANGLE__ __LINKAGE__         __EXPORT__
--- old/usr/src/lib/libast/amd64/include/ast/dirent.h   Fri Sep 25 05:26:31 2009
+++ new/usr/src/lib/libast/amd64/include/ast/dirent.h   Fri Sep 25 05:26:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/dt.h       Fri Sep 25 05:26:34 2009
+++ new/usr/src/lib/libast/amd64/include/ast/dt.h       Fri Sep 25 05:26:32 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/endian.h   Fri Sep 25 05:26:36 2009
+++ new/usr/src/lib/libast/amd64/include/ast/endian.h   Fri Sep 25 05:26:34 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/error.h    Fri Sep 25 05:26:38 2009
+++ new/usr/src/lib/libast/amd64/include/ast/error.h    Fri Sep 25 05:26:36 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/find.h     Fri Sep 25 05:26:41 2009
+++ new/usr/src/lib/libast/amd64/include/ast/find.h     Fri Sep 25 05:26:39 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/fnmatch.h  Fri Sep 25 05:26:43 2009
+++ new/usr/src/lib/libast/amd64/include/ast/fnmatch.h  Fri Sep 25 05:26:41 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/fnv.h      Fri Sep 25 05:26:45 2009
+++ new/usr/src/lib/libast/amd64/include/ast/fnv.h      Fri Sep 25 05:26:43 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/fs3d.h     Fri Sep 25 05:26:48 2009
+++ new/usr/src/lib/libast/amd64/include/ast/fs3d.h     Fri Sep 25 05:26:46 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -104,7 +104,9 @@
 #define FS3D_SIZE(n)   ((n)<<4)
 #define FS3D_SIZEOF(n) ((n)>>4)
 
-extern __MANGLE__ int          mount __PROTO__((const char*, char*, int, 
__V_*));
+#if !_BLD_3d
+#define mount(s,t,f,d) fs3d_mount(s,t,f,d)
+#endif
 
 #if _BLD_ast && defined(__EXPORT__)
 #undef __MANGLE__
@@ -112,6 +114,7 @@
 #endif
 
 extern __MANGLE__ int          fs3d __PROTO__((int));
+extern __MANGLE__ int          fs3d_mount __PROTO__((const char*, char*, int, 
__V_*));
 extern __MANGLE__ char*                pathnext __PROTO__((char*, char*, 
long*));
 
 #undef __MANGLE__
--- old/usr/src/lib/libast/amd64/include/ast/fts.h      Fri Sep 25 05:26:50 2009
+++ new/usr/src/lib/libast/amd64/include/ast/fts.h      Fri Sep 25 05:26:48 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/ftw.h      Fri Sep 25 05:26:53 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ftw.h      Fri Sep 25 05:26:51 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/ftwalk.h   Fri Sep 25 05:26:55 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ftwalk.h   Fri Sep 25 05:26:53 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/glob.h     Fri Sep 25 05:26:57 2009
+++ new/usr/src/lib/libast/amd64/include/ast/glob.h     Fri Sep 25 05:26:55 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/hash.h     Fri Sep 25 05:27:00 2009
+++ new/usr/src/lib/libast/amd64/include/ast/hash.h     Fri Sep 25 05:26:58 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/hashkey.h  Fri Sep 25 05:27:02 2009
+++ new/usr/src/lib/libast/amd64/include/ast/hashkey.h  Fri Sep 25 05:27:00 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/hashpart.h Fri Sep 25 05:27:05 2009
+++ new/usr/src/lib/libast/amd64/include/ast/hashpart.h Fri Sep 25 05:27:03 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/iconv.h    Fri Sep 25 05:27:07 2009
+++ new/usr/src/lib/libast/amd64/include/ast/iconv.h    Fri Sep 25 05:27:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/lc.h       Fri Sep 25 05:27:09 2009
+++ new/usr/src/lib/libast/amd64/include/ast/lc.h       Fri Sep 25 05:27:07 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -38,14 +38,15 @@
 
 #define LC_abbreviated         0x00001
 #define LC_checked             0x00002
-#define LC_default             0x00004
-#define LC_defined             0x00008
-#define LC_debug               0x00010
+#define LC_debug               0x00004
+#define LC_default             0x00008
+#define LC_defined             0x00010
 #define LC_local               0x00020
 #define LC_primary             0x00040
 #define LC_qualified           0x00080
 #define LC_undefined           0x00100
-#define LC_verbose             0x00200
+#define LC_utf8                        0x00200
+#define LC_verbose             0x00400
 #define LC_user                        0x10000
 #define LC_language_attribute_max              2
 #define LC_territory_language_max              4
--- old/usr/src/lib/libast/amd64/include/ast/ls.h       Fri Sep 25 05:27:12 2009
+++ new/usr/src/lib/libast/amd64/include/ast/ls.h       Fri Sep 25 05:27:10 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -76,8 +76,8 @@
 #define LS_USER                (1<<10)         /* first user flag bit          
*/
 
 #define LS_W_BLOCKS    6               /* LS_BLOCKS field width        */
-#define LS_W_INUMBER   7               /* LS_INUMBER field width       */
-#define LS_W_LONG      55              /* LS_LONG width (w/o names)    */
+#define LS_W_INUMBER   9               /* LS_INUMBER field width       */
+#define LS_W_LONG      57              /* LS_LONG width (w/o names)    */
 #define LS_W_LINK      4               /* link text width (w/o names)  */
 #define LS_W_MARK      1               /* LS_MARK field width          */
 #define LS_W_NAME      9               /* group|user name field width  */
--- old/usr/src/lib/libast/amd64/include/ast/magic.h    Fri Sep 25 05:27:14 2009
+++ new/usr/src/lib/libast/amd64/include/ast/magic.h    Fri Sep 25 05:27:12 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/magicid.h  Fri Sep 25 05:27:16 2009
+++ new/usr/src/lib/libast/amd64/include/ast/magicid.h  Fri Sep 25 05:27:14 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/mc.h       Fri Sep 25 05:27:19 2009
+++ new/usr/src/lib/libast/amd64/include/ast/mc.h       Fri Sep 25 05:27:17 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/mime.h     Fri Sep 25 05:27:21 2009
+++ new/usr/src/lib/libast/amd64/include/ast/mime.h     Fri Sep 25 05:27:19 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/mnt.h      Fri Sep 25 05:27:23 2009
+++ new/usr/src/lib/libast/amd64/include/ast/mnt.h      Fri Sep 25 05:27:21 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/modecanon.h        Fri Sep 25 
05:27:26 2009
+++ new/usr/src/lib/libast/amd64/include/ast/modecanon.h        Fri Sep 25 
05:27:24 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/modex.h    Fri Sep 25 05:27:28 2009
+++ new/usr/src/lib/libast/amd64/include/ast/modex.h    Fri Sep 25 05:27:26 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/namval.h   Fri Sep 25 05:27:30 2009
+++ new/usr/src/lib/libast/amd64/include/ast/namval.h   Fri Sep 25 05:27:29 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/nl_types.h Fri Sep 25 05:27:33 2009
+++ new/usr/src/lib/libast/amd64/include/ast/nl_types.h Fri Sep 25 05:27:31 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/option.h   Fri Sep 25 05:27:35 2009
+++ new/usr/src/lib/libast/amd64/include/ast/option.h   Fri Sep 25 05:27:33 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/preroot.h  Fri Sep 25 05:27:38 2009
+++ new/usr/src/lib/libast/amd64/include/ast/preroot.h  Fri Sep 25 05:27:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/preroot.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/preroot.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_preroot_ast
 #define _def_preroot_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/include/ast/proc.h     Fri Sep 25 05:27:40 2009
+++ new/usr/src/lib/libast/amd64/include/ast/proc.h     Fri Sep 25 05:27:38 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/re_comp.h  Fri Sep 25 05:27:42 2009
+++ new/usr/src/lib/libast/amd64/include/ast/re_comp.h  Fri Sep 25 05:27:41 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/recfmt.h   Fri Sep 25 05:27:45 2009
+++ new/usr/src/lib/libast/amd64/include/ast/recfmt.h   Fri Sep 25 05:27:43 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/regex.h    Fri Sep 25 05:27:47 2009
+++ new/usr/src/lib/libast/amd64/include/ast/regex.h    Fri Sep 25 05:27:45 2009
@@ -53,6 +53,8 @@
 #define REG_SHELL_ESCAPED 0x00400000   /* \ not special                */
 #define REG_SHELL_PATH 0x00800000      /* explicit / match             */
 
+#define REG_REGEXP     0x40000000      /* <regexp.h> compatibility     */
+
 /* regexec flags */
 
 #define REG_NOTBOL     0x00000040      /* ^ is not a special char      */
--- old/usr/src/lib/libast/amd64/include/ast/regexp.h   Fri Sep 25 05:27:50 2009
+++ new/usr/src/lib/libast/amd64/include/ast/regexp.h   Fri Sep 25 05:27:48 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/sfdisc.h   Fri Sep 25 05:27:52 2009
+++ new/usr/src/lib/libast/amd64/include/ast/sfdisc.h   Fri Sep 25 05:27:50 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/sfio.h     Fri Sep 25 05:27:55 2009
+++ new/usr/src/lib/libast/amd64/include/ast/sfio.h     Fri Sep 25 05:27:53 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/sfio_s.h   Fri Sep 25 05:27:57 2009
+++ new/usr/src/lib/libast/amd64/include/ast/sfio_s.h   Fri Sep 25 05:27:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/sfio_t.h   Fri Sep 25 05:28:00 2009
+++ new/usr/src/lib/libast/amd64/include/ast/sfio_t.h   Fri Sep 25 05:27:58 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/shcmd.h    Fri Sep 25 05:28:02 2009
+++ new/usr/src/lib/libast/amd64/include/ast/shcmd.h    Fri Sep 25 05:28:00 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -75,18 +75,19 @@
 #   undef Shell_t
 #   undef Namval_t
 #else 
-#   define sh_run(c, ac, av)   ((c)?(*((Shbltin_t*)(c))->shrun)(ac,av):-1)
-#   define sh_system(c,str)    
((c)?(*((Shbltin_t*)(c))->shtrap)(str,0):system(str))
-#   define sh_exit(c,n)                
((c)?(*((Shbltin_t*)(c))->shexit)(n):exit(n))
-#   define sh_checksig(c)      ((c) && ((Shbltin_t*)(c))->sigset)
+#   define sh_context(c)       ((Shbltin_t*)(c))
+#   define sh_run(c, ac, av)   ((c)?(*sh_context(c)->shrun)(ac,av):-1)
+#   define sh_system(c,str)    
((c)?(*sh_context(c)->shtrap)(str,0):system(str))
+#   define sh_exit(c,n)                
((c)?(*sh_context(c)->shexit)(n):exit(n))
+#   define sh_checksig(c)      ((c) && sh_context(c)->sigset)
 #   if defined(SFIO_VERSION) || defined(_AST_H)
 #      define LIB_INIT(c)
 #   else
-#      define LIB_INIT(c)      ((c) && (((Shbltin_t*)(c))->nosfio = 1))
+#      define LIB_INIT(c)      ((c) && (sh_context(c)->nosfio = 1))
 #   endif
 #   ifndef _CMD_H
 #      define cmdinit(ac,av,c,cat,flg)         do { if((ac)<=0) return(0); \
-           (((Shbltin_t*)(c))->notify = ((flg)&ERROR_NOTIFY)?1:0);} while(0)
+           (sh_context(c)->notify = ((flg)&ERROR_NOTIFY)?1:0);} while(0)
 #   endif
 #endif
 
--- old/usr/src/lib/libast/amd64/include/ast/sig.h      Fri Sep 25 05:28:04 2009
+++ new/usr/src/lib/libast/amd64/include/ast/sig.h      Fri Sep 25 05:28:02 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/sig.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/sig.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_sig_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/amd64/include/ast/stack.h    Fri Sep 25 05:28:07 2009
+++ new/usr/src/lib/libast/amd64/include/ast/stack.h    Fri Sep 25 05:28:05 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/stak.h     Fri Sep 25 05:28:09 2009
+++ new/usr/src/lib/libast/amd64/include/ast/stak.h     Fri Sep 25 05:28:07 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/stdio.h    Fri Sep 25 05:28:11 2009
+++ new/usr/src/lib/libast/amd64/include/ast/stdio.h    Fri Sep 25 05:28:09 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/stk.h      Fri Sep 25 05:28:14 2009
+++ new/usr/src/lib/libast/amd64/include/ast/stk.h      Fri Sep 25 05:28:12 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/swap.h     Fri Sep 25 05:28:16 2009
+++ new/usr/src/lib/libast/amd64/include/ast/swap.h     Fri Sep 25 05:28:14 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/tar.h      Fri Sep 25 05:28:18 2009
+++ new/usr/src/lib/libast/amd64/include/ast/tar.h      Fri Sep 25 05:28:16 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/times.h    Fri Sep 25 05:28:21 2009
+++ new/usr/src/lib/libast/amd64/include/ast/times.h    Fri Sep 25 05:28:19 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/tm.h       Fri Sep 25 05:28:23 2009
+++ new/usr/src/lib/libast/amd64/include/ast/tm.h       Fri Sep 25 05:28:21 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -102,8 +102,9 @@
 #define TM_ERA_YEAR            115
 #define TM_ORDINALS            116
 #define TM_FINAL               126
+#define TM_WORK                        129
 
-#define TM_NFORM               129
+#define TM_NFORM               132
 
 typedef struct                         /* leap second info             */
 {
@@ -123,7 +124,7 @@
 typedef struct                         /* tm library readonly data     */
 {
        char**          format;         /* default TM_* format strings  */
-       char*           lex;            /* format lex type classes      */
+       unsigned char*  lex;            /* format lex type classes      */
        char*           digit;          /* output digits                */
        short*          days;           /* days in month i              */
        short*          sum;            /* days in months before i      */
--- old/usr/src/lib/libast/amd64/include/ast/tmx.h      Fri Sep 25 05:28:26 2009
+++ new/usr/src/lib/libast/amd64/include/ast/tmx.h      Fri Sep 25 05:28:24 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/tmx
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/tmx
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TMX_H
 #if !defined(__PROTO__)
@@ -129,6 +129,7 @@
 #endif
 
 extern __MANGLE__ Time_t               tmxdate __PROTO__((const char*, char**, 
Time_t));
+extern __MANGLE__ Time_t               tmxduration __PROTO__((const char*, 
char**));
 extern __MANGLE__ char*                tmxfmt __PROTO__((char*, size_t, const 
char*, Time_t));
 extern __MANGLE__ Time_t               tmxleap __PROTO__((Time_t));
 extern __MANGLE__ Tm_t*                tmxmake __PROTO__((Time_t));
@@ -135,6 +136,7 @@
 extern __MANGLE__ Time_t               tmxscan __PROTO__((const char*, char**, 
const char*, char**, Time_t, long));
 extern __MANGLE__ int          tmxsleep __PROTO__((Time_t));
 extern __MANGLE__ Time_t               tmxtime __PROTO__((Tm_t*, int));
+extern __MANGLE__ Tm_t*                tmxtm __PROTO__((Tm_t*, Time_t, 
Tm_zone_t*));
 
 extern __MANGLE__ Time_t               tmxgettime __PROTO__((void));
 extern __MANGLE__ int          tmxsettime __PROTO__((Time_t));
--- old/usr/src/lib/libast/amd64/include/ast/tok.h      Fri Sep 25 05:28:28 2009
+++ new/usr/src/lib/libast/amd64/include/ast/tok.h      Fri Sep 25 05:28:26 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/tv.h       Fri Sep 25 05:28:31 2009
+++ new/usr/src/lib/libast/amd64/include/ast/tv.h       Fri Sep 25 05:28:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/tv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/tv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TV_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/include/ast/usage.h    Fri Sep 25 05:28:33 2009
+++ new/usr/src/lib/libast/amd64/include/ast/usage.h    Fri Sep 25 05:28:31 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/vdb.h      Fri Sep 25 05:28:35 2009
+++ new/usr/src/lib/libast/amd64/include/ast/vdb.h      Fri Sep 25 05:28:33 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/vecargs.h  Fri Sep 25 05:28:38 2009
+++ new/usr/src/lib/libast/amd64/include/ast/vecargs.h  Fri Sep 25 05:28:36 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/vmalloc.h  Fri Sep 25 05:28:40 2009
+++ new/usr/src/lib/libast/amd64/include/ast/vmalloc.h  Fri Sep 25 05:28:38 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/wait.h     Fri Sep 25 05:28:42 2009
+++ new/usr/src/lib/libast/amd64/include/ast/wait.h     Fri Sep 25 05:28:41 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/wchar.h    Fri Sep 25 05:28:45 2009
+++ new/usr/src/lib/libast/amd64/include/ast/wchar.h    Fri Sep 25 05:28:43 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/include/ast/wordexp.h  Fri Sep 25 05:28:47 2009
+++ new/usr/src/lib/libast/amd64/include/ast/wordexp.h  Fri Sep 25 05:28:45 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/align   Fri Sep 25 
05:28:49 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/align   Fri Sep 25 
05:28:48 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/align.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/align.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_align_ast
 #define _def_align_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/botch   Fri Sep 25 
05:28:52 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/botch   Fri Sep 25 
05:28:50 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/botch.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/botch.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_botch_ast
 #define _def_botch_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/ccode   Fri Sep 25 
05:28:54 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/ccode   Fri Sep 25 
05:28:52 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/ccode
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/ccode
 by iffe version 2009-05-01 : : */
 #ifndef _def_ccode_ast
 #define _def_ccode_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/common  Fri Sep 25 
05:28:56 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/common  Fri Sep 25 
05:28:55 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/common
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/common
 by iffe version 2009-05-01 : : */
 #ifndef _AST_COMMON_H
 #define _AST_COMMON_H  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -156,9 +156,6 @@
 #define _typ_uintmax_t 1       /* uintmax_t is a type */
 
 #ifndef va_listref
-#define va_listref(p) (&(p))   /* pass va_list to varargs function */
-#define va_listval(p) (*(p))   /* retrieve va_list from va_arg(ap,va_listarg) 
*/
-#define va_listarg va_list*    /* va_arg() va_list type */
 #ifndef        va_start
 #if __STD_C
 #include <stdarg.h>
@@ -166,6 +163,9 @@
 #include <varargs.h>
 #endif
 #endif
+#define va_listref(p) (&(p))   /* pass va_list to varargs function */
+#define va_listval(p) (*(p))   /* retrieve va_list from va_arg(ap,va_listarg) 
*/
+#define va_listarg va_list*    /* va_arg() va_list type */
 #endif
 #ifndef _AST_STD_H
 #      if __STD_C && _hdr_stddef
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/dirent  Fri Sep 25 
05:28:59 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/dirent  Fri Sep 25 
05:28:57 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/dirent
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/dirent
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_dirent_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/eaccess Fri Sep 25 
05:29:01 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/eaccess Fri Sep 25 
05:28:59 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/eaccess
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/eaccess
 by iffe version 2009-05-01 : : */
 #ifndef _def_eaccess_ast
 #define _def_eaccess_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/errno   Fri Sep 25 
05:29:03 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/errno   Fri Sep 25 
05:29:02 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/errno
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/errno
 by iffe version 2009-05-01 : : */
 #ifndef _def_errno_ast
 #define _def_errno_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/fcntl   Fri Sep 25 
05:29:06 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/fcntl   Fri Sep 25 
05:29:04 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/fcntl.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/fcntl.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_fcntl_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/float   Fri Sep 25 
05:29:08 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/float   Fri Sep 25 
05:29:06 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/float
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/float
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_float_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/fs      Fri Sep 25 
05:29:11 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/fs      Fri Sep 25 
05:29:09 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/fs
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/fs
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_fs_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/hack    Fri Sep 25 
05:29:13 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/hack    Fri Sep 25 
05:29:11 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/hack
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/hack
 by iffe version 2009-05-01 : : */
 #ifndef _def_hack_ast
 #define _def_hack_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/iconv   Fri Sep 25 
05:29:15 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/iconv   Fri Sep 25 
05:29:13 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/iconv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/iconv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_iconv_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/isoc99  Fri Sep 25 
05:29:17 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/isoc99  Fri Sep 25 
05:29:16 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/isoc99
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/isoc99
 by iffe version 2009-05-01 : : */
 #ifndef _def_isoc99_ast
 #define _def_isoc99_ast        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/lib     Fri Sep 25 
05:29:20 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/lib     Fri Sep 25 
05:29:18 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/lib
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/lib
 by iffe version 2009-05-01 : : */
 #ifndef _def_lib_ast
 #define _def_lib_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/libpath Fri Sep 25 
05:29:22 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/libpath Fri Sep 25 
05:29:20 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/libpath.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/libpath.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_libpath_ast
 #define _def_libpath_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/limits  Fri Sep 25 
05:29:24 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/limits  Fri Sep 25 
05:29:23 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/limits.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/limits.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_limits_ast
 #define _def_limits_ast        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/map     Fri Sep 25 
05:29:27 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/map     Fri Sep 25 
05:29:25 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/map.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/map.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_map_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
@@ -198,6 +198,8 @@
 #define pathposix      _ast_pathposix
 #undef pathprobe
 #define pathprobe      _ast_pathprobe
+#undef pathprog
+#define pathprog       _ast_pathprog
 #undef pathrepl
 #define pathrepl       _ast_pathrepl
 #undef pathsetlink
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mmap    Fri Sep 25 
05:29:29 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mmap    Fri Sep 25 
05:29:27 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/mmap
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/mmap
 by iffe version 2009-05-01 : : */
 #ifndef _def_mmap_ast
 #define _def_mmap_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -7,6 +7,7 @@
 #define _lib_mmap64    1       /* mmap64 interface and implementation work */
 #define _mmap_anon     1       /* use mmap MAP_ANON to get raw memory */
 #define _mmap_devzero  1       /* use mmap on /dev/zero to get raw memory */
+#define _mmap_worthy   2       /* mmap is good */
 
 /* some systems get it wrong but escape concise detection */
 #ifndef _NO_MMAP
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mode    Fri Sep 25 
05:29:32 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mode    Fri Sep 25 
05:29:30 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/mode.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/mode.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_mode_ast
 #define _def_mode_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/ndbm    Fri Sep 25 
05:29:34 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/ndbm    Fri Sep 25 
05:29:32 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/ndbm
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/ndbm
 by iffe version 2009-05-01 : : */
 #ifndef _def_ndbm_ast
 #define _def_ndbm_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/nl_types        Fri Sep 
25 05:29:36 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/nl_types        Fri Sep 
25 05:29:34 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/nl_types
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/nl_types
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_nl_types_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/omitted Fri Sep 25 
05:29:39 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/omitted Fri Sep 25 
05:29:37 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/omitted
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/omitted
 by iffe version 2009-05-01 : : */
 #ifndef _def_omitted_ast
 #define _def_omitted_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/param   Fri Sep 25 
05:29:41 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/param   Fri Sep 25 
05:29:39 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/param.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/param.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_param_ast
 #define _def_param_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/preroot Fri Sep 25 
05:29:43 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/preroot Fri Sep 25 
05:29:41 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/preroot.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/preroot.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_preroot_ast
 #define _def_preroot_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- /dev/null   Fri Sep 25 05:29:46 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/prog    Fri Sep 25 
05:29:44 2009
@@ -0,0 +1,7 @@
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/prog
 by iffe version 2009-05-01 : : */
+#ifndef _def_prog_ast
+#define _def_prog_ast  1
+#define _sys_types     1       /* #include <sys/types.h> ok */
+#define _lib_getexecname       1       /* getexecname() in default lib(s) */
+#define _PROC_PROG     "/proc/self/path/a.out"
+#endif
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sfinit  Fri Sep 25 
05:29:48 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sfinit  Fri Sep 25 
05:29:46 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/sfinit.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/sfinit.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_sfinit_ast
 #define _def_sfinit_ast        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sfio    Fri Sep 25 
05:29:51 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sfio    Fri Sep 25 
05:29:49 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/sfio
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/sfio
 by iffe version 2009-05-01 : : */
 #ifndef _def_sfio_ast
 #define _def_sfio_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sig     Fri Sep 25 
05:29:53 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sig     Fri Sep 25 
05:29:51 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/sig.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/sig.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_sig_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/siglist Fri Sep 25 
05:29:55 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/siglist Fri Sep 25 
05:29:54 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/siglist
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/siglist
 by iffe version 2009-05-01 : : */
 #ifndef _def_siglist_ast
 #define _def_siglist_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -5,6 +5,9 @@
 #define _hdr_string    1       /* #include <string.h> ok */
 #define _hdr_signal    1       /* #include <signal.h> ok */
 #define _lib_strsignal 1       /* strsignal() in default lib(s) */
+#if defined(SIGHUP) && !defined(HAD_SIGHUP)
+0,"HUP",SIGHUP,
+#endif
 #if defined(SIGINT) && !defined(HAD_SIGINT)
 0,"INT",SIGINT,
 #endif
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/signal  Fri Sep 25 
05:29:58 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/signal  Fri Sep 25 
05:29:56 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/signal.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/signal.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_signal_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/standards       Fri Sep 
25 05:30:00 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/standards       Fri Sep 
25 05:29:58 2009
@@ -1,26 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/standards
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/standards
 by iffe version 2009-05-01 : : */
 #ifndef _def_standards_ast
 #define _def_standards_ast     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-/* _ALL_SOURCE & _ISOC99_SOURCE & _POSIX_SOURCE & _POSIX_C_SOURCE & 
_XOPEN_SOURCE & __EXTENSIONS__ works */
-#ifndef _ALL_SOURCE
-#define _ALL_SOURCE    1
-#endif
-#ifndef _ISOC99_SOURCE
-#define _ISOC99_SOURCE 1
-#endif
-#ifndef _POSIX_SOURCE
-#define _POSIX_SOURCE  1
-#endif
-#ifndef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE        21000101L
-#endif
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE  9900
-#endif
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE    1
-#endif
+/* __EXTENSIONS__ works */
 #ifndef __EXTENSIONS__
 #define __EXTENSIONS__ 1
 #endif
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/stdio   Fri Sep 25 
05:30:03 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/stdio   Fri Sep 25 
05:30:01 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/stdio
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/stdio
 by iffe version 2009-05-01 : : */
                   
 #ifndef _SFSTDIO_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sys     Fri Sep 25 
05:30:05 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sys     Fri Sep 25 
05:30:03 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/sys
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/sys
 by iffe version 2009-05-01 : : */
                   
 #ifndef _AST_SYS_H
 #if !defined(__PROTO__)
@@ -104,7 +104,6 @@
 #include <limits.h>
 #include <fcntl.h>
 #include <locale.h>
-#include <sys/localedef.h>
 #define _hdr_time      1       /* #include <time.h> ok */
 #define _sys_time      1       /* #include <sys/time.h> ok */
 #define _sys_times     1       /* #include <sys/times.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/time    Fri Sep 25 
05:30:07 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/time    Fri Sep 25 
05:30:06 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/time
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/time
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_time_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tmlib   Fri Sep 25 
05:30:10 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tmlib   Fri Sep 25 
05:30:08 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/tmlib
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/tmlib
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_tmlib_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tmx     Fri Sep 25 
05:30:12 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tmx     Fri Sep 25 
05:30:10 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/tmx
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/tmx
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TMX_H
 #if !defined(__PROTO__)
@@ -108,6 +108,7 @@
 #endif
 
 extern __MANGLE__ Time_t               tmxdate __PROTO__((const char*, char**, 
Time_t));
+extern __MANGLE__ Time_t               tmxduration __PROTO__((const char*, 
char**));
 extern __MANGLE__ char*                tmxfmt __PROTO__((char*, size_t, const 
char*, Time_t));
 extern __MANGLE__ Time_t               tmxleap __PROTO__((Time_t));
 extern __MANGLE__ Tm_t*                tmxmake __PROTO__((Time_t));
@@ -114,6 +115,7 @@
 extern __MANGLE__ Time_t               tmxscan __PROTO__((const char*, char**, 
const char*, char**, Time_t, long));
 extern __MANGLE__ int          tmxsleep __PROTO__((Time_t));
 extern __MANGLE__ Time_t               tmxtime __PROTO__((Tm_t*, int));
+extern __MANGLE__ Tm_t*                tmxtm __PROTO__((Tm_t*, Time_t, 
Tm_zone_t*));
 
 extern __MANGLE__ Time_t               tmxgettime __PROTO__((void));
 extern __MANGLE__ int          tmxsettime __PROTO__((Time_t));
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tty     Fri Sep 25 
05:30:14 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tty     Fri Sep 25 
05:30:13 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/tty
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/tty
 by iffe version 2009-05-01 : : */
 #ifndef _def_tty_ast
 #define _def_tty_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tv      Fri Sep 25 
05:30:17 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tv      Fri Sep 25 
05:30:15 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/tv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/tv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TV_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tvlib   Fri Sep 25 
05:30:19 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tvlib   Fri Sep 25 
05:30:17 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/tvlib
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/tvlib
 by iffe version 2009-05-01 : : */
 #ifndef _def_tvlib_ast
 #define _def_tvlib_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/uwin    Fri Sep 25 
05:30:22 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/uwin    Fri Sep 25 
05:30:20 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/uwin
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/uwin
 by iffe version 2009-05-01 : : */
 #ifndef _def_uwin_ast
 #define _def_uwin_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/vfork   Fri Sep 25 
05:30:24 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/vfork   Fri Sep 25 
05:30:22 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/vfork
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/vfork
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_vfork_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/vmalloc Fri Sep 25 
05:30:26 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/vmalloc Fri Sep 25 
05:30:25 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/vmalloc
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/vmalloc
 by iffe version 2009-05-01 : : */
 #ifndef _def_vmalloc_ast
 #define _def_vmalloc_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/wait    Fri Sep 25 
05:30:29 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/wait    Fri Sep 25 
05:30:27 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/wait
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/wait
 by iffe version 2009-05-01 : : */
 #ifndef _def_wait_ast
 #define _def_wait_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/wchar   Fri Sep 25 
05:30:31 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/wchar   Fri Sep 25 
05:30:29 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/wchar
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/wchar
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_wchar_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/src/lib/libast/align.h Fri Sep 25 05:30:34 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/align.h Fri Sep 25 05:30:32 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/align.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/align.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_align_ast
 #define _def_align_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_botch.h     Fri Sep 25 
05:30:36 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_botch.h     Fri Sep 25 
05:30:34 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/botch.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/botch.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_botch_ast
 #define _def_botch_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_ccode.h     Fri Sep 25 
05:30:38 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_ccode.h     Fri Sep 25 
05:30:37 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/ccode
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/ccode
 by iffe version 2009-05-01 : : */
 #ifndef _def_ccode_ast
 #define _def_ccode_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_common.h    Fri Sep 25 
05:30:41 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_common.h    Fri Sep 25 
05:30:39 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/common
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/common
 by iffe version 2009-05-01 : : */
 #ifndef _AST_COMMON_H
 #define _AST_COMMON_H  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -156,9 +156,6 @@
 #define _typ_uintmax_t 1       /* uintmax_t is a type */
 
 #ifndef va_listref
-#define va_listref(p) (&(p))   /* pass va_list to varargs function */
-#define va_listval(p) (*(p))   /* retrieve va_list from va_arg(ap,va_listarg) 
*/
-#define va_listarg va_list*    /* va_arg() va_list type */
 #ifndef        va_start
 #if __STD_C
 #include <stdarg.h>
@@ -166,6 +163,9 @@
 #include <varargs.h>
 #endif
 #endif
+#define va_listref(p) (&(p))   /* pass va_list to varargs function */
+#define va_listval(p) (*(p))   /* retrieve va_list from va_arg(ap,va_listarg) 
*/
+#define va_listarg va_list*    /* va_arg() va_list type */
 #endif
 #ifndef _AST_STD_H
 #      if __STD_C && _hdr_stddef
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_dirent.h    Fri Sep 25 
05:30:43 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_dirent.h    Fri Sep 25 
05:30:41 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/dirent
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/dirent
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_dirent_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_fcntl.h     Fri Sep 25 
05:30:45 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_fcntl.h     Fri Sep 25 
05:30:44 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/fcntl.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/fcntl.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_fcntl_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_float.h     Fri Sep 25 
05:30:48 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_float.h     Fri Sep 25 
05:30:46 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/float
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/float
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_float_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_fs.h        Fri Sep 25 
05:30:50 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_fs.h        Fri Sep 25 
05:30:48 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/fs
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/fs
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_fs_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_iconv.h     Fri Sep 25 
05:30:53 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_iconv.h     Fri Sep 25 
05:30:51 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/iconv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/iconv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_iconv_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_lib.h       Fri Sep 25 
05:30:55 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_lib.h       Fri Sep 25 
05:30:53 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/lib
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/lib
 by iffe version 2009-05-01 : : */
 #ifndef _def_lib_ast
 #define _def_lib_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_limits.h    Fri Sep 25 
05:30:57 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_limits.h    Fri Sep 25 
05:30:55 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/limits.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/limits.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_limits_ast
 #define _def_limits_ast        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_map.h       Fri Sep 25 
05:31:00 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_map.h       Fri Sep 25 
05:30:58 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/map.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/map.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_map_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
@@ -198,6 +198,8 @@
 #define pathposix      _ast_pathposix
 #undef pathprobe
 #define pathprobe      _ast_pathprobe
+#undef pathprog
+#define pathprog       _ast_pathprog
 #undef pathrepl
 #define pathrepl       _ast_pathrepl
 #undef pathsetlink
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_mmap.h      Fri Sep 25 
05:31:02 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_mmap.h      Fri Sep 25 
05:31:00 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/mmap
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/mmap
 by iffe version 2009-05-01 : : */
 #ifndef _def_mmap_ast
 #define _def_mmap_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -7,6 +7,7 @@
 #define _lib_mmap64    1       /* mmap64 interface and implementation work */
 #define _mmap_anon     1       /* use mmap MAP_ANON to get raw memory */
 #define _mmap_devzero  1       /* use mmap on /dev/zero to get raw memory */
+#define _mmap_worthy   2       /* mmap is good */
 
 /* some systems get it wrong but escape concise detection */
 #ifndef _NO_MMAP
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_mode.h      Fri Sep 25 
05:31:04 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_mode.h      Fri Sep 25 
05:31:03 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/mode.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/mode.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_mode_ast
 #define _def_mode_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- /dev/null   Fri Sep 25 05:31:07 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_namval.h    Fri Sep 25 
05:31:05 2009
@@ -0,0 +1,42 @@
+/***********************************************************************
+*                                                                      *
+*               This software is part of the ast package               *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
+*                      and is licensed under the                       *
+*                  Common Public License, Version 1.0                  *
+*                    by AT&T Intellectual Property                     *
+*                                                                      *
+*                A copy of the License is available at                 *
+*            http://www.opensource.org/licenses/cpl1.0.txt             *
+*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
+*                                                                      *
+*              Information and Software Systems Research               *
+*                            AT&T Research                             *
+*                           Florham Park NJ                            *
+*                                                                      *
+*                 Glenn Fowler <gsf at research.att.com>                  *
+*                  David Korn <dgk at research.att.com>                   *
+*                   Phong Vo <kpv at research.att.com>                    *
+*                                                                      *
+***********************************************************************/
+#pragma prototyped
+/*
+ * Glenn Fowler
+ * AT&T Research
+ *
+ * common name-value struct support
+ */
+
+#ifndef _NAMVAL_H
+#define _NAMVAL_H
+
+typedef struct
+{
+       char*           name;
+       int             value;
+#ifdef _NAMVAL_PRIVATE_
+       _NAMVAL_PRIVATE_
+#endif
+} Namval_t;
+
+#endif
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_ndbm.h      Fri Sep 25 
05:31:09 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_ndbm.h      Fri Sep 25 
05:31:07 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/ndbm
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/ndbm
 by iffe version 2009-05-01 : : */
 #ifndef _def_ndbm_ast
 #define _def_ndbm_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_nl_types.h  Fri Sep 25 
05:31:11 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_nl_types.h  Fri Sep 25 
05:31:10 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/nl_types
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/nl_types
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_nl_types_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_param.h     Fri Sep 25 
05:31:14 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_param.h     Fri Sep 25 
05:31:12 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/param.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/param.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_param_ast
 #define _def_param_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_standards.h Fri Sep 25 
05:31:16 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_standards.h Fri Sep 25 
05:31:14 2009
@@ -1,26 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/standards
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/standards
 by iffe version 2009-05-01 : : */
 #ifndef _def_standards_ast
 #define _def_standards_ast     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-/* _ALL_SOURCE & _ISOC99_SOURCE & _POSIX_SOURCE & _POSIX_C_SOURCE & 
_XOPEN_SOURCE & __EXTENSIONS__ works */
-#ifndef _ALL_SOURCE
-#define _ALL_SOURCE    1
-#endif
-#ifndef _ISOC99_SOURCE
-#define _ISOC99_SOURCE 1
-#endif
-#ifndef _POSIX_SOURCE
-#define _POSIX_SOURCE  1
-#endif
-#ifndef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE        21000101L
-#endif
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE  9900
-#endif
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE    1
-#endif
+/* __EXTENSIONS__ works */
 #ifndef __EXTENSIONS__
 #define __EXTENSIONS__ 1
 #endif
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_stdio.h     Fri Sep 25 
05:31:19 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_stdio.h     Fri Sep 25 
05:31:17 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/stdio
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/stdio
 by iffe version 2009-05-01 : : */
                   
 #ifndef _SFSTDIO_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_sys.h       Fri Sep 25 
05:31:21 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_sys.h       Fri Sep 25 
05:31:19 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/sys
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/sys
 by iffe version 2009-05-01 : : */
                   
 #ifndef _AST_SYS_H
 #if !defined(__PROTO__)
@@ -104,7 +104,6 @@
 #include <limits.h>
 #include <fcntl.h>
 #include <locale.h>
-#include <sys/localedef.h>
 #define _hdr_time      1       /* #include <time.h> ok */
 #define _sys_time      1       /* #include <sys/time.h> ok */
 #define _sys_times     1       /* #include <sys/times.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_time.h      Fri Sep 25 
05:31:23 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_time.h      Fri Sep 25 
05:31:22 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/time
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/time
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_time_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_tty.h       Fri Sep 25 
05:31:26 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_tty.h       Fri Sep 25 
05:31:24 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/tty
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/tty
 by iffe version 2009-05-01 : : */
 #ifndef _def_tty_ast
 #define _def_tty_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_vfork.h     Fri Sep 25 
05:31:28 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_vfork.h     Fri Sep 25 
05:31:26 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/vfork
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/vfork
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_vfork_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_wait.h      Fri Sep 25 
05:31:31 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_wait.h      Fri Sep 25 
05:31:29 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/wait
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/wait
 by iffe version 2009-05-01 : : */
 #ifndef _def_wait_ast
 #define _def_wait_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/ast_wchar.h     Fri Sep 25 
05:31:33 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/ast_wchar.h     Fri Sep 25 
05:31:31 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/wchar
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/wchar
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_wchar_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/amd64/src/lib/libast/conftab.c       Fri Sep 25 
05:31:35 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/conftab.c       Fri Sep 25 
05:31:33 2009
@@ -10,7 +10,7 @@
 #include "FEATURE/param"
 #include "conftab.h"
 
-/* : : generated by conf from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/comp/conf.tab
 : : */
+/* : : generated by conf from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/comp/conf.tab
 : : */
 
 /*
  * prefix strings -- the first few are indexed by Conf_t.standard
@@ -207,6 +207,7 @@
 { "NL_TEXTMAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, 
-1 },
 { "NO_TRUNC", { 0UL, 0 }, { 0UL, 0 }, 
CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, 
_PC_NO_TRUNC },
 { "NPROCESSORS_CONF", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, 
_SC_NPROCESSORS_CONF },
+{ "NPROCESSORS_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, 
_SC_NPROCESSORS_MAX },
 { "NPROCESSORS_ONLN", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, 
_SC_NPROCESSORS_ONLN },
 { "NPROC_CONF", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, 
CONF_POSIX, 1, CONF_nop, -1 },
 { "NPROC_ONLN", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, 
CONF_POSIX, 1, CONF_nop, -1 },
--- old/usr/src/lib/libast/amd64/src/lib/libast/conftab.h       Fri Sep 25 
05:31:38 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/conftab.h       Fri Sep 25 
05:31:36 2009
@@ -6,7 +6,7 @@
 #endif
 #include <sys/systeminfo.h>
 
-/* : : generated by conf from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/comp/conf.tab
 : : */
+/* : : generated by conf from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/comp/conf.tab
 : : */
 
 #if !defined(const) && !defined(__STDC__) && !defined(__cplusplus) && 
!defined(c_plusplus)
 #define const
--- old/usr/src/lib/libast/amd64/src/lib/libast/lc.h    Fri Sep 25 05:31:40 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/lc.h    Fri Sep 25 05:31:38 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -38,14 +38,15 @@
 
 #define LC_abbreviated         0x00001
 #define LC_checked             0x00002
-#define LC_default             0x00004
-#define LC_defined             0x00008
-#define LC_debug               0x00010
+#define LC_debug               0x00004
+#define LC_default             0x00008
+#define LC_defined             0x00010
 #define LC_local               0x00020
 #define LC_primary             0x00040
 #define LC_qualified           0x00080
 #define LC_undefined           0x00100
-#define LC_verbose             0x00200
+#define LC_utf8                        0x00200
+#define LC_verbose             0x00400
 #define LC_user                        0x10000
 #define LC_language_attribute_max              2
 #define LC_territory_language_max              4
--- old/usr/src/lib/libast/amd64/src/lib/libast/preroot.h       Fri Sep 25 
05:31:43 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/preroot.h       Fri Sep 25 
05:31:41 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/preroot.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/preroot.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_preroot_ast
 #define _def_preroot_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/amd64/src/lib/libast/sig.h   Fri Sep 25 05:31:45 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/sig.h   Fri Sep 25 05:31:43 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/sig.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/sig.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_sig_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/amd64/src/lib/libast/tmx.h   Fri Sep 25 05:31:47 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/tmx.h   Fri Sep 25 05:31:45 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/tmx
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/tmx
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TMX_H
 #if !defined(__PROTO__)
@@ -108,6 +108,7 @@
 #endif
 
 extern __MANGLE__ Time_t               tmxdate __PROTO__((const char*, char**, 
Time_t));
+extern __MANGLE__ Time_t               tmxduration __PROTO__((const char*, 
char**));
 extern __MANGLE__ char*                tmxfmt __PROTO__((char*, size_t, const 
char*, Time_t));
 extern __MANGLE__ Time_t               tmxleap __PROTO__((Time_t));
 extern __MANGLE__ Tm_t*                tmxmake __PROTO__((Time_t));
@@ -114,6 +115,7 @@
 extern __MANGLE__ Time_t               tmxscan __PROTO__((const char*, char**, 
const char*, char**, Time_t, long));
 extern __MANGLE__ int          tmxsleep __PROTO__((Time_t));
 extern __MANGLE__ Time_t               tmxtime __PROTO__((Tm_t*, int));
+extern __MANGLE__ Tm_t*                tmxtm __PROTO__((Tm_t*, Time_t, 
Tm_zone_t*));
 
 extern __MANGLE__ Time_t               tmxgettime __PROTO__((void));
 extern __MANGLE__ int          tmxsettime __PROTO__((Time_t));
--- old/usr/src/lib/libast/amd64/src/lib/libast/tv.h    Fri Sep 25 05:31:50 2009
+++ new/usr/src/lib/libast/amd64/src/lib/libast/tv.h    Fri Sep 25 05:31:48 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/tv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libast/features/tv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TV_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/common/RELEASE       Fri Sep 25 05:31:52 2009
+++ new/usr/src/lib/libast/common/RELEASE       Fri Sep 25 05:31:50 2009
@@ -1,3 +1,57 @@
+09-09-09 sfio/sfputr.c: add SIGPIPE hang fix
+09-08-24 sfio/sfreserve.c: fix SF_UNBOUND logic with pushed streams
+09-08-18 include/ast_std.h,ast.h: add ast.mb_sync to sync mbchar() after error
+09-08-17 comp/setlocale.c: add AST_LC_utf8 and { utf8_mbtowc() utf8_mblen() }
+09-08-11 comp/setlocale.c: treat "en"/"en_US" AST_LC_MESSAGES as "C"/"POSIX"
+09-08-10 vmalloc/vmhdr.h: add user-defined _AST_PAGESIZE and computed 
VMHEAPINCR
+09-08-09 comp/conf.tab: add NPROCESSORS_MAX
+09-07-29 astlicense.c: fix first name=value logic error
+09-07-22 string/fmtip6.c: don't drop trailing 0 in 44::1:0:0
+09-06-30 port/astconf.c: standard PATH_RESOLVE is "physical" (not 
"metaphysical")
+09-06-19 vmalloc: sync with kpv
+09-06-19 include/shcmd.h: add sh_context(p) cast
+09-06-11 misc/magic.tab: differentiate pc 386 32/64 bit dll/exe/obj
+09-06-06 port/astconf.c: fix look->name null pointer reference
+09-06-05 port/astconf.c: fix 'UNIVERSE = value' synthesize logic
+09-05-25 tm/tmxduration.c: add
+09-05-08 comp/syslog.c: add _UWIN /var/log/syslog preference
+09-05-01 comp/setlocale.c: fix _UWIN intercepts to return NiL on unknown 
locales
+09-04-27 sfio/sfpool.c: fix bug that did not return pool on delete
+09-04-22 include/regex.h,regex/regcomp.c: add REG_REGEXP <regexp.h> 
compatibility
+09-04-15 tm/tmxdate.c: handle "4th thursday in november"
+09-03-31 string/strvcmp.c,string/strnvcmp.c: add version strcmp(3)
+09-03-31 string/strpcmp.c,string/strnpcmp.c: add path prefix strcmp(3)
+09-03-29 misc/optget.c: clean up num = number casts
+09-03-04 tm/tmxmake.c: add tmxtm() with zone override
+09-03-03 tm/tmxfmt.c: add %(...)<c>, specifically %(...)z for output zone
+09-02-22 tm/tmxdate.c: add iso P... durations
+09-02-02 path/pathprog.c: add
+09-02-02 misc/opthdr.h,optget.c: fix flags mixup, handle old '-' as option
+09-02-02 sfio/sfprints.c: fix sfvaprints() return value to not count trailing 
'\0'
+09-02-02 misc/cmdarg.c: handle !defined(ARG_MAX)
+09-02-02 port/astconf.c: fix UNIVERSE overwrite of null[] value!
+09-01-31 features/sys: drop header sys/localedef.h
+09-01-28 include/fs3d.h,misc/fs3d.c: mount() => fs3d_mount() for diff std 
prototypes
+09-01-14 misc/fts_open.c: delay top list reorder until first fts_read()
+09-01-14 include/ls.h: LS_W_INUMBER => 9 to accomodate large st_ino
+09-01-14 misc/optget.c: expand STYLE_usage input text
+09-01-09 features/uwin,stdio/_stdfun.c: iffe for _p__iob and __p__iob
+09-01-09 misc/magic.tab: add ISO filesystem image entries
+09-01-07 string/strtoi.c: strtol() etc. do not consume [lLuU] suffix -- thanks 
jkf
+09-01-07 sfio/sfstrtof.h: strtod() etc. do not consume [fFlL] suffix -- thanks 
jkf
+09-01-05 string/strlcat.c: fix logic to match docs (not that easy)
+08-12-30 tm/tmxdate.c,include/tm.h: add TM_WORK { "workday" "working" "work" }
+08-12-28 sfio/sfcvt.c: fix 'a' format rounding
+08-12-21 tm/tmdata.c: add 2008-12-31+23:59:60-0000 leap second event
+08-12-19 tm/tmxdate.c: check for dates near the epoch rolling back to the 
future
+08-12-19 tm/tmxfmt.c: change %s for now==0 to be the epoch
+08-12-07 include/ast_std.h,misc/getenv.c: no _ast_getenv for uwin ast54 
compatibility
+08-12-07 tm/tmxfmt.c: add %[_][EO]K for [space pad] [full|long] iso
+08-12-07 sfio/sfvscanf.c: fix ok[] short by one allocation
+08-12-07 comp/setlocale.c: fix off by one composite initialition loop test
+08-12-07 path/pathkey.c: fix off by one loop test
+08-12-04 vmalloc/vmbest.c: catch sbrk() wraparound
+08-12-04 comp/spawnveg.c: clean up attrs on failure too
 08-11-04 regex/regcomp.c: fix locale [!-...] and [^-...] re-initialization
 08-11-04 stdio: add flockfile.c ftrylockfile.c funlockfile.c
 08-10-24 port/astconf.c: handle multiple/trailing '/' in universe 
initialization
--- old/usr/src/lib/libast/common/cdt/dtclose.c Fri Sep 25 05:31:55 2009
+++ new/usr/src/lib/libast/common/cdt/dtclose.c Fri Sep 25 05:31:53 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/cdt/dtdisc.c  Fri Sep 25 05:31:57 2009
+++ new/usr/src/lib/libast/common/cdt/dtdisc.c  Fri Sep 25 05:31:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/cdt/dtextract.c       Fri Sep 25 05:31:59 2009
+++ new/usr/src/lib/libast/common/cdt/dtextract.c       Fri Sep 25 05:31:58 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/cdt/dtflatten.c       Fri Sep 25 05:32:02 2009
+++ new/usr/src/lib/libast/common/cdt/dtflatten.c       Fri Sep 25 05:32:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/cdt/dthash.c  Fri Sep 25 05:32:04 2009
+++ new/usr/src/lib/libast/common/cdt/dthash.c  Fri Sep 25 05:32:02 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/cdt/dthdr.h   Fri Sep 25 05:32:07 2009
+++ new/usr/src/lib/libast/common/cdt/dthdr.h   Fri Sep 25 05:32:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/cdt/dtlist.c  Fri Sep 25 05:32:09 2009
+++ new/usr/src/lib/libast/common/cdt/dtlist.c  Fri Sep 25 05:32:07 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/cdt/dtmethod.c        Fri Sep 25 05:32:11 2009
+++ new/usr/src/lib/libast/common/cdt/dtmethod.c        Fri Sep 25 05:32:09 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/cdt/dtnew.c   Fri Sep 25 05:32:14 2009
+++ new/usr/src/lib/libast/common/cdt/dtnew.c   Fri Sep 25 05:32:12 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/cdt/dtopen.c  Fri Sep 25 05:32:16 2009
+++ new/usr/src/lib/libast/common/cdt/dtopen.c  Fri Sep 25 05:32:14 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/cdt/dtrenew.c Fri Sep 25 05:32:19 2009
+++ new/usr/src/lib/libast/common/cdt/dtrenew.c Fri Sep 25 05:32:17 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/cdt/dtrestore.c       Fri Sep 25 05:32:21 2009
+++ new/usr/src/lib/libast/common/cdt/dtrestore.c       Fri Sep 25 05:32:19 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/cdt/dtsize.c  Fri Sep 25 05:32:23 2009
+++ new/usr/src/lib/libast/common/cdt/dtsize.c  Fri Sep 25 05:32:21 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/cdt/dtstat.c  Fri Sep 25 05:32:26 2009
+++ new/usr/src/lib/libast/common/cdt/dtstat.c  Fri Sep 25 05:32:24 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/cdt/dtstrhash.c       Fri Sep 25 05:32:28 2009
+++ new/usr/src/lib/libast/common/cdt/dtstrhash.c       Fri Sep 25 05:32:26 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/cdt/dttree.c  Fri Sep 25 05:32:30 2009
+++ new/usr/src/lib/libast/common/cdt/dttree.c  Fri Sep 25 05:32:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/cdt/dttreeset.c       Fri Sep 25 05:32:33 2009
+++ new/usr/src/lib/libast/common/cdt/dttreeset.c       Fri Sep 25 05:32:31 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/cdt/dtview.c  Fri Sep 25 05:32:35 2009
+++ new/usr/src/lib/libast/common/cdt/dtview.c  Fri Sep 25 05:32:33 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/cdt/dtwalk.c  Fri Sep 25 05:32:38 2009
+++ new/usr/src/lib/libast/common/cdt/dtwalk.c  Fri Sep 25 05:32:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/atexit.c Fri Sep 25 05:32:40 2009
+++ new/usr/src/lib/libast/common/comp/atexit.c Fri Sep 25 05:32:38 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/basename.c       Fri Sep 25 05:32:43 2009
+++ new/usr/src/lib/libast/common/comp/basename.c       Fri Sep 25 05:32:41 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/catopen.c        Fri Sep 25 05:32:45 2009
+++ new/usr/src/lib/libast/common/comp/catopen.c        Fri Sep 25 05:32:43 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/closelog.c       Fri Sep 25 05:32:47 2009
+++ new/usr/src/lib/libast/common/comp/closelog.c       Fri Sep 25 05:32:45 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/conf.sh  Fri Sep 25 05:32:50 2009
+++ new/usr/src/lib/libast/common/comp/conf.sh  Fri Sep 25 05:32:48 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1985-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1985-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
--- old/usr/src/lib/libast/common/comp/conf.tab Fri Sep 25 05:32:52 2009
+++ new/usr/src/lib/libast/common/comp/conf.tab Fri Sep 25 05:32:50 2009
@@ -305,6 +305,7 @@
 NL_TEXTMAX                     XOPEN   XX 1 L          LINE_MAX
 NO_TRUNC                       POSIX   PC 1 FUW
 NPROCESSORS_CONF               SVID    SC 1 0
+NPROCESSORS_MAX                        SVID    SC 1 0
 NPROCESSORS_ONLN               SVID    SC 1 0
 NPROC_CONF                     C       QQ 1 L
 NPROC_ONLN                     C       QQ 1 L
--- old/usr/src/lib/libast/common/comp/creat64.c        Fri Sep 25 05:32:55 2009
+++ new/usr/src/lib/libast/common/comp/creat64.c        Fri Sep 25 05:32:53 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/dirname.c        Fri Sep 25 05:32:57 2009
+++ new/usr/src/lib/libast/common/comp/dirname.c        Fri Sep 25 05:32:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/dup2.c   Fri Sep 25 05:32:59 2009
+++ new/usr/src/lib/libast/common/comp/dup2.c   Fri Sep 25 05:32:58 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/eaccess.c        Fri Sep 25 05:33:02 2009
+++ new/usr/src/lib/libast/common/comp/eaccess.c        Fri Sep 25 05:33:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/errno.c  Fri Sep 25 05:33:04 2009
+++ new/usr/src/lib/libast/common/comp/errno.c  Fri Sep 25 05:33:02 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/execlp.c Fri Sep 25 05:33:07 2009
+++ new/usr/src/lib/libast/common/comp/execlp.c Fri Sep 25 05:33:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/execve.c Fri Sep 25 05:33:09 2009
+++ new/usr/src/lib/libast/common/comp/execve.c Fri Sep 25 05:33:07 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/execvp.c Fri Sep 25 05:33:12 2009
+++ new/usr/src/lib/libast/common/comp/execvp.c Fri Sep 25 05:33:10 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/execvpe.c        Fri Sep 25 05:33:14 2009
+++ new/usr/src/lib/libast/common/comp/execvpe.c        Fri Sep 25 05:33:12 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/fcntl.c  Fri Sep 25 05:33:16 2009
+++ new/usr/src/lib/libast/common/comp/fcntl.c  Fri Sep 25 05:33:14 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/fmtmsglib.c      Fri Sep 25 05:33:19 2009
+++ new/usr/src/lib/libast/common/comp/fmtmsglib.c      Fri Sep 25 05:33:17 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/fnmatch.c        Fri Sep 25 05:33:21 2009
+++ new/usr/src/lib/libast/common/comp/fnmatch.c        Fri Sep 25 05:33:19 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/fnmatch.h        Fri Sep 25 05:33:23 2009
+++ new/usr/src/lib/libast/common/comp/fnmatch.h        Fri Sep 25 05:33:22 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/frexp.c  Fri Sep 25 05:33:26 2009
+++ new/usr/src/lib/libast/common/comp/frexp.c  Fri Sep 25 05:33:24 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/frexpl.c Fri Sep 25 05:33:28 2009
+++ new/usr/src/lib/libast/common/comp/frexpl.c Fri Sep 25 05:33:26 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/fsync.c  Fri Sep 25 05:33:31 2009
+++ new/usr/src/lib/libast/common/comp/fsync.c  Fri Sep 25 05:33:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/ftw.c    Fri Sep 25 05:33:33 2009
+++ new/usr/src/lib/libast/common/comp/ftw.c    Fri Sep 25 05:33:31 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/ftw.h    Fri Sep 25 05:33:35 2009
+++ new/usr/src/lib/libast/common/comp/ftw.h    Fri Sep 25 05:33:34 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/getdate.c        Fri Sep 25 05:33:38 2009
+++ new/usr/src/lib/libast/common/comp/getdate.c        Fri Sep 25 05:33:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/getgroups.c      Fri Sep 25 05:33:40 2009
+++ new/usr/src/lib/libast/common/comp/getgroups.c      Fri Sep 25 05:33:38 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/getlogin.c       Fri Sep 25 05:33:43 2009
+++ new/usr/src/lib/libast/common/comp/getlogin.c       Fri Sep 25 05:33:41 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/getopt.c Fri Sep 25 05:33:45 2009
+++ new/usr/src/lib/libast/common/comp/getopt.c Fri Sep 25 05:33:43 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/getopt.h Fri Sep 25 05:33:47 2009
+++ new/usr/src/lib/libast/common/comp/getopt.h Fri Sep 25 05:33:45 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/getoptl.c        Fri Sep 25 05:33:50 2009
+++ new/usr/src/lib/libast/common/comp/getoptl.c        Fri Sep 25 05:33:48 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/getpgrp.c        Fri Sep 25 05:33:52 2009
+++ new/usr/src/lib/libast/common/comp/getpgrp.c        Fri Sep 25 05:33:50 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/getsubopt.c      Fri Sep 25 05:33:54 2009
+++ new/usr/src/lib/libast/common/comp/getsubopt.c      Fri Sep 25 05:33:53 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/getwd.c  Fri Sep 25 05:33:57 2009
+++ new/usr/src/lib/libast/common/comp/getwd.c  Fri Sep 25 05:33:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/gross.c  Fri Sep 25 05:33:59 2009
+++ new/usr/src/lib/libast/common/comp/gross.c  Fri Sep 25 05:33:57 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/hsearch.c        Fri Sep 25 05:34:02 2009
+++ new/usr/src/lib/libast/common/comp/hsearch.c        Fri Sep 25 05:34:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/iconv.c  Fri Sep 25 05:34:04 2009
+++ new/usr/src/lib/libast/common/comp/iconv.c  Fri Sep 25 05:34:02 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/killpg.c Fri Sep 25 05:34:06 2009
+++ new/usr/src/lib/libast/common/comp/killpg.c Fri Sep 25 05:34:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/libgen.h Fri Sep 25 05:34:09 2009
+++ new/usr/src/lib/libast/common/comp/libgen.h Fri Sep 25 05:34:07 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/link.c   Fri Sep 25 05:34:11 2009
+++ new/usr/src/lib/libast/common/comp/link.c   Fri Sep 25 05:34:09 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/localeconv.c     Fri Sep 25 05:34:14 2009
+++ new/usr/src/lib/libast/common/comp/localeconv.c     Fri Sep 25 05:34:12 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/lstat.c  Fri Sep 25 05:34:16 2009
+++ new/usr/src/lib/libast/common/comp/lstat.c  Fri Sep 25 05:34:14 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/memccpy.c        Fri Sep 25 05:34:19 2009
+++ new/usr/src/lib/libast/common/comp/memccpy.c        Fri Sep 25 05:34:17 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/memchr.c Fri Sep 25 05:34:21 2009
+++ new/usr/src/lib/libast/common/comp/memchr.c Fri Sep 25 05:34:19 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/memcmp.c Fri Sep 25 05:34:23 2009
+++ new/usr/src/lib/libast/common/comp/memcmp.c Fri Sep 25 05:34:22 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/memcpy.c Fri Sep 25 05:34:26 2009
+++ new/usr/src/lib/libast/common/comp/memcpy.c Fri Sep 25 05:34:24 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/memmove.c        Fri Sep 25 05:34:28 2009
+++ new/usr/src/lib/libast/common/comp/memmove.c        Fri Sep 25 05:34:26 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/memset.c Fri Sep 25 05:34:31 2009
+++ new/usr/src/lib/libast/common/comp/memset.c Fri Sep 25 05:34:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/mkdir.c  Fri Sep 25 05:34:33 2009
+++ new/usr/src/lib/libast/common/comp/mkdir.c  Fri Sep 25 05:34:31 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/mkfifo.c Fri Sep 25 05:34:35 2009
+++ new/usr/src/lib/libast/common/comp/mkfifo.c Fri Sep 25 05:34:34 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/mknod.c  Fri Sep 25 05:34:38 2009
+++ new/usr/src/lib/libast/common/comp/mknod.c  Fri Sep 25 05:34:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/mktemp.c Fri Sep 25 05:34:40 2009
+++ new/usr/src/lib/libast/common/comp/mktemp.c Fri Sep 25 05:34:38 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/mktime.c Fri Sep 25 05:34:43 2009
+++ new/usr/src/lib/libast/common/comp/mktime.c Fri Sep 25 05:34:41 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/mount.c  Fri Sep 25 05:34:45 2009
+++ new/usr/src/lib/libast/common/comp/mount.c  Fri Sep 25 05:34:43 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/nftw.c   Fri Sep 25 05:34:47 2009
+++ new/usr/src/lib/libast/common/comp/nftw.c   Fri Sep 25 05:34:46 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/open.c   Fri Sep 25 05:34:50 2009
+++ new/usr/src/lib/libast/common/comp/open.c   Fri Sep 25 05:34:48 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/openlog.c        Fri Sep 25 05:34:52 2009
+++ new/usr/src/lib/libast/common/comp/openlog.c        Fri Sep 25 05:34:50 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/putenv.c Fri Sep 25 05:34:54 2009
+++ new/usr/src/lib/libast/common/comp/putenv.c Fri Sep 25 05:34:53 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/re_comp.c        Fri Sep 25 05:34:57 2009
+++ new/usr/src/lib/libast/common/comp/re_comp.c        Fri Sep 25 05:34:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/re_comp.h        Fri Sep 25 05:34:59 2009
+++ new/usr/src/lib/libast/common/comp/re_comp.h        Fri Sep 25 05:34:57 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/readlink.c       Fri Sep 25 05:35:02 2009
+++ new/usr/src/lib/libast/common/comp/readlink.c       Fri Sep 25 05:35:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/realpath.c       Fri Sep 25 05:35:04 2009
+++ new/usr/src/lib/libast/common/comp/realpath.c       Fri Sep 25 05:35:02 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/regcmp.c Fri Sep 25 05:35:06 2009
+++ new/usr/src/lib/libast/common/comp/regcmp.c Fri Sep 25 05:35:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/regexp.c Fri Sep 25 05:35:09 2009
+++ new/usr/src/lib/libast/common/comp/regexp.c Fri Sep 25 05:35:07 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/regexp.h Fri Sep 25 05:35:11 2009
+++ new/usr/src/lib/libast/common/comp/regexp.h Fri Sep 25 05:35:09 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/remove.c Fri Sep 25 05:35:14 2009
+++ new/usr/src/lib/libast/common/comp/remove.c Fri Sep 25 05:35:12 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/rename.c Fri Sep 25 05:35:16 2009
+++ new/usr/src/lib/libast/common/comp/rename.c Fri Sep 25 05:35:14 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/resolvepath.c    Fri Sep 25 05:35:18 2009
+++ new/usr/src/lib/libast/common/comp/resolvepath.c    Fri Sep 25 05:35:17 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/rmdir.c  Fri Sep 25 05:35:21 2009
+++ new/usr/src/lib/libast/common/comp/rmdir.c  Fri Sep 25 05:35:19 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/setenv.c Fri Sep 25 05:35:23 2009
+++ new/usr/src/lib/libast/common/comp/setenv.c Fri Sep 25 05:35:21 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/setlocale.c      Fri Sep 25 05:35:26 2009
+++ new/usr/src/lib/libast/common/comp/setlocale.c      Fri Sep 25 05:35:24 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -69,6 +69,10 @@
 #define AST_LC_CANONICAL       LC_abbreviated
 #endif
 
+#ifndef AST_LC_test
+#define AST_LC_test            (1L<<27)
+#endif
+
 #if _UWIN
 
 #include <ast_windows.h>
@@ -114,7 +118,11 @@
                                        break;
                                }
                        if (!ctry)
+                       {
+                               if (!lang)
+                                       return 0;
                                ctry = SUBLANG_DEFAULT;
+                       }
                }
                lcid = MAKELCID(MAKELANGID(lang, ctry), SORT_DEFAULT);
        }
@@ -141,6 +149,9 @@
        char*           sys;
        char            buf[256];
 
+       if (!(usr = native_locale(locale, buf, sizeof(buf))))
+               return 0;
+
        /*
         * win32 doesn't have LC_MESSAGES
         */
@@ -147,8 +158,6 @@
 
        if (category == LC_MESSAGES)
                return (char*)locale;
-       if (!(usr = native_locale(locale, buf, sizeof(buf))))
-               return 0;
        sys = uwin_setlocale(category, usr);
        if (ast.locale.set & AST_LC_debug)
                sfprintf(sfstderr, "locale uwin %17s %-24s %-24s\n", 
lc_categories[lcindex(category, 0)].name, usr, sys);
@@ -528,6 +537,93 @@
 
 #endif
 
+#define utf8_wctomb    wctomb
+
+static const uint32_t          utf8mask[] =
+{
+       0x00000000,
+       0x00000000,
+       0xffffff80,
+       0xfffff800,
+       0xffff0000,
+       0xffe00000,
+       0xfc000000,
+};
+
+static const signed char       utf8tab[256] =
+{
+       0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+       2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+       3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+       4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6,-1,-1,
+};
+
+int
+utf8_mbtowc(wchar_t* wp, const char* str, size_t n)
+{
+       register unsigned char* sp = (unsigned char*)str;
+       register int            m;
+       register int            i;
+       register int            c;
+       register wchar_t        w = 0;
+
+       if (!sp || !n)
+               return 0;
+       if ((m = utf8tab[*sp]) > 0)
+       {
+               if (m > n)
+                       return -1;
+               if (wp)
+               {
+                       if (m == 1)
+                       {
+                               *wp = *sp;
+                               return 1;
+                       }
+                       w = *sp & ((1<<(8-m))-1);
+                       for (i = m - 1; i > 0; i--)
+                       {
+                               c = *++sp;
+                               if ((c&0xc0) != 0x80)
+                                       goto invalid;
+                               w = (w<<6) | (c&0x3f);
+                       }
+                       if (!(utf8mask[m] & w) || w >= 0xd800 && (w <= 0xdfff 
|| w >= 0xfffe && w <= 0xffff))
+                               goto invalid;
+                       *wp = w;
+               }
+               return m;
+       }
+       if (!*sp)
+               return 0;
+ invalid:
+#ifdef EILSEQ
+       errno = EILSEQ;
+#endif
+       ast.mb_sync = (const char*)sp - str;
+       return -1;
+}
+
+int
+utf8_mblen(const char* str, size_t n)
+{
+       wchar_t         w;
+
+       return utf8_mbtowc(&w, str, n);
+}
+
 /*
  * called when LC_CTYPE initialized or changes
  */
@@ -535,6 +631,7 @@
 static int
 set_ctype(Lc_category_t* cp)
 {
+       ast.mb_sync = 0;
        if (locales[cp->internal]->flags & LC_debug)
        {
                ast.mb_cur_max = DEBUG_MB_CUR_MAX;
@@ -551,6 +648,15 @@
                ast.mb_width = default_wcwidth;
                ast.mb_conv = 0;
        }
+       else if ((locales[cp->internal]->flags & LC_utf8) && !(ast.locale.set & 
AST_LC_test))
+       {
+               ast.mb_cur_max = 6;
+               ast.mb_len = utf8_mblen;
+               ast.mb_towc = utf8_mbtowc;
+               if (!(ast.mb_width = wcwidth))
+                       ast.mb_width = default_wcwidth;
+               ast.mb_conv = utf8_wctomb;
+       }
        else
        {
                if (!(ast.mb_width = wcwidth))
@@ -576,6 +682,19 @@
                }
 #endif
        }
+       if (ast.locale.set & (AST_LC_debug|AST_LC_setlocale))
+               sfprintf(sfstderr, "locale info %17s MB_CUR_MAX=%d%s%s%s%s\n"
+                       , cp->name
+                       , ast.mb_cur_max
+                       , ast.mb_len == debug_mblen ? " debug_mblen" : 
ast.mb_len == mblen ? " mblen" : ""
+                       , ast.mb_towc == debug_mbtowc ? " debug_mbtowc" : 
ast.mb_towc == mbtowc ? " mbtowc"
+#ifdef mb_state
+                               : ast.mb_towc == sjis_mbtowc ? " sjis_mbtowc"
+#endif
+                               : ""
+                       , ast.mb_width == debug_wcwidth ? " debug_wcwidth" : 
ast.mb_width == wcwidth ? " wcwidth" : ast.mb_width == default_wcwidth ? " 
default_wcwidth" : ""
+                       , ast.mb_conv == debug_wctomb ? " debug_wctomb" : 
ast.mb_conv == wctomb ? " wctomb" : ""
+                       );
        return 0;
 }
 
@@ -630,11 +749,18 @@
 { "LC_PAPER",         LC_PAPER,         AST_LC_PAPER,         0               
},
 };
 
-static const Namval_t  options[] =
+typedef struct Unamval_s
 {
+       char*           name;
+       unsigned int    value;
+} Unamval_t;
+
+static const Unamval_t options[] =
+{
        "debug",                AST_LC_debug,
        "find",                 AST_LC_find,
        "setlocale",            AST_LC_setlocale,
+       "test",                 AST_LC_test,
        "translate",            AST_LC_translate,
        0,                      0
 };
@@ -649,9 +775,9 @@
        if (p)
        {
                if (n)
-                       ast.locale.set |= ((Namval_t*)p)->value;
+                       ast.locale.set |= ((Unamval_t*)p)->value;
                else
-                       ast.locale.set &= ~((Namval_t*)p)->value;
+                       ast.locale.set &= ~((Unamval_t*)p)->value;
        }
        return 0;
 }
@@ -738,7 +864,7 @@
                        locales[category] = lc_categories[category].prev;
                        return 0;
                }
-               if (lc->flags & LC_default)
+               if ((lc->flags & LC_default) || category == AST_LC_MESSAGES && 
lc->name[0] == 'e' && lc->name[1] == 'n' && (lc->name[2] == 0 || lc->name[2] == 
'_' && lc->name[3] == 'U'))
                        ast.locale.set &= ~(1<<category);
                else
                        ast.locale.set |= (1<<category);
@@ -759,6 +885,7 @@
        register int            j;
        register int            k;
        int                     n;
+       int                     m;
        const char*             w;
        Lc_t*                   p;
        int                     cat[AST_LC_COUNT];
@@ -802,10 +929,10 @@
                        }
                        else if (*s++ == ';')
                        {
-                               if ((n = s - w - 1) >= sizeof(buf))
-                                       n = sizeof(buf) - 1;
-                               memcpy(buf, w, n);
-                               buf[n] = 0;
+                               if ((m = s - w - 1) >= sizeof(buf))
+                                       m = sizeof(buf) - 1;
+                               memcpy(buf, w, m);
+                               buf[m] = 0;
                                p = lcmake(buf);
                                break;
                        }
@@ -824,7 +951,7 @@
                        else if (!lc_categories[cat[i]].prev)
                                lc_categories[cat[i]].prev = p;
        }
-       while (s[0] == '/' && s[1] && n < AST_LC_COUNT)
+       while (s[0] == '/' && s[1] && n < (AST_LC_COUNT - 1))
        {
                n++;
                for (w = ++s; *s && *s != '/'; s++);
--- old/usr/src/lib/libast/common/comp/setlogmask.c     Fri Sep 25 05:35:28 2009
+++ new/usr/src/lib/libast/common/comp/setlogmask.c     Fri Sep 25 05:35:26 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/setpgid.c        Fri Sep 25 05:35:31 2009
+++ new/usr/src/lib/libast/common/comp/setpgid.c        Fri Sep 25 05:35:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/setsid.c Fri Sep 25 05:35:33 2009
+++ new/usr/src/lib/libast/common/comp/setsid.c Fri Sep 25 05:35:31 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/sigunblock.c     Fri Sep 25 05:35:36 2009
+++ new/usr/src/lib/libast/common/comp/sigunblock.c     Fri Sep 25 05:35:34 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/spawnveg.c       Fri Sep 25 05:35:38 2009
+++ new/usr/src/lib/libast/common/comp/spawnveg.c       Fri Sep 25 05:35:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -52,7 +52,7 @@
        posix_spawnattr_t       attr;
 
        if (err = posix_spawnattr_init(&attr))
-               goto bad;
+               goto nope;
        if (pgid)
        {
                if (pgid <= 1)
@@ -76,6 +76,8 @@
 #endif
        return pid;
  bad:
+       posix_spawnattr_destroy(&attr);
+ nope:
        errno = err;
        return -1;
 }
--- old/usr/src/lib/libast/common/comp/statvfs.c        Fri Sep 25 05:35:40 2009
+++ new/usr/src/lib/libast/common/comp/statvfs.c        Fri Sep 25 05:35:39 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/strcasecmp.c     Fri Sep 25 05:35:43 2009
+++ new/usr/src/lib/libast/common/comp/strcasecmp.c     Fri Sep 25 05:35:41 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/strchr.c Fri Sep 25 05:35:45 2009
+++ new/usr/src/lib/libast/common/comp/strchr.c Fri Sep 25 05:35:43 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/strftime.c       Fri Sep 25 05:35:48 2009
+++ new/usr/src/lib/libast/common/comp/strftime.c       Fri Sep 25 05:35:46 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/strncasecmp.c    Fri Sep 25 05:35:50 2009
+++ new/usr/src/lib/libast/common/comp/strncasecmp.c    Fri Sep 25 05:35:48 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/strptime.c       Fri Sep 25 05:35:52 2009
+++ new/usr/src/lib/libast/common/comp/strptime.c       Fri Sep 25 05:35:51 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -27,7 +27,7 @@
 #define strptime       ______strptime
 
 #include <ast.h>
-#include <tm.h>
+#include <tmx.h>
 
 #undef strptime
 
@@ -51,8 +51,8 @@
        char*   f;
        time_t  t;
        Tm_t    tm;
-       Tm_t*   tn;
 
+       memset(&tm, 0, sizeof(tm));
        tm.tm_sec = ts->tm_sec;
        tm.tm_min = ts->tm_min;
        tm.tm_hour = ts->tm_hour;
@@ -66,16 +66,16 @@
        t = tmscan(s, &e, format, &f, &t, 0);
        if (e == (char*)s || *f)
                return 0;
-       tn = tmmake(&t);
-       ts->tm_sec = tn->tm_sec;
-       ts->tm_min = tn->tm_min;
-       ts->tm_hour = tn->tm_hour;
-       ts->tm_mday = tn->tm_mday;
-       ts->tm_mon = tn->tm_mon;
-       ts->tm_year = tn->tm_year;
-       ts->tm_wday = tn->tm_wday;
-       ts->tm_yday = tn->tm_yday;
-       ts->tm_isdst = tn->tm_isdst;
+       tmxtm(&tm, tmxclock(&t), NiL);
+       ts->tm_sec = tm.tm_sec;
+       ts->tm_min = tm.tm_min;
+       ts->tm_hour = tm.tm_hour;
+       ts->tm_mday = tm.tm_mday;
+       ts->tm_mon = tm.tm_mon;
+       ts->tm_year = tm.tm_year;
+       ts->tm_wday = tm.tm_wday;
+       ts->tm_yday = tm.tm_yday;
+       ts->tm_isdst = tm.tm_isdst;
        return e;
 }
 
--- old/usr/src/lib/libast/common/comp/strrchr.c        Fri Sep 25 05:35:55 2009
+++ new/usr/src/lib/libast/common/comp/strrchr.c        Fri Sep 25 05:35:53 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/strstr.c Fri Sep 25 05:35:57 2009
+++ new/usr/src/lib/libast/common/comp/strstr.c Fri Sep 25 05:35:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/strtod.c Fri Sep 25 05:36:00 2009
+++ new/usr/src/lib/libast/common/comp/strtod.c Fri Sep 25 05:35:58 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/strtol.c Fri Sep 25 05:36:02 2009
+++ new/usr/src/lib/libast/common/comp/strtol.c Fri Sep 25 05:36:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/strtold.c        Fri Sep 25 05:36:04 2009
+++ new/usr/src/lib/libast/common/comp/strtold.c        Fri Sep 25 05:36:03 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/strtoll.c        Fri Sep 25 05:36:07 2009
+++ new/usr/src/lib/libast/common/comp/strtoll.c        Fri Sep 25 05:36:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/strtoul.c        Fri Sep 25 05:36:09 2009
+++ new/usr/src/lib/libast/common/comp/strtoul.c        Fri Sep 25 05:36:07 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/strtoull.c       Fri Sep 25 05:36:12 2009
+++ new/usr/src/lib/libast/common/comp/strtoull.c       Fri Sep 25 05:36:10 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/swab.c   Fri Sep 25 05:36:14 2009
+++ new/usr/src/lib/libast/common/comp/swab.c   Fri Sep 25 05:36:12 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/symlink.c        Fri Sep 25 05:36:16 2009
+++ new/usr/src/lib/libast/common/comp/symlink.c        Fri Sep 25 05:36:15 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/syslog.c Fri Sep 25 05:36:19 2009
+++ new/usr/src/lib/libast/common/comp/syslog.c Fri Sep 25 05:36:17 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -43,7 +43,11 @@
 
 static const Namval_t  attempt[] =
 {
+#if _UWIN
+       "/var/log/syslog",              0,
+#endif
        "/dev/log",                     0,
+       "var/log/syslog",               0,
        "lib/syslog/log",               0,
        "/dev/console",                 LOG_CONS,
 };
--- old/usr/src/lib/libast/common/comp/system.c Fri Sep 25 05:36:21 2009
+++ new/usr/src/lib/libast/common/comp/system.c Fri Sep 25 05:36:19 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/tempnam.c        Fri Sep 25 05:36:24 2009
+++ new/usr/src/lib/libast/common/comp/tempnam.c        Fri Sep 25 05:36:22 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/tmpnam.c Fri Sep 25 05:36:26 2009
+++ new/usr/src/lib/libast/common/comp/tmpnam.c Fri Sep 25 05:36:24 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/transition.c     Fri Sep 25 05:36:29 2009
+++ new/usr/src/lib/libast/common/comp/transition.c     Fri Sep 25 05:36:27 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/tsearch.c        Fri Sep 25 05:36:31 2009
+++ new/usr/src/lib/libast/common/comp/tsearch.c        Fri Sep 25 05:36:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/unlink.c Fri Sep 25 05:36:33 2009
+++ new/usr/src/lib/libast/common/comp/unlink.c Fri Sep 25 05:36:32 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/unsetenv.c       Fri Sep 25 05:36:36 2009
+++ new/usr/src/lib/libast/common/comp/unsetenv.c       Fri Sep 25 05:36:34 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/vfork.c  Fri Sep 25 05:36:38 2009
+++ new/usr/src/lib/libast/common/comp/vfork.c  Fri Sep 25 05:36:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/waitpid.c        Fri Sep 25 05:36:40 2009
+++ new/usr/src/lib/libast/common/comp/waitpid.c        Fri Sep 25 05:36:39 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/wc.c     Fri Sep 25 05:36:43 2009
+++ new/usr/src/lib/libast/common/comp/wc.c     Fri Sep 25 05:36:41 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/wordexp.c        Fri Sep 25 05:36:45 2009
+++ new/usr/src/lib/libast/common/comp/wordexp.c        Fri Sep 25 05:36:43 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/comp/wordexp.h        Fri Sep 25 05:36:48 2009
+++ new/usr/src/lib/libast/common/comp/wordexp.h        Fri Sep 25 05:36:46 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/dir/dirlib.h  Fri Sep 25 05:36:50 2009
+++ new/usr/src/lib/libast/common/dir/dirlib.h  Fri Sep 25 05:36:48 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/dir/getdents.c        Fri Sep 25 05:36:53 2009
+++ new/usr/src/lib/libast/common/dir/getdents.c        Fri Sep 25 05:36:51 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/dir/opendir.c Fri Sep 25 05:36:55 2009
+++ new/usr/src/lib/libast/common/dir/opendir.c Fri Sep 25 05:36:53 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/dir/readdir.c Fri Sep 25 05:36:57 2009
+++ new/usr/src/lib/libast/common/dir/readdir.c Fri Sep 25 05:36:56 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/dir/rewinddir.c       Fri Sep 25 05:37:00 2009
+++ new/usr/src/lib/libast/common/dir/rewinddir.c       Fri Sep 25 05:36:58 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/dir/seekdir.c Fri Sep 25 05:37:02 2009
+++ new/usr/src/lib/libast/common/dir/seekdir.c Fri Sep 25 05:37:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/dir/telldir.c Fri Sep 25 05:37:05 2009
+++ new/usr/src/lib/libast/common/dir/telldir.c Fri Sep 25 05:37:03 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/disc/memfatal.c       Fri Sep 25 05:37:07 2009
+++ new/usr/src/lib/libast/common/disc/memfatal.c       Fri Sep 25 05:37:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -72,7 +72,8 @@
 {
        Vmdisc_t*       disc;
 
-       if (disc = vmdisc(Vmheap, NiL))
+       malloc(0);
+       if (disc = vmdisc(Vmregion, NiL))
                disc->exceptf = nomalloc;
 }
 
--- old/usr/src/lib/libast/common/disc/sfdcdio.c        Fri Sep 25 05:37:10 2009
+++ new/usr/src/lib/libast/common/disc/sfdcdio.c        Fri Sep 25 05:37:08 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/disc/sfdcdos.c        Fri Sep 25 05:37:12 2009
+++ new/usr/src/lib/libast/common/disc/sfdcdos.c        Fri Sep 25 05:37:10 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/disc/sfdcfilter.c     Fri Sep 25 05:37:15 2009
+++ new/usr/src/lib/libast/common/disc/sfdcfilter.c     Fri Sep 25 05:37:13 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/disc/sfdchdr.h        Fri Sep 25 05:37:17 2009
+++ new/usr/src/lib/libast/common/disc/sfdchdr.h        Fri Sep 25 05:37:15 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/disc/sfdcmore.c       Fri Sep 25 05:37:19 2009
+++ new/usr/src/lib/libast/common/disc/sfdcmore.c       Fri Sep 25 05:37:18 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/disc/sfdcprefix.c     Fri Sep 25 05:37:22 2009
+++ new/usr/src/lib/libast/common/disc/sfdcprefix.c     Fri Sep 25 05:37:20 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/disc/sfdcseekable.c   Fri Sep 25 05:37:24 2009
+++ new/usr/src/lib/libast/common/disc/sfdcseekable.c   Fri Sep 25 05:37:23 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/disc/sfdcslow.c       Fri Sep 25 05:37:27 2009
+++ new/usr/src/lib/libast/common/disc/sfdcslow.c       Fri Sep 25 05:37:25 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/disc/sfdcsubstr.c     Fri Sep 25 05:37:29 2009
+++ new/usr/src/lib/libast/common/disc/sfdcsubstr.c     Fri Sep 25 05:37:27 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/disc/sfdctee.c        Fri Sep 25 05:37:32 2009
+++ new/usr/src/lib/libast/common/disc/sfdctee.c        Fri Sep 25 05:37:30 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/disc/sfdcunion.c      Fri Sep 25 05:37:34 2009
+++ new/usr/src/lib/libast/common/disc/sfdcunion.c      Fri Sep 25 05:37:32 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/disc/sfkeyprintf.c    Fri Sep 25 05:37:36 2009
+++ new/usr/src/lib/libast/common/disc/sfkeyprintf.c    Fri Sep 25 05:37:35 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/disc/sfstrtmp.c       Fri Sep 25 05:37:39 2009
+++ new/usr/src/lib/libast/common/disc/sfstrtmp.c       Fri Sep 25 05:37:37 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/features/align.c      Fri Sep 25 05:37:41 2009
+++ new/usr/src/lib/libast/common/features/align.c      Fri Sep 25 05:37:39 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/features/botch.c      Fri Sep 25 05:37:44 2009
+++ new/usr/src/lib/libast/common/features/botch.c      Fri Sep 25 05:37:42 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/features/common       Fri Sep 25 05:37:46 2009
+++ new/usr/src/lib/libast/common/features/common       Fri Sep 25 05:37:44 2009
@@ -425,7 +425,15 @@
        main()
        {
                int     r;
+
                printf("\n#ifndef va_listref\n");
+               printf("#ifndef va_start\n");
+               printf("#if __STD_C\n");
+               printf("#include <stdarg.h>\n");
+               printf("#else\n");
+               printf("#include <varargs.h>\n");
+               printf("#endif\n");
+               printf("#endif\n");
        #if TRY == 4
                printf("#define va_listref(p) (&(p))\t");
                        printf("/* pass va_list to varargs function */\n");
@@ -478,15 +486,7 @@
        #endif
        #endif
        
-               printf("#ifndef va_start\n");
-               printf("#if __STD_C\n");
-               printf("#include <stdarg.h>\n");
-               printf("#else\n");
-               printf("#include <varargs.h>\n");
                printf("#endif\n");
-               printf("#endif\n");
-
-               printf("#endif\n");
                return 0;
        }
 }end
--- old/usr/src/lib/libast/common/features/fcntl.c      Fri Sep 25 05:37:49 2009
+++ new/usr/src/lib/libast/common/features/fcntl.c      Fri Sep 25 05:37:47 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/features/float        Fri Sep 25 05:37:51 2009
+++ new/usr/src/lib/libast/common/features/float        Fri Sep 25 05:37:49 2009
@@ -952,7 +952,11 @@
        }
 }end
 
-tst    - -DSCAN=1 - -lm -DSTRTO=1 - -DDIV=1 - -DEXP=1 - -DADD=1 - -DMPY=1 
note{ INF and NAN memory representations }end output{
+tst    - -DSCAN=1 - -lm -DSTRTO=1 - -DMAC=1 - -DDIV=1 - -DEXP=1 - -DADD=1 - 
-DMPY=1 note{ INF and NAN memory representations }end output{
+       #if MAC
+       #define _AIX_COMPATIBILITY      1
+       #define _FP_MODE_VARIABLE       1
+       #endif
        #include "FEATURE/common"
        #include <stdio.h>
        #include <sys/types.h>
@@ -1104,7 +1108,13 @@
        #if MPY
                        f *= 2;
        #endif
+       #if MAC
+                       f = FLT_QNAN;
+       #endif
                        list("flt", "nan", &f, sizeof(f));
+       #if MAC
+                       f = FLT_INFINITY;
+       #endif
                        list("flt", "inf", &f, sizeof(f));
        #endif
                }
@@ -1131,7 +1141,13 @@
        #if MPY
                        f *= 2;
        #endif
+       #if MAC
+                       f = DBL_QNAN;
+       #endif
                        list("dbl", "nan", &f, sizeof(f));
+       #if MAC
+                       f = DBL_INFINITY;
+       #endif
                        list("dbl", "inf", &f, sizeof(f));
        #endif
                }
@@ -1158,7 +1174,13 @@
        #if MPY
                        f *= 2;
        #endif
+       #if MAC
+                       f = LDBL_QNAN;
+       #endif
                        list("ldbl", "nan", &f, sizeof(f));
+       #if MAC
+                       f = LDBL_INFINITY;
+       #endif
                        list("ldbl", "inf", &f, sizeof(f));
        #endif
                }
--- old/usr/src/lib/libast/common/features/lib  Fri Sep 25 05:37:54 2009
+++ new/usr/src/lib/libast/common/features/lib  Fri Sep 25 05:37:52 2009
@@ -453,6 +453,15 @@
                size_t  siz;
                int     i;
        #endif
+
+       #if defined(__ia64) || defined(__ia64__) || defined(__itanium__)
+               /*
+                * 0 faith that the itanium coders will ever get this right
+                * prove me wrong
+                */
+
+               return 1;
+       #endif
        
                /*
                 * early mac osx failed here -- fixed 3Q 2001
--- old/usr/src/lib/libast/common/features/libpath.sh   Fri Sep 25 05:37:56 2009
+++ new/usr/src/lib/libast/common/features/libpath.sh   Fri Sep 25 05:37:55 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1985-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1985-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
--- old/usr/src/lib/libast/common/features/limits.c     Fri Sep 25 05:37:59 2009
+++ new/usr/src/lib/libast/common/features/limits.c     Fri Sep 25 05:37:57 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/features/map.c        Fri Sep 25 05:38:01 2009
+++ new/usr/src/lib/libast/common/features/map.c        Fri Sep 25 05:37:59 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -187,6 +187,8 @@
        printf("#define pathposix       _ast_pathposix\n");
        printf("#undef  pathprobe\n");
        printf("#define pathprobe       _ast_pathprobe\n");
+       printf("#undef  pathprog\n");
+       printf("#define pathprog        _ast_pathprog\n");
        printf("#undef  pathrepl\n");
        printf("#define pathrepl        _ast_pathrepl\n");
        printf("#undef  pathsetlink\n");
--- old/usr/src/lib/libast/common/features/mode.c       Fri Sep 25 05:38:04 2009
+++ new/usr/src/lib/libast/common/features/mode.c       Fri Sep 25 05:38:02 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/features/param.sh     Fri Sep 25 05:38:06 2009
+++ new/usr/src/lib/libast/common/features/param.sh     Fri Sep 25 05:38:04 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1985-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1985-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
--- old/usr/src/lib/libast/common/features/preroot.sh   Fri Sep 25 05:38:09 2009
+++ new/usr/src/lib/libast/common/features/preroot.sh   Fri Sep 25 05:38:07 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1985-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1985-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
--- old/usr/src/lib/libast/common/features/sfinit.c     Fri Sep 25 05:38:11 2009
+++ new/usr/src/lib/libast/common/features/sfinit.c     Fri Sep 25 05:38:09 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/features/sig.sh       Fri Sep 25 05:38:14 2009
+++ new/usr/src/lib/libast/common/features/sig.sh       Fri Sep 25 05:38:12 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1985-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1985-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
--- old/usr/src/lib/libast/common/features/signal.c     Fri Sep 25 05:38:16 2009
+++ new/usr/src/lib/libast/common/features/signal.c     Fri Sep 25 05:38:14 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/features/standards    Fri Sep 25 05:38:18 2009
+++ new/usr/src/lib/libast/common/features/standards    Fri Sep 25 05:38:17 2009
@@ -1,3 +1,4 @@
+set stdio
 if tst note{ _ALL_SOURCE & _ISOC99_SOURCE & _POSIX_SOURCE & _POSIX_C_SOURCE & 
_XOPEN_SOURCE & __EXTENSIONS__ works }end compile{
                #define _ALL_SOURCE     1
                #define _ISOC99_SOURCE  1
@@ -24,6 +25,37 @@
                #define _POSIX_C_SOURCE 21000101L
                #endif
                #ifndef _XOPEN_SOURCE
+               #define _XOPEN_SOURCE   9900
+               #endif
+               #ifndef _GNU_SOURCE
+               #define _GNU_SOURCE     1
+               #endif
+               #ifndef __EXTENSIONS__
+               #define __EXTENSIONS__  1
+               #endif
+       }
+elif tst note{ _ALL_SOURCE & _ISOC99_SOURCE & _POSIX_SOURCE & _XOPEN_SOURCE & 
__EXTENSIONS__ works }end compile{
+               #define _ALL_SOURCE     1
+               #define _ISOC99_SOURCE  1
+               #define _POSIX_SOURCE   1
+               #define _XOPEN_SOURCE   9900
+               #define _GNU_SOURCE     1
+               #define __EXTENSIONS__  1
+               #include <sys/types.h>
+               #include <sys/stat.h>
+               #include <stdlib.h>
+               #include <unistd.h>
+       }end {
+               #ifndef _ALL_SOURCE
+               #define _ALL_SOURCE     1
+               #endif
+               #ifndef _ISOC99_SOURCE
+               #define _ISOC99_SOURCE  1
+               #endif
+               #ifndef _POSIX_SOURCE
+               #define _POSIX_SOURCE   1
+               #endif
+               #ifndef _XOPEN_SOURCE
                #define _XOPEN_SOURCE   9900
                #endif
                #ifndef _GNU_SOURCE
--- old/usr/src/lib/libast/common/features/sys  Fri Sep 25 05:38:21 2009
+++ new/usr/src/lib/libast/common/features/sys  Fri Sep 25 05:38:19 2009
@@ -45,7 +45,6 @@
 header limits.h
 header fcntl.h
 header locale.h
-header sys/localedef.h
 
 typ dev_t,nlink_t fail{
        echo "#ifndef $m"
--- old/usr/src/lib/libast/common/features/tmx  Fri Sep 25 05:38:23 2009
+++ new/usr/src/lib/libast/common/features/tmx  Fri Sep 25 05:38:21 2009
@@ -86,6 +86,7 @@
        #endif
 
        extern Time_t           tmxdate(const char*, char**, Time_t);
+       extern Time_t           tmxduration(const char*, char**);
        extern char*            tmxfmt(char*, size_t, const char*, Time_t);
        extern Time_t           tmxleap(Time_t);
        extern Tm_t*            tmxmake(Time_t);
@@ -92,6 +93,7 @@
        extern Time_t           tmxscan(const char*, char**, const char*, 
char**, Time_t, long);
        extern int              tmxsleep(Time_t);
        extern Time_t           tmxtime(Tm_t*, int);
+       extern Tm_t*            tmxtm(Tm_t*, Time_t, Tm_zone_t*);
 
        extern Time_t           tmxgettime(void);
        extern int              tmxsettime(Time_t);
--- old/usr/src/lib/libast/common/features/uwin Fri Sep 25 05:38:26 2009
+++ new/usr/src/lib/libast/common/features/uwin Fri Sep 25 05:38:24 2009
@@ -1,6 +1,6 @@
 lib    a64l,acosh,asinh,atanh,cbrt,ceil,crypt,erf,exp,expm1,floor
 lib    gamma,getpass,lgamma,log,log1p,random,rcmd,rint,srand48
 lib    copysign,logb,finite,drem,sqrt,ilogb,remainder,scalb
-lib    _copysign,_finite,_scalb,__iob_func,_p__iob
+lib    _copysign,_finite,_scalb,__iob_func,_p__iob,__p__iob
 
 dat    _iob
--- old/usr/src/lib/libast/common/features/vmalloc      Fri Sep 25 05:38:28 2009
+++ new/usr/src/lib/libast/common/features/vmalloc      Fri Sep 25 05:38:26 2009
@@ -116,6 +116,9 @@
 }end
 
 tst    mal_alloca note{ alloca is based on malloc() }end execute{
+       #if __CYGWIN__
+       int main() { return 1; }
+       #else
        #if _hdr_alloca
        #include        <alloca.h>
        #endif
@@ -131,6 +134,7 @@
        {       alloca(10);
                return 1;
        }
+       #endif
 }end
 
 tst    stk_down note{ stack grows downward }end execute{
--- old/usr/src/lib/libast/common/hash/hashalloc.c      Fri Sep 25 05:38:31 2009
+++ new/usr/src/lib/libast/common/hash/hashalloc.c      Fri Sep 25 05:38:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/hash/hashdump.c       Fri Sep 25 05:38:33 2009
+++ new/usr/src/lib/libast/common/hash/hashdump.c       Fri Sep 25 05:38:31 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/hash/hashfree.c       Fri Sep 25 05:38:35 2009
+++ new/usr/src/lib/libast/common/hash/hashfree.c       Fri Sep 25 05:38:34 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/hash/hashlast.c       Fri Sep 25 05:38:38 2009
+++ new/usr/src/lib/libast/common/hash/hashlast.c       Fri Sep 25 05:38:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/hash/hashlib.h        Fri Sep 25 05:38:40 2009
+++ new/usr/src/lib/libast/common/hash/hashlib.h        Fri Sep 25 05:38:38 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/hash/hashlook.c       Fri Sep 25 05:38:43 2009
+++ new/usr/src/lib/libast/common/hash/hashlook.c       Fri Sep 25 05:38:41 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/hash/hashscan.c       Fri Sep 25 05:38:45 2009
+++ new/usr/src/lib/libast/common/hash/hashscan.c       Fri Sep 25 05:38:43 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/hash/hashsize.c       Fri Sep 25 05:38:48 2009
+++ new/usr/src/lib/libast/common/hash/hashsize.c       Fri Sep 25 05:38:46 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/hash/hashview.c       Fri Sep 25 05:38:50 2009
+++ new/usr/src/lib/libast/common/hash/hashview.c       Fri Sep 25 05:38:48 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/hash/hashwalk.c       Fri Sep 25 05:38:52 2009
+++ new/usr/src/lib/libast/common/hash/hashwalk.c       Fri Sep 25 05:38:51 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/hash/memhash.c        Fri Sep 25 05:38:55 2009
+++ new/usr/src/lib/libast/common/hash/memhash.c        Fri Sep 25 05:38:53 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/hash/memsum.c Fri Sep 25 05:38:57 2009
+++ new/usr/src/lib/libast/common/hash/memsum.c Fri Sep 25 05:38:56 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/hash/strhash.c        Fri Sep 25 05:39:00 2009
+++ new/usr/src/lib/libast/common/hash/strhash.c        Fri Sep 25 05:38:58 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/hash/strkey.c Fri Sep 25 05:39:02 2009
+++ new/usr/src/lib/libast/common/hash/strkey.c Fri Sep 25 05:39:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/hash/strsum.c Fri Sep 25 05:39:05 2009
+++ new/usr/src/lib/libast/common/hash/strsum.c Fri Sep 25 05:39:03 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/ast.h Fri Sep 25 05:39:07 2009
+++ new/usr/src/lib/libast/common/include/ast.h Fri Sep 25 05:39:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -176,7 +176,7 @@
 #define mbcoll()       (ast.mb_xfrm!=0)
 #define mbwide()       (mbmax()>1)
 
-#define mbchar(p)      
(mbwide()?((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),mbmax()))>0?((p+=ast.tmp_int),ast.tmp_wchar):(p++,ast.tmp_int)):(*(unsigned
 char*)(p++)))
+#define mbchar(p)      
(mbwide()?((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),mbmax()))>0?((p+=ast.tmp_int),ast.tmp_wchar):(p+=ast.mb_sync+1,ast.tmp_int)):(*(unsigned
 char*)(p++)))
 #define mbinit()       
(mbwide()?(*ast.mb_towc)((wchar_t*)0,(char*)0,mbmax()):0)
 #define mbsize(p)      (mbwide()?(*ast.mb_len)((char*)(p),mbmax()):((p),1))
 #define mbconv(s,w)    (ast.mb_conv?(*ast.mb_conv)(s,w):((*(s)=(w)),1))
@@ -291,6 +291,7 @@
 extern char*           pathpath(char*, const char*, const char*, int);
 extern size_t          pathposix(const char*, char*, size_t);
 extern char*           pathprobe(char*, char*, const char*, const char*, const 
char*, int);
+extern size_t          pathprog(const char*, char*, size_t);
 extern char*           pathrepl(char*, const char*, const char*);
 extern int             pathsetlink(const char*, const char*);
 extern char*           pathshell(void);
@@ -311,6 +312,7 @@
 extern int             strmode(const char*);
 extern int             strnacmp(const char*, const char*, size_t);
 extern char*           strncopy(char*, const char*, size_t);
+extern int             strnpcmp(const char*, const char*, size_t);
 extern double          strntod(const char*, size_t, char**);
 extern _ast_fltmax_t   strntold(const char*, size_t, char**);
 extern long            strntol(const char*, size_t, char**, int);
@@ -319,7 +321,9 @@
 extern unsigned long   strntoul(const char*, size_t, char**, int);
 extern intmax_t                strntonll(const char*, size_t, char**, char*, 
int);
 extern uintmax_t       strntoull(const char*, size_t, char**, int);
+extern int             strnvcmp(const char*, const char*, size_t);
 extern int             stropt(const char*, const void*, int, int(*)(void*, 
const void*, int, const char*), void*);
+extern int             strpcmp(const char*, const char*);
 extern int             strperm(const char*, char**, int);
 extern void*           strpsearch(const void*, size_t, size_t, const char*, 
char**);
 extern void*           strsearch(const void*, size_t, size_t, Strcmp_f, const 
char*, void*);
@@ -332,6 +336,7 @@
 extern intmax_t                strtonll(const char*, char**, char*, int);
 extern int             struid(const char*);
 extern int             struniq(char**, int);
+extern int             strvcmp(const char*, const char*);
 
 #undef                 extern
 
--- old/usr/src/lib/libast/common/include/ast_dir.h     Fri Sep 25 05:39:10 2009
+++ new/usr/src/lib/libast/common/include/ast_dir.h     Fri Sep 25 05:39:08 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/ast_getopt.h  Fri Sep 25 05:39:12 2009
+++ new/usr/src/lib/libast/common/include/ast_getopt.h  Fri Sep 25 05:39:10 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/ast_std.h     Fri Sep 25 05:39:14 2009
+++ new/usr/src/lib/libast/common/include/ast_std.h     Fri Sep 25 05:39:13 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -107,9 +107,18 @@
 #define extern         __EXPORT__
 #endif
 
+#if !_UWIN /* for ast54 compatibility */
+
 #undef getenv
 #define getenv         _ast_getenv
 
+#undef setenviron
+#define setenviron     _ast_setenviron
+
+extern char*           getenv(const char*);
+
+#endif
+
 #undef localeconv
 #define localeconv     _ast_localeconv
 
@@ -116,13 +125,9 @@
 #undef setlocale
 #define setlocale      _ast_setlocale
 
-#undef setenviron
-#define setenviron     _ast_setenviron
-
 #undef strerror
 #define strerror       _ast_strerror
 
-extern char*           getenv(const char*);
 extern struct lconv*   localeconv(void);
 extern char*           setenviron(const char*);
 extern char*           setlocale(int, const char*);
@@ -237,8 +242,9 @@
        int             (*mb_conv)(char*, wchar_t);
 
        uint32_t        env_serial;
+       uint32_t        mb_sync;
 
-       char            pad[944];
+       char            pad[940];
 
 } _Ast_info_t;
 
--- old/usr/src/lib/libast/common/include/ast_version.h Fri Sep 25 05:39:17 2009
+++ new/usr/src/lib/libast/common/include/ast_version.h Fri Sep 25 05:39:15 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -25,4 +25,4 @@
  * AT&T Research
  */
 
-#define _AST_VERSION   20080910L
+#define _AST_VERSION   20090202L
--- old/usr/src/lib/libast/common/include/ast_windows.h Fri Sep 25 05:39:19 2009
+++ new/usr/src/lib/libast/common/include/ast_windows.h Fri Sep 25 05:39:18 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/ccode.h       Fri Sep 25 05:39:22 2009
+++ new/usr/src/lib/libast/common/include/ccode.h       Fri Sep 25 05:39:20 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/cdt.h Fri Sep 25 05:39:24 2009
+++ new/usr/src/lib/libast/common/include/cdt.h Fri Sep 25 05:39:22 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/cmdarg.h      Fri Sep 25 05:39:27 2009
+++ new/usr/src/lib/libast/common/include/cmdarg.h      Fri Sep 25 05:39:25 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/debug.h       Fri Sep 25 05:39:29 2009
+++ new/usr/src/lib/libast/common/include/debug.h       Fri Sep 25 05:39:27 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -46,14 +46,17 @@
 #define DEBUG_ASSERT(p)                ((p) ? 0 : (debug_fatal(__FILE__, 
__LINE__),0))
 #define DEBUG_COUNT(n)         ((n) += 1)
 #define DEBUG_TALLY(c,n,v)     ((c) ? ((n) += (v)) : (n))
+#define DEBUG_INCREASE(n)      ((n) += 1)
+#define DEBUG_DECREASE(n)      ((n) -= 1)
 #define DEBUG_DECLARE(t,v)     t v
 #define DEBUG_SET(n,v)         ((n) = (v))
 #define DEBUG_PRINT(fd,s,v)    do {char 
_b[1024];write(fd,_b,sfsprintf(_b,sizeof(_b),s,v));} while(0)
 #define DEBUG_WRITE(fd,d,n)    write((fd),(d),(n))
 #define DEBUG_TEMP(temp)       (temp) /* debugging stuff that should be 
removed */
-#define DEBUG_RETURN(x)                (debug_fatal(__FILE__, __LINE__), (x))
-#define DEBUG_BREAK            (debug_fatal(__FILE__, __LINE__))
+#define DEBUG_BREAK            break
+#define DEBUG_CONTINUE         continue
 #define DEBUG_GOTO(label)      do { debug_fatal(__FILE__, __LINE__); goto 
label; } while(0)
+#define DEBUG_RETURN(x)                do { debug_fatal(__FILE__, __LINE__); 
return(x); } while(0)
 
 #else
 
@@ -66,17 +69,33 @@
 #define DEBUG_ASSERT(p)
 #define DEBUG_COUNT(n)
 #define DEBUG_TALLY(c,n,v)
+#define DEBUG_INCREASE(n)
+#define DEBUG_DECREASE(n)
 #define DEBUG_DECLARE(t,v)
 #define DEBUG_SET(n,v)
 #define DEBUG_PRINT(fd,s,v)
 #define DEBUG_WRITE(fd,d,n)
-#define DEBUG_KPV(x)
-#define DEBUG_RETURN(x)                return(x)
+#define DEBUG_TEMP(x)
 #define DEBUG_BREAK            break
+#define DEBUG_CONTINUE         continue
 #define DEBUG_GOTO(label)      goto label
+#define DEBUG_RETURN(x)                return(x)
 
 #endif
 
+#ifndef BREAK
+#define BREAK                  DEBUG_BREAK
+#endif
+#ifndef CONTINUE
+#define CONTINUE               DEBUG_CONTINUE
+#endif
+#ifndef GOTO
+#define GOTO(label)            DEBUG_GOTO(label)
+#endif
+#ifndef RETURN
+#define RETURN(x)              DEBUG_RETURN(x)
+#endif
+
 #if _BLD_ast && defined(__EXPORT__)
 #define extern         __EXPORT__
 #endif
--- old/usr/src/lib/libast/common/include/dt.h  Fri Sep 25 05:39:32 2009
+++ new/usr/src/lib/libast/common/include/dt.h  Fri Sep 25 05:39:30 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/error.h       Fri Sep 25 05:39:34 2009
+++ new/usr/src/lib/libast/common/include/error.h       Fri Sep 25 05:39:32 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/find.h        Fri Sep 25 05:39:37 2009
+++ new/usr/src/lib/libast/common/include/find.h        Fri Sep 25 05:39:35 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/fnv.h Fri Sep 25 05:39:39 2009
+++ new/usr/src/lib/libast/common/include/fnv.h Fri Sep 25 05:39:37 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/fs3d.h        Fri Sep 25 05:39:42 2009
+++ new/usr/src/lib/libast/common/include/fs3d.h        Fri Sep 25 05:39:40 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -95,7 +95,9 @@
 #define FS3D_SIZE(n)   ((n)<<4)
 #define FS3D_SIZEOF(n) ((n)>>4)
 
-extern int             mount(const char*, char*, int, void*);
+#if !_BLD_3d
+#define mount(s,t,f,d) fs3d_mount(s,t,f,d)
+#endif
 
 #if _BLD_ast && defined(__EXPORT__)
 #define extern         __EXPORT__
@@ -102,6 +104,7 @@
 #endif
 
 extern int             fs3d(int);
+extern int             fs3d_mount(const char*, char*, int, void*);
 extern char*           pathnext(char*, char*, long*);
 
 #undef extern
--- old/usr/src/lib/libast/common/include/fts.h Fri Sep 25 05:39:44 2009
+++ new/usr/src/lib/libast/common/include/fts.h Fri Sep 25 05:39:42 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/ftwalk.h      Fri Sep 25 05:39:46 2009
+++ new/usr/src/lib/libast/common/include/ftwalk.h      Fri Sep 25 05:39:45 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/glob.h        Fri Sep 25 05:39:49 2009
+++ new/usr/src/lib/libast/common/include/glob.h        Fri Sep 25 05:39:47 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/hash.h        Fri Sep 25 05:39:51 2009
+++ new/usr/src/lib/libast/common/include/hash.h        Fri Sep 25 05:39:49 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/hashkey.h     Fri Sep 25 05:39:54 2009
+++ new/usr/src/lib/libast/common/include/hashkey.h     Fri Sep 25 05:39:52 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/hashpart.h    Fri Sep 25 05:39:56 2009
+++ new/usr/src/lib/libast/common/include/hashpart.h    Fri Sep 25 05:39:54 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/ip6.h Fri Sep 25 05:39:59 2009
+++ new/usr/src/lib/libast/common/include/ip6.h Fri Sep 25 05:39:57 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/ls.h  Fri Sep 25 05:40:01 2009
+++ new/usr/src/lib/libast/common/include/ls.h  Fri Sep 25 05:39:59 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -67,8 +67,8 @@
 #define LS_USER                (1<<10)         /* first user flag bit          
*/
 
 #define LS_W_BLOCKS    6               /* LS_BLOCKS field width        */
-#define LS_W_INUMBER   7               /* LS_INUMBER field width       */
-#define LS_W_LONG      55              /* LS_LONG width (w/o names)    */
+#define LS_W_INUMBER   9               /* LS_INUMBER field width       */
+#define LS_W_LONG      57              /* LS_LONG width (w/o names)    */
 #define LS_W_LINK      4               /* link text width (w/o names)  */
 #define LS_W_MARK      1               /* LS_MARK field width          */
 #define LS_W_NAME      9               /* group|user name field width  */
--- old/usr/src/lib/libast/common/include/magic.h       Fri Sep 25 05:40:04 2009
+++ new/usr/src/lib/libast/common/include/magic.h       Fri Sep 25 05:40:02 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/magicid.h     Fri Sep 25 05:40:06 2009
+++ new/usr/src/lib/libast/common/include/magicid.h     Fri Sep 25 05:40:04 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/mc.h  Fri Sep 25 05:40:08 2009
+++ new/usr/src/lib/libast/common/include/mc.h  Fri Sep 25 05:40:07 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/mime.h        Fri Sep 25 05:40:11 2009
+++ new/usr/src/lib/libast/common/include/mime.h        Fri Sep 25 05:40:09 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/mnt.h Fri Sep 25 05:40:13 2009
+++ new/usr/src/lib/libast/common/include/mnt.h Fri Sep 25 05:40:12 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/modecanon.h   Fri Sep 25 05:40:16 2009
+++ new/usr/src/lib/libast/common/include/modecanon.h   Fri Sep 25 05:40:14 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/modex.h       Fri Sep 25 05:40:18 2009
+++ new/usr/src/lib/libast/common/include/modex.h       Fri Sep 25 05:40:16 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/namval.h      Fri Sep 25 05:40:21 2009
+++ new/usr/src/lib/libast/common/include/namval.h      Fri Sep 25 05:40:19 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/option.h      Fri Sep 25 05:40:23 2009
+++ new/usr/src/lib/libast/common/include/option.h      Fri Sep 25 05:40:21 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/proc.h        Fri Sep 25 05:40:26 2009
+++ new/usr/src/lib/libast/common/include/proc.h        Fri Sep 25 05:40:24 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/recfmt.h      Fri Sep 25 05:40:28 2009
+++ new/usr/src/lib/libast/common/include/recfmt.h      Fri Sep 25 05:40:26 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/regex.h       Fri Sep 25 05:40:30 2009
+++ new/usr/src/lib/libast/common/include/regex.h       Fri Sep 25 05:40:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -71,6 +71,8 @@
 #define REG_SHELL_ESCAPED 0x00400000   /* \ not special                */
 #define REG_SHELL_PATH 0x00800000      /* explicit / match             */
 
+#define REG_REGEXP     0x40000000      /* <regexp.h> compatibility     */
+
 /* regexec flags */
 
 #define REG_NOTBOL     0x00000040      /* ^ is not a special char      */
--- old/usr/src/lib/libast/common/include/sfdisc.h      Fri Sep 25 05:40:33 2009
+++ new/usr/src/lib/libast/common/include/sfdisc.h      Fri Sep 25 05:40:31 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/sfio.h        Fri Sep 25 05:40:35 2009
+++ new/usr/src/lib/libast/common/include/sfio.h        Fri Sep 25 05:40:33 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/sfio_s.h      Fri Sep 25 05:40:38 2009
+++ new/usr/src/lib/libast/common/include/sfio_s.h      Fri Sep 25 05:40:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/sfio_t.h      Fri Sep 25 05:40:40 2009
+++ new/usr/src/lib/libast/common/include/sfio_t.h      Fri Sep 25 05:40:38 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/shcmd.h       Fri Sep 25 05:40:43 2009
+++ new/usr/src/lib/libast/common/include/shcmd.h       Fri Sep 25 05:40:41 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -66,18 +66,19 @@
 #   undef Shell_t
 #   undef Namval_t
 #else 
-#   define sh_run(c, ac, av)   ((c)?(*((Shbltin_t*)(c))->shrun)(ac,av):-1)
-#   define sh_system(c,str)    
((c)?(*((Shbltin_t*)(c))->shtrap)(str,0):system(str))
-#   define sh_exit(c,n)                
((c)?(*((Shbltin_t*)(c))->shexit)(n):exit(n))
-#   define sh_checksig(c)      ((c) && ((Shbltin_t*)(c))->sigset)
+#   define sh_context(c)       ((Shbltin_t*)(c))
+#   define sh_run(c, ac, av)   ((c)?(*sh_context(c)->shrun)(ac,av):-1)
+#   define sh_system(c,str)    
((c)?(*sh_context(c)->shtrap)(str,0):system(str))
+#   define sh_exit(c,n)                
((c)?(*sh_context(c)->shexit)(n):exit(n))
+#   define sh_checksig(c)      ((c) && sh_context(c)->sigset)
 #   if defined(SFIO_VERSION) || defined(_AST_H)
 #      define LIB_INIT(c)
 #   else
-#      define LIB_INIT(c)      ((c) && (((Shbltin_t*)(c))->nosfio = 1))
+#      define LIB_INIT(c)      ((c) && (sh_context(c)->nosfio = 1))
 #   endif
 #   ifndef _CMD_H
 #      define cmdinit(ac,av,c,cat,flg)         do { if((ac)<=0) return(0); \
-           (((Shbltin_t*)(c))->notify = ((flg)&ERROR_NOTIFY)?1:0);} while(0)
+           (sh_context(c)->notify = ((flg)&ERROR_NOTIFY)?1:0);} while(0)
 #   endif
 #endif
 
--- old/usr/src/lib/libast/common/include/stack.h       Fri Sep 25 05:40:45 2009
+++ new/usr/src/lib/libast/common/include/stack.h       Fri Sep 25 05:40:43 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/stak.h        Fri Sep 25 05:40:47 2009
+++ new/usr/src/lib/libast/common/include/stak.h        Fri Sep 25 05:40:46 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/stk.h Fri Sep 25 05:40:50 2009
+++ new/usr/src/lib/libast/common/include/stk.h Fri Sep 25 05:40:48 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/swap.h        Fri Sep 25 05:40:52 2009
+++ new/usr/src/lib/libast/common/include/swap.h        Fri Sep 25 05:40:51 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/tar.h Fri Sep 25 05:40:55 2009
+++ new/usr/src/lib/libast/common/include/tar.h Fri Sep 25 05:40:53 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/times.h       Fri Sep 25 05:40:57 2009
+++ new/usr/src/lib/libast/common/include/times.h       Fri Sep 25 05:40:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/tm.h  Fri Sep 25 05:41:00 2009
+++ new/usr/src/lib/libast/common/include/tm.h  Fri Sep 25 05:40:58 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -93,8 +93,9 @@
 #define TM_ERA_YEAR            115
 #define TM_ORDINALS            116
 #define TM_FINAL               126
+#define TM_WORK                        129
 
-#define TM_NFORM               129
+#define TM_NFORM               132
 
 typedef struct                         /* leap second info             */
 {
@@ -114,7 +115,7 @@
 typedef struct                         /* tm library readonly data     */
 {
        char**          format;         /* default TM_* format strings  */
-       char*           lex;            /* format lex type classes      */
+       unsigned char*  lex;            /* format lex type classes      */
        char*           digit;          /* output digits                */
        short*          days;           /* days in month i              */
        short*          sum;            /* days in months before i      */
--- old/usr/src/lib/libast/common/include/tok.h Fri Sep 25 05:41:02 2009
+++ new/usr/src/lib/libast/common/include/tok.h Fri Sep 25 05:41:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/usage.h       Fri Sep 25 05:41:05 2009
+++ new/usr/src/lib/libast/common/include/usage.h       Fri Sep 25 05:41:03 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/vdb.h Fri Sep 25 05:41:07 2009
+++ new/usr/src/lib/libast/common/include/vdb.h Fri Sep 25 05:41:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/vecargs.h     Fri Sep 25 05:41:10 2009
+++ new/usr/src/lib/libast/common/include/vecargs.h     Fri Sep 25 05:41:08 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/vmalloc.h     Fri Sep 25 05:41:12 2009
+++ new/usr/src/lib/libast/common/include/vmalloc.h     Fri Sep 25 05:41:10 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/include/wait.h        Fri Sep 25 05:41:14 2009
+++ new/usr/src/lib/libast/common/include/wait.h        Fri Sep 25 05:41:13 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- /dev/null   Fri Sep 25 05:41:17 2009
+++ new/usr/src/lib/libast/common/man/ip6.3     Fri Sep 25 05:41:15 2009
@@ -0,0 +1,85 @@
+.fp 5 B
+.de Af
+.ds ;G \\*(;G\\f\\$1\\$3\\f\\$2
+.if !\\$4 .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
+..
+.de aF
+.ie \\$3 .ft \\$1
+.el \{\
+.ds ;G \&
+.nr ;G \\n(.f
+.Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
+\\*(;G
+.ft \\n(;G \}
+..
+.de L
+.aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
+..
+.de LR
+.aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
+..
+.de RL
+.aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
+..
+.de EX         \" start example
+.ta 1i 2i 3i 4i 5i 6i
+.PP
+.RS 
+.PD 0
+.ft 5
+.nf
+..
+.de EE         \" end example
+.fi
+.ft
+.PD
+.RE
+.PP
+..
+.TH IP6 3
+.SH NAME
+ip6 \- IP V6 address support
+.SH SYNOPSIS
+.EX
+#include <ip6.h>
+
+char*      fmtip6(unsigned char* addr, int bits);
+int        strtoip6(const char* str, char** end, unsigned char* addr, unsigned 
char* bits);
+.EE
+
+.SH DESCRIPTION
+.L fmtip6()
+formats the IPV6 address
+.L addr
+with optional prefix bits
+.L bits
+(0 if not a prefix) into a thread-specific 0-terminated temporary buffer and 
returns a pointer
+to the formatted value.
+
+.PP
+.L strtoip6()
+converts a formatted IPV6 address from the 0-terminated string
+.L str
+into a host order IPV6 address in
+.L addr
+which must be a buffer of at least
+.L IP6ADDR
+bytes.
+If
+.L bits
+is not 0 then an optional
+.BI / bits
+(prefix size in bits) is parsed and
+.L *bits
+is set to the number of prefix bits.
+If
+.L end
+is not 0 then
+.L *end
+will point to the first unparsed character in
+.L str
+on return.
+0 is returned on success, -1 on failure.
+
+.SH "SEE ALSO"
+dss(1)
--- /dev/null   Fri Sep 25 05:41:19 2009
+++ new/usr/src/lib/libast/common/man/regex.3   Fri Sep 25 05:41:17 2009
@@ -0,0 +1,163 @@
+.fp 5 B
+.de Af
+.ds ;G \\*(;G\\f\\$1\\$3\\f\\$2
+.if !\\$4 .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
+..
+.de aF
+.ie \\$3 .ft \\$1
+.el \{\
+.ds ;G \&
+.nr ;G \\n(.f
+.Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
+\\*(;G
+.ft \\n(;G \}
+..
+.de L
+.aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
+..
+.de LR
+.aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
+..
+.de RL
+.aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
+..
+.de EX         \" start example
+.ta 1i 2i 3i 4i 5i 6i
+.PP
+.RS 
+.PD 0
+.ft 5
+.nf
+..
+.de EE         \" end example
+.fi
+.ft
+.PD
+.RE
+.PP
+..
+.TH REGEX 3
+.SH NAME
+regex \- regular expression interface
+.SH SYNOPSIS
+.EX
+#include <regex.h>
+
+int        regcomp(regex_t* \fIre\fP, const char* \fIregex\fP, int 
\fIcflags\fP);
+int        regexec(const regex_t* \fIre\fP, const char* \fIstring\fP, size_t 
\fInmatch\fP, regmatch_t \fIpmatch\fP[], int \fIeflags\fP);
+size_t     regerror(int \fIcode\fP, const regex_t* \fIre\fP, char* 
\fIerrbuf\fP, size_t \fIerrbuf_size\fP);
+void       regfree(regex_t* \fIre\fP);
+
+regclass_t regclass(const char* \fIstr\fP, char** \fIend\fP);
+int        regaddclass(const char* \fIname\fP, regclass_t \fIclassf\fP);
+int        regcollate(const char* \fIstr\fP, char** \fIend\fP, char* 
\fIbuf\fP, int \fIsize\fP);
+
+int        regcomb(regex_t* \fIre_1\fP, regex_t* \fIre_2\fP);
+size_t     regdecomp(regex_t* \fIre\fP, regflags_t \fIflags\fP, char* 
\fIbuf\fP, size_t \fIsize\fP);
+int        regdup(regex_t* \fIre_old\fP, regex_t* \fIre_new\fP);
+regstat_t* regstat(const regex_t* \fIre\fP);
+
+regex_t*   regcache(const char* \fIpattern\fP, regflags_t \fIflags\fP, int* 
\fIpcode\fP);
+
+int        regncomp(regex_t* \fIre\fP, const char* \fIpattern\fP, size_t 
\fIsize\fP, regflags_t \fIflags\fP);
+int        regnexec(const regex_t* \fIre\fP, const char* \fIsubject\fP, size_t 
\fIsize\fP, size_t \fInmatch\fP, regmatch_t* \fImatch\fP, regflags_t 
\fIflags\fP);
+int        regrecord(const regex_t* \fIre\fP);
+int        regrexec(const regex_t* \fIre\fP, const char* \fIbuf\fP, size_t 
\fIsize\fP, size_t \fInmatch\fP, regmatch_t* \fImatch\fP, regflags_t 
\fIflags\fP, int \fIsep\fP, void* \fIhandle\fP, regrecord_t \fIrecordf\fP);
+void       regfatal(regex_t* \fIre\fP, int \fIlevel\fP, int \fIcode\fP);
+void       regfatalpat(regex_t* \fIre\fP, int \fIlevel\fP, int \fIcode\fP, 
const char* \fIpattern\fP);
+
+int        regsubcomp(regex_t* \fIre\fP, const char* \fIstr\fP, const 
regflags_t* \fImap\fP, int \fIminmatch\fP, regflags_t \fIflags\fP);
+int        regsubexec(const regex_t* \fIre\fP, const char* \fIsubject\fP, 
size_t \fInmatch\fP, regmatch_t* match);
+int        regsubflags(regex_t* \fIre\fP, const char* \fIstr\fP, char** 
\fIend\fP, int \fIdelim\fP, const regflags_t* \fImap\fP, int* \fIpm\fP, 
regflags_t* \fIpf\fP);
+void       regsubfree(regex_t* \fIre\fP);
+.EE
+
+.SH DESCRIPTION
+.LR regcomp() ,
+.LR regexec() ,
+.LR regerror() ,
+and
+.L regfree()
+are the POSIX regular expression functions.
+The remaining functions are
+.B ast
+extensions.
+.B ast
+also provides
+.I flags
+extensions to the
+.LR regcomp() ,
+.LR regexec()
+functions and
+.I code
+extensions to the
+.L regerror()
+function.
+
+.PP
+.L regcache()
+maintains a cache of compiled regular expressions for patterns of size
+255 bytes or less.
+The initial cache size is 8.
+.L pattern
+and
+.L flags
+are passed to
+.L regcomp()
+with an
+.L re
+pointer maintained by
+.LR regcache() .
+.LR pcode ,
+if not 0, points to the return value of the
+.L regcomp()
+call.
+If the
+.L regcomp()
+call fails,
+.L regcache()
+returns 0 and
+.L pcode
+will point to the non-zero error code.
+Do not call
+.L regfree()
+on the
+.L re
+returned by
+.LR regcache() .
+Both
+.L pattern
+and
+.L flags
+are used to match entries in the cache.
+When the cache is full the least recently used
+.L re
+is freed (via
+.LR regfree() )
+to make space for the new pattern.
+Any
+.L re
+previously returned by
+.L regcache()
+may be freed (invalidated) on the next call to
+.LR regcache() .
+If
+.L pattern
+is longer that 255 bytes then it is still passed on to
+.LR regcomp() ,
+but it will not be cached.
+If
+.L pattern
+is 0 then the cache is flushed.
+In addition, if the integer value of
+.L flags
+is greater than the current cache size, the cache size is increased
+to that integer value.
+0 is always returned when
+.L pattern
+is 0;
+.L pcode
+will point to a non-zero value on error.
+
+.SH "SEE ALSO"
+strmatch(3)
--- old/usr/src/lib/libast/common/misc/astintercept.c   Fri Sep 25 05:41:22 2009
+++ new/usr/src/lib/libast/common/misc/astintercept.c   Fri Sep 25 05:41:20 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/cmdarg.c Fri Sep 25 05:41:24 2009
+++ new/usr/src/lib/libast/common/misc/cmdarg.c Fri Sep 25 05:41:22 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -34,6 +34,9 @@
 
 #include "cmdarg.h"
 
+#ifndef ARG_MAX
+#define ARG_MAX                (64*1024)
+#endif
 #ifndef EXIT_QUIT
 #define EXIT_QUIT      255
 #endif
--- old/usr/src/lib/libast/common/misc/debug.c  Fri Sep 25 05:41:26 2009
+++ new/usr/src/lib/libast/common/misc/debug.c  Fri Sep 25 05:41:25 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/error.c  Fri Sep 25 05:41:29 2009
+++ new/usr/src/lib/libast/common/misc/error.c  Fri Sep 25 05:41:27 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/errorf.c Fri Sep 25 05:41:31 2009
+++ new/usr/src/lib/libast/common/misc/errorf.c Fri Sep 25 05:41:30 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/errormsg.c       Fri Sep 25 05:41:34 2009
+++ new/usr/src/lib/libast/common/misc/errormsg.c       Fri Sep 25 05:41:32 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/errorx.c Fri Sep 25 05:41:36 2009
+++ new/usr/src/lib/libast/common/misc/errorx.c Fri Sep 25 05:41:35 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/fastfind.c       Fri Sep 25 05:41:39 2009
+++ new/usr/src/lib/libast/common/misc/fastfind.c       Fri Sep 25 05:41:37 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/findlib.h        Fri Sep 25 05:41:41 2009
+++ new/usr/src/lib/libast/common/misc/findlib.h        Fri Sep 25 05:41:40 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/fmtrec.c Fri Sep 25 05:41:44 2009
+++ new/usr/src/lib/libast/common/misc/fmtrec.c Fri Sep 25 05:41:42 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/fs3d.c   Fri Sep 25 05:41:46 2009
+++ new/usr/src/lib/libast/common/misc/fs3d.c   Fri Sep 25 05:41:45 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -28,7 +28,12 @@
  * only active for non-shared 3d library
  */
 
+#define mount  ______mount
+
 #include <ast.h>
+
+#undef mount
+
 #include <fs3d.h>
 
 int
@@ -91,4 +96,21 @@
  nope:
        fsview = -1;
        return 0;
+}
+
+/*
+ * user code that includes <fs3d.h> will have mount() mapped to fs3d_mount()
+ * this restricts the various "standard" mount prototype conflicts to this spot
+ * this means that code that includes <fs3d.h> cannot access the real mount
+ * (at least without some additional macro hackery
+ */
+
+#undef mount
+
+extern int     mount(const char*, char*, int, void*);
+
+int
+fs3d_mount(const char* source, char* target, int flags, void* data)
+{
+       return mount(source, target, flags, data);
 }
--- old/usr/src/lib/libast/common/misc/fts.c    Fri Sep 25 05:41:49 2009
+++ new/usr/src/lib/libast/common/misc/fts.c    Fri Sep 25 05:41:47 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -389,7 +389,10 @@
                                        break;
                                }
                                if (!(root = stack))
+                               {
+                                       (*bot)->fts_link = 0;
                                        return;
+                               }
                                stack = stack->stack;
                        }
                }
@@ -565,6 +568,8 @@
 
 /*
  * get top list of elements to process
+ * ordering delayed until first fts_read()
+ * to give caller a chance to set fts->handle
  */
 
 static FTSENT*
@@ -571,14 +576,12 @@
 toplist(FTS* fts, register char* const* pathnames)
 {
        register char*          path;
-       register struct stat*   sb;
        register FTSENT*        f;
-       register FTSENT*        root;
+       register FTSENT*        top;
+       register FTSENT*        bot;
        int                     physical;
        int                     metaphysical;
        char*                   s;
-       FTSENT*                 top;
-       FTSENT*                 bot;
        struct stat             st;
 
        if (fts->flags & FTS_NOSEEDOTDIR)
@@ -585,7 +588,7 @@
                fts->flags &= ~FTS_SEEDOTDIR;
        physical = (fts->flags & FTS_PHYSICAL);
        metaphysical = (fts->flags & (FTS_META|FTS_PHYSICAL)) == 
(FTS_META|FTS_PHYSICAL);
-       top = bot = root = 0;
+       top = bot = 0;
        while (path = *pathnames++)
        {
                /*
@@ -625,7 +628,6 @@
                        *s = 0;
                        f->fts_namelen = s - path;
                }
-               sb = f->fts_statp;
                if (!*path)
                {
                        errno = ENOENT;
@@ -632,7 +634,7 @@
                        f->fts_info = FTS_NS;
                }
                else
-                       info(fts, f, path, sb, fts->flags);
+                       info(fts, f, path, f->fts_statp, fts->flags);
 #ifdef S_ISLNK
 
                /*
@@ -642,13 +644,11 @@
 
                if (metaphysical && f->fts_info == FTS_SL && stat(path, &st) >= 
0)
                {
-                       *sb = st;
-                       info(fts, f, NiL, sb, 0);
+                       *f->fts_statp = st;
+                       info(fts, f, NiL, f->fts_statp, 0);
                }
 #endif
-               if (fts->comparf)
-                       root = search(f, root, fts->comparf, 1);
-               else if (bot)
+               if (bot)
                {
                        bot->fts_link = f;
                        bot = f;
@@ -656,12 +656,29 @@
                else
                        top = bot = f;
        }
-       if (fts->comparf)
-               getlist(&top, &bot, root);
        return top;
 }
 
 /*
+ * order fts->todo if fts->comparf != 0
+ */
+
+static void
+order(FTS* fts)
+{
+       register FTSENT*        f;
+       register FTSENT*        root;
+       FTSENT*                 top;
+       FTSENT*                 bot;
+
+       top = bot = root = 0;
+       for (f = fts->todo; f; f = f->fts_link)
+               root = search(f, root, fts->comparf, 1);
+       getlist(&top, &bot, root);
+       fts->todo = top;
+}
+
+/*
  * resize the path buffer
  * note that free() is not used because we may need to chdir(fts->home)
  * if there isn't enough space to continue
@@ -821,6 +838,8 @@
 
        case 0:
 
+               if (!fts->state && fts->comparf)
+                       order(fts);
                if (!(f = fts->todo))
                        return 0;
                /*FALLTHROUGH*/
@@ -1429,6 +1448,8 @@
 
        case 0:
 
+               if (fts->comparf)
+                       order(fts);
                fts->state = FTS_top_return;
                return fts->todo;
 
--- old/usr/src/lib/libast/common/misc/ftwalk.c Fri Sep 25 05:41:52 2009
+++ new/usr/src/lib/libast/common/misc/ftwalk.c Fri Sep 25 05:41:50 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/ftwflags.c       Fri Sep 25 05:41:54 2009
+++ new/usr/src/lib/libast/common/misc/ftwflags.c       Fri Sep 25 05:41:52 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/getcwd.c Fri Sep 25 05:41:56 2009
+++ new/usr/src/lib/libast/common/misc/getcwd.c Fri Sep 25 05:41:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/getenv.c Fri Sep 25 05:41:59 2009
+++ new/usr/src/lib/libast/common/misc/getenv.c Fri Sep 25 05:41:57 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,23 +21,88 @@
 ***********************************************************************/
 #pragma prototyped
 
+#if _UWIN && __STDPP__
+__STDPP__directive pragma pp:hide getenv
+#endif
+
 #include "intercepts.h"
 
+#if _UWIN && __STDPP__
+__STDPP__directive pragma pp:nohide getenv
+#endif
+
 /*
  * NOTE: the "intercepts" definition is here instead of astintercept.c because 
some
  *      static linkers miss lone references to "intercepts" without 
"astintercept()"
- * ALSO: { 0 } definition required by some dynamic linkers avers to common 
symbols
+ * ALSO: { 0 } definition required by some dynamic linkers averse to common 
symbols
+ * UWIN: no _ast_getenv macro map to maintain ast54 compatibility
  */
 
 Intercepts_t   intercepts = { 0 };
 
+#if _UWIN && !defined(getenv)
+
+#include <windows.h>
+
+extern char**  environ;
+
+static char*
+default_getenv(const char* name)
+{
+       register char**         av;
+       register const char*    cp;
+       register const char*    sp;
+       register char           c0;
+       register char           c1;
+
+       av = environ;
+       if (!av || !name || !(c0 = *name))
+               return 0;
+       if (!(c1 = *++name))
+               c1 = '=';
+       while (cp = *av++)
+       {
+               if (cp[0] != c0 || cp[1] != c1)
+                       continue;
+               sp = name;
+               cp++;
+               while (*sp && *sp++ == *cp++);
+               if (*(sp-1) != *(cp-1))
+                       continue;
+               if (*sp == 0 && *cp == '=')
+                       return (char*)(cp+1);
+       }
+       return 0;
+}
+
+#endif
+
 /*
  * get name from the environment
  */
 
-char*
+#if defined(__EXPORT__) && defined(getenv)
+#define extern __EXPORT__
+#endif
+
+extern char*
 getenv(const char* name)
 {
+#if _UWIN && !defined(getenv) /* for ast54 compatibility */
+       HANDLE          dll;
+
+       static char*    (*posix_getenv)(const char*);
+
+       if (!posix_getenv)
+       {
+               if (dll = GetModuleHandle("posix.dll"))
+                       posix_getenv = (char*(*)(const 
char*))GetProcAddress(dll, "getenv");
+               if (!posix_getenv)
+                       posix_getenv = default_getenv;
+       }
+       return intercepts.intercept_getenv ? 
(*intercepts.intercept_getenv)(name) : (*posix_getenv)(name);
+#else
 #undef getenv
        return intercepts.intercept_getenv ? 
(*intercepts.intercept_getenv)(name) : getenv(name);
+#endif
 }
--- old/usr/src/lib/libast/common/misc/glob.c   Fri Sep 25 05:42:01 2009
+++ new/usr/src/lib/libast/common/misc/glob.c   Fri Sep 25 05:42:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/intercepts.h     Fri Sep 25 05:42:04 2009
+++ new/usr/src/lib/libast/common/misc/intercepts.h     Fri Sep 25 05:42:02 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/liberror.c       Fri Sep 25 05:42:06 2009
+++ new/usr/src/lib/libast/common/misc/liberror.c       Fri Sep 25 05:42:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/libevent.c       Fri Sep 25 05:42:09 2009
+++ new/usr/src/lib/libast/common/misc/libevent.c       Fri Sep 25 05:42:07 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/magic.c  Fri Sep 25 05:42:11 2009
+++ new/usr/src/lib/libast/common/misc/magic.c  Fri Sep 25 05:42:10 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/mime.c   Fri Sep 25 05:42:14 2009
+++ new/usr/src/lib/libast/common/misc/mime.c   Fri Sep 25 05:42:12 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/mimelib.h        Fri Sep 25 05:42:17 2009
+++ new/usr/src/lib/libast/common/misc/mimelib.h        Fri Sep 25 05:42:15 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/mimetype.c       Fri Sep 25 05:42:19 2009
+++ new/usr/src/lib/libast/common/misc/mimetype.c       Fri Sep 25 05:42:17 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/optctx.c Fri Sep 25 05:42:22 2009
+++ new/usr/src/lib/libast/common/misc/optctx.c Fri Sep 25 05:42:20 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/optesc.c Fri Sep 25 05:42:24 2009
+++ new/usr/src/lib/libast/common/misc/optesc.c Fri Sep 25 05:42:22 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/optget.c Fri Sep 25 05:42:27 2009
+++ new/usr/src/lib/libast/common/misc/optget.c Fri Sep 25 05:42:25 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -50,13 +50,13 @@
 #define OPT_ignorecase 0x004           /* arg match ignores case       */
 #define OPT_invert     0x008           /* flag inverts long sense      */
 #define OPT_listof     0x010           /* arg is ' ' or ',' list       */
-#define OPT_minus      0x021           /* '-' is an option flag        */
-#define OPT_number     0x040           /* arg is strtonll() number     */
-#define OPT_oneof      0x080           /* arg may be set once          */
-#define OPT_optional   0x100           /* arg is optional              */
-#define OPT_string     0x200           /* arg is string                */
+#define OPT_number     0x020           /* arg is strtonll() number     */
+#define OPT_oneof      0x040           /* arg may be set once          */
+#define OPT_optional   0x080           /* arg is optional              */
+#define OPT_string     0x100           /* arg is string                */
 
 #define OPT_preformat  0001            /* output preformat string      */
+#define OPT_proprietary        0002            /* proprietary docs             
*/
 
 #define OPT_TYPE       (OPT_flag|OPT_number|OPT_string)
 
@@ -902,6 +902,7 @@
                s += n;
        }
        p->opts = s;
+       message((-1, "version=%d prefix=%d section=%d flags=%04x catalog=%s", 
p->version, p->prefix, p->section, p->flags, p->catalog));
        return 0;
 }
 
@@ -2150,7 +2151,7 @@
        }
        else
                return T(NiL, ID, "[* call optget() before opthelp() *]");
-       if (style < STYLE_usage)
+       if (style <= STYLE_usage)
        {
                if (!(sp_text = sfstropen()) || !(sp_info = sfstropen()))
                        goto nospace;
@@ -2212,10 +2213,18 @@
                                sfputc(mp, '\n');
                        else
                                xl = 1;
-                       while (c = *p++)
+                       psp = 0;
+                       for (;;)
                        {
-                               switch (c)
+                               switch (c = *p++)
                                {
+                               case 0:
+                                       if (!(tsp = psp))
+                                               goto style_usage;
+                                       p = psp->ob;
+                                       psp = psp->next;
+                                       free(tsp);
+                                       continue;
                                case '\a':
                                        c = 'a';
                                        break;
@@ -2223,8 +2232,15 @@
                                        c = 'b';
                                        break;
                                case '\f':
-                                       c = 'f';
-                                       break;
+                                       psp = info(psp, p, NiL, sp_info);
+                                       if (psp->nb)
+                                               p = psp->nb;
+                                       else
+                                       {
+                                               p = psp->ob;
+                                               psp = psp->next;
+                                       }
+                                       continue;
                                case '\n':
                                        c = 'n';
                                        break;
@@ -2253,6 +2269,7 @@
                                sfputc(mp, '\\');
                                sfputc(mp, c);
                        }
+               style_usage:
                        continue;
                case STYLE_keys:
                        a = 0;
@@ -3668,7 +3685,7 @@
        register int            c;
 
        if (opt_info.num != LONG_MIN)
-               opt_info.num = opt_info.number = 0;
+               opt_info.num = (long)(opt_info.number = 0);
        if (!p || !(mp = opt_info.state->mp) && !(mp = opt_info.state->mp = 
sfstropen()))
                goto nospace;
        s = *p == '-' ? p : opt_info.name;
@@ -3762,7 +3779,7 @@
  *                     `Usage: command '
  *     ':'             error: opt_info.arg points to message sans `command: '
  *
- * '-' '+' '?' ':' '#' '[' ']' ' '
+ * ':'  '#'  ' '  '['  ']'
  *                     invalid option chars
  *
  * -- terminates option list and returns 0
@@ -4015,6 +4032,7 @@
                                return 0;
                        if (c == '+')
                                opt_info.arg = 0;
+                       message((-2, "c='%c' n=%d", c, n));
                        if (n == 2)
                        {
                                x = 0;
@@ -4117,7 +4135,7 @@
                                         */
 
                                        if (opt_info.num != LONG_MIN)
-                                               opt_info.num = opt_info.number 
= !(k & OPT_cache_invert);
+                                               opt_info.num = 
(long)(opt_info.number = !(k & OPT_cache_invert));
                                        if (!(k & 
(OPT_cache_string|OPT_cache_numeric)))
                                                return c;
                                        if (*(opt_info.arg = 
&argv[opt_info.index++][opt_info.offset]))
@@ -4259,7 +4277,7 @@
                                }
                                continue;
                        }
-                       message((-20, "optget: opt %s w %s num %ld", show(s), 
w, num));
+                       message((-20, "optget: opt %s  c %c  w %s  num %ld", 
show(s), c, w, num));
                        if (*s == c && !w)
                                break;
                        else if (*s == '[')
@@ -4663,6 +4681,7 @@
                                if (*s == GO)
                                        s = skip(s + 1, 0, 0, 0, 0, 1, 1, 
version);
                        }
+                       message((-21, "optget: opt %s", show(s)));
                }
                if (w && x)
                {
@@ -4725,7 +4744,7 @@
         */
 
        if (opt_info.num != LONG_MIN)
-               opt_info.num = opt_info.number = num;
+               opt_info.num = (long)(opt_info.number = num);
        if ((n = *++s == '#') || *s == ':' || w && !nov && v && (optnumber(v, 
&e, NiL), n = !*e))
        {
                if (w)
@@ -4737,7 +4756,7 @@
                                        pop(psp);
                                        return opterror("!", version, catalog, 
0);
                                }
-                               opt_info.num = opt_info.number = 0;
+                               opt_info.num = (long)(opt_info.number = 0);
                        }
                        else
                        {
@@ -4768,7 +4787,7 @@
                                                                else
                                                                {
                                                                        
opt_info.arg = 0;
-                                                                       
opt_info.num = opt_info.number = 0;
+                                                                       
opt_info.num = (long)(opt_info.number = 0);
                                                                }
                                                                break;
                                                        }
@@ -4988,7 +5007,7 @@
                                                }
                                        }
                                } while (*(s = skip(s, 0, 0, 0, 1, 0, 1, 
version)) == '[');
-                               if (!(opt_info.num = opt_info.number = x))
+                               if (!(opt_info.num = (long)(opt_info.number = 
x)))
                                {
                                        pop(psp);
                                        return opterror("*", version, catalog, 
0);
@@ -5003,7 +5022,7 @@
        }
        else
        {
-               opt_info.num = opt_info.number = num;
+               opt_info.num = (long)(opt_info.number = num);
                if (!w && !argv[opt_info.index][opt_info.offset])
                {
                        opt_info.offset = 0;
@@ -5148,7 +5167,7 @@
                                e = opt_info.name;
                                while (e < 
&opt_info.name[sizeof(opt_info.name)-1] && (*e++ = *s++));
                                opt_info.arg = 0;
-                               opt_info.num = opt_info.number = 0;
+                               opt_info.num = (long)(opt_info.number = 0);
                                opt_info.option[0] = ':';
                                opt_info.option[1] = 0;
                                return '#';
--- old/usr/src/lib/libast/common/misc/optjoin.c        Fri Sep 25 05:42:30 2009
+++ new/usr/src/lib/libast/common/misc/optjoin.c        Fri Sep 25 05:42:28 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/optlib.h Fri Sep 25 05:42:33 2009
+++ new/usr/src/lib/libast/common/misc/optlib.h Fri Sep 25 05:42:31 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -39,8 +39,8 @@
 #define OPT_long               0x08
 #define OPT_numeric            0x10
 #define OPT_old                        0x20
-#define OPT_plus               0x40
-#define OPT_proprietary                0x80
+#define OPT_minus              0x40
+#define OPT_plus               0x80
 
 #define OPT_cache_flag         0x01
 #define OPT_cache_invert       0x02
--- old/usr/src/lib/libast/common/misc/procclose.c      Fri Sep 25 05:42:35 2009
+++ new/usr/src/lib/libast/common/misc/procclose.c      Fri Sep 25 05:42:33 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/procfree.c       Fri Sep 25 05:42:38 2009
+++ new/usr/src/lib/libast/common/misc/procfree.c       Fri Sep 25 05:42:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/proclib.h        Fri Sep 25 05:42:40 2009
+++ new/usr/src/lib/libast/common/misc/proclib.h        Fri Sep 25 05:42:38 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/procopen.c       Fri Sep 25 05:42:43 2009
+++ new/usr/src/lib/libast/common/misc/procopen.c       Fri Sep 25 05:42:41 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/procrun.c        Fri Sep 25 05:42:45 2009
+++ new/usr/src/lib/libast/common/misc/procrun.c        Fri Sep 25 05:42:43 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/recfmt.c Fri Sep 25 05:42:47 2009
+++ new/usr/src/lib/libast/common/misc/recfmt.c Fri Sep 25 05:42:46 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/reclen.c Fri Sep 25 05:42:50 2009
+++ new/usr/src/lib/libast/common/misc/reclen.c Fri Sep 25 05:42:48 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/recstr.c Fri Sep 25 05:42:52 2009
+++ new/usr/src/lib/libast/common/misc/recstr.c Fri Sep 25 05:42:51 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -180,8 +180,6 @@
                        case '5': case '6': case '7': case '8': case '9':
                                v = 0;
                                a[n++] = strtol(s, &t, 0);
-                               if (t > s && (*(t - 1) == 'l' || *(t - 1) == 
'L'))
-                                       t--;
                                s = (const char*)t - 1;
                                continue;
                        }
--- old/usr/src/lib/libast/common/misc/setenviron.c     Fri Sep 25 05:42:55 2009
+++ new/usr/src/lib/libast/common/misc/setenviron.c     Fri Sep 25 05:42:53 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/sigcrit.c        Fri Sep 25 05:42:57 2009
+++ new/usr/src/lib/libast/common/misc/sigcrit.c        Fri Sep 25 05:42:56 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/sigdata.c        Fri Sep 25 05:43:00 2009
+++ new/usr/src/lib/libast/common/misc/sigdata.c        Fri Sep 25 05:42:58 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/signal.c Fri Sep 25 05:43:02 2009
+++ new/usr/src/lib/libast/common/misc/signal.c Fri Sep 25 05:43:01 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/stack.c  Fri Sep 25 05:43:05 2009
+++ new/usr/src/lib/libast/common/misc/stack.c  Fri Sep 25 05:43:03 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/state.c  Fri Sep 25 05:43:07 2009
+++ new/usr/src/lib/libast/common/misc/state.c  Fri Sep 25 05:43:06 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/stk.c    Fri Sep 25 05:43:10 2009
+++ new/usr/src/lib/libast/common/misc/stk.c    Fri Sep 25 05:43:08 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/systrace.c       Fri Sep 25 05:43:12 2009
+++ new/usr/src/lib/libast/common/misc/systrace.c       Fri Sep 25 05:43:11 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/translate.c      Fri Sep 25 05:43:15 2009
+++ new/usr/src/lib/libast/common/misc/translate.c      Fri Sep 25 05:43:13 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -23,7 +23,7 @@
 
 /*
  * AT&T Research and SCO
- * ast i18n message translation
+ * ast l10n message translation
  */
 
 #include "lclib.h"
--- old/usr/src/lib/libast/common/misc/univdata.c       Fri Sep 25 05:43:17 2009
+++ new/usr/src/lib/libast/common/misc/univdata.c       Fri Sep 25 05:43:16 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/misc/univlib.h        Fri Sep 25 05:43:20 2009
+++ new/usr/src/lib/libast/common/misc/univlib.h        Fri Sep 25 05:43:18 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/obsolete/spawn.c      Fri Sep 25 05:43:22 2009
+++ new/usr/src/lib/libast/common/obsolete/spawn.c      Fri Sep 25 05:43:21 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/path/pathaccess.c     Fri Sep 25 05:43:25 2009
+++ new/usr/src/lib/libast/common/path/pathaccess.c     Fri Sep 25 05:43:23 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/path/pathbin.c        Fri Sep 25 05:43:27 2009
+++ new/usr/src/lib/libast/common/path/pathbin.c        Fri Sep 25 05:43:25 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/path/pathcanon.c      Fri Sep 25 05:43:30 2009
+++ new/usr/src/lib/libast/common/path/pathcanon.c      Fri Sep 25 05:43:28 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/path/pathcat.c        Fri Sep 25 05:43:32 2009
+++ new/usr/src/lib/libast/common/path/pathcat.c        Fri Sep 25 05:43:30 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/path/pathcd.c Fri Sep 25 05:43:35 2009
+++ new/usr/src/lib/libast/common/path/pathcd.c Fri Sep 25 05:43:33 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/path/pathcheck.c      Fri Sep 25 05:43:37 2009
+++ new/usr/src/lib/libast/common/path/pathcheck.c      Fri Sep 25 05:43:35 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/path/pathexists.c     Fri Sep 25 05:43:40 2009
+++ new/usr/src/lib/libast/common/path/pathexists.c     Fri Sep 25 05:43:38 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/path/pathfind.c       Fri Sep 25 05:43:42 2009
+++ new/usr/src/lib/libast/common/path/pathfind.c       Fri Sep 25 05:43:40 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/path/pathgetlink.c    Fri Sep 25 05:43:45 2009
+++ new/usr/src/lib/libast/common/path/pathgetlink.c    Fri Sep 25 05:43:43 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/path/pathkey.c        Fri Sep 25 05:43:47 2009
+++ new/usr/src/lib/libast/common/path/pathkey.c        Fri Sep 25 05:43:45 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -151,7 +151,7 @@
                if (!(k = getenv("PROBE_ATTRIBUTES")))
                        k = getenv("VERSION_ENVIRONMENT");
                if (k)
-                       while (c < elementsof(usr))
+                       while (c < (elementsof(usr) - 1))
                        {
                                while (*k && (*k == ':' || *k == ' '))
                                        k++;
--- old/usr/src/lib/libast/common/path/pathnative.c     Fri Sep 25 05:43:50 2009
+++ new/usr/src/lib/libast/common/path/pathnative.c     Fri Sep 25 05:43:48 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/path/pathpath.c       Fri Sep 25 05:43:52 2009
+++ new/usr/src/lib/libast/common/path/pathpath.c       Fri Sep 25 05:43:50 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/path/pathposix.c      Fri Sep 25 05:43:54 2009
+++ new/usr/src/lib/libast/common/path/pathposix.c      Fri Sep 25 05:43:53 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/path/pathprobe.c      Fri Sep 25 05:43:57 2009
+++ new/usr/src/lib/libast/common/path/pathprobe.c      Fri Sep 25 05:43:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- /dev/null   Fri Sep 25 05:43:59 2009
+++ new/usr/src/lib/libast/common/path/pathprog.c       Fri Sep 25 05:43:58 2009
@@ -0,0 +1,119 @@
+/***********************************************************************
+*                                                                      *
+*               This software is part of the ast package               *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
+*                      and is licensed under the                       *
+*                  Common Public License, Version 1.0                  *
+*                    by AT&T Intellectual Property                     *
+*                                                                      *
+*                A copy of the License is available at                 *
+*            http://www.opensource.org/licenses/cpl1.0.txt             *
+*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
+*                                                                      *
+*              Information and Software Systems Research               *
+*                            AT&T Research                             *
+*                           Florham Park NJ                            *
+*                                                                      *
+*                 Glenn Fowler <gsf at research.att.com>                  *
+*                  David Korn <dgk at research.att.com>                   *
+*                   Phong Vo <kpv at research.att.com>                    *
+*                                                                      *
+***********************************************************************/
+#pragma prototyped
+/*
+ * Glenn Fowler
+ * AT&T Research
+ *
+ * return the full path of the current program in path
+ * command!=0 is used as a default
+ */
+
+#include <ast.h>
+
+#if _WINIX
+#include <ast_windows.h>
+#include <ctype.h>
+#endif
+
+#include "FEATURE/prog"
+
+static size_t
+prog(const char* command, char* path, size_t size)
+{
+       ssize_t         n;
+#if _WINIX || _lib_getexecname
+       char*           s;
+#endif
+#if _WINIX
+       char*           t;
+       char*           e;
+       int             c;
+       int             q;
+#endif
+
+#ifdef _PROC_PROG
+       if ((n = readlink(_PROC_PROG, path, size)) > 0)
+       {
+               if (n < size)
+                       path[n] = 0;
+               return n;
+       }
+#endif
+#if _lib_getexecname
+       if (s = (char*)getexecname())
+       {
+               n = strlen(s);
+               if (n < size)
+                       strcpy(path, s);
+               return n;
+       }
+#endif
+#if _WINIX
+       if (s = GetCommandLine())
+       {
+               n = 0;
+               q = 0;
+               t = path;
+               e = path + size - 1;
+               while (c = *s++)
+               {
+                       if (c == q)
+                               q = 0;
+                       else if (!q && c == '"')
+                               q = c;
+                       else if (!q && isspace(c))
+                               break;
+                       else if (t < e)
+                               *t++ = c == '\\' ? '/' : c;
+                       else
+                               n++;
+               }
+               if (t < e)
+                       *t = 0;
+               return (t - path) + n;
+       }
+#endif
+       if (command)
+       {
+               if ((n = strlen(command) + 1) <= size)
+                       memcpy(path, command, n);
+               return n;
+       }
+       return 0;
+}
+
+size_t
+pathprog(const char* command, char* path, size_t size)
+{
+       ssize_t         n;
+       char            buf[PATH_MAX];
+
+       if ((n = prog(command, path, size)) > 0 && n <= size && *path != '/')
+       {
+               if (!pathpath(buf, path, NiL, PATH_REGULAR|PATH_EXECUTE))
+                       n = 0;
+               else if ((n = strlen(buf) + 1) <= size)
+                       memcpy(path, buf, n);
+       }
+       return n;
+}
--- old/usr/src/lib/libast/common/path/pathrepl.c       Fri Sep 25 05:44:02 2009
+++ new/usr/src/lib/libast/common/path/pathrepl.c       Fri Sep 25 05:44:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/path/pathsetlink.c    Fri Sep 25 05:44:04 2009
+++ new/usr/src/lib/libast/common/path/pathsetlink.c    Fri Sep 25 05:44:02 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/path/pathshell.c      Fri Sep 25 05:44:07 2009
+++ new/usr/src/lib/libast/common/path/pathshell.c      Fri Sep 25 05:44:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/path/pathstat.c       Fri Sep 25 05:44:09 2009
+++ new/usr/src/lib/libast/common/path/pathstat.c       Fri Sep 25 05:44:07 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/path/pathtemp.c       Fri Sep 25 05:44:12 2009
+++ new/usr/src/lib/libast/common/path/pathtemp.c       Fri Sep 25 05:44:10 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/path/pathtmp.c        Fri Sep 25 05:44:14 2009
+++ new/usr/src/lib/libast/common/path/pathtmp.c        Fri Sep 25 05:44:12 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/port/astconf.c        Fri Sep 25 05:44:17 2009
+++ new/usr/src/lib/libast/common/port/astconf.c        Fri Sep 25 05:44:15 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -26,7 +26,7 @@
  * extended to allow some features to be set per-process
  */
 
-static const char id[] = "\n@(#)$Id: getconf (AT&T Research) 2008-04-24 $\0\n";
+static const char id[] = "\n@(#)$Id: getconf (AT&T Research) 2009-07-02 $\0\n";
 
 #include "univlib.h"
 
@@ -40,6 +40,10 @@
 #include "conftab.h"
 #include "FEATURE/libpath"
 
+#ifndef DEBUG_astconf
+#define DEBUG_astconf          0
+#endif
+
 #ifndef _pth_getconf
 #undef ASTCONF_system
 #define ASTCONF_system         0
@@ -64,23 +68,14 @@
 # undef        _lib_sysinfo
 #endif
 
-#define OP_conformance         1
-#define OP_fs_3d               2
-#define OP_getconf             3
-#define OP_hosttype            4
-#define OP_libpath             5
-#define OP_libprefix           6
-#define OP_libsuffix           7
-#define OP_path_attributes     8
-#define OP_path_resolve                9
-#define OP_universe            10
-
 #define CONF_ERROR     (CONF_USER<<0)
 #define CONF_READONLY  (CONF_USER<<1)
 #define CONF_ALLOC     (CONF_USER<<2)
 #define CONF_GLOBAL    (CONF_USER<<3)
 
+#define DEFAULT(o)     
((state.std||!dynamic[o].ast)?dynamic[o].std:dynamic[o].ast)
 #define INITIALIZE()   do{if(!state.data)synthesize(NiL,NiL,NiL);}while(0)
+#define STANDARD(v)    
(streq(v,"standard")||streq(v,"strict")||streq(v,"posix")||streq(v,"xopen"))
 
 #define MAXVAL         256
 
@@ -101,7 +96,8 @@
        struct Feature_s*next;
        const char*     name;
        char*           value;
-       char*           strict;
+       char*           std;
+       char*           ast;
        short           length;
        short           standard;
        unsigned int    flags;
@@ -120,28 +116,33 @@
 
 static Feature_t       dynamic[] =
 {
+#define OP_conformance 0
        {
-               &dynamic[1],
+               &dynamic[OP_conformance+1],
                "CONFORMANCE",
                "ast",
                "standard",
+               "ast",
                11,
                CONF_AST,
                0,
                OP_conformance
        },
+#define OP_fs_3d       1
        {
-               &dynamic[2],
+               &dynamic[OP_fs_3d+1],
                "FS_3D",
                &null[0],
                "0",
+               0,
                5,
                CONF_AST,
                0,
                OP_fs_3d
        },
+#define OP_getconf     2
        {
-               &dynamic[3],
+               &dynamic[OP_getconf+1],
                "GETCONF",
 #ifdef _pth_getconf
                _pth_getconf,
@@ -149,23 +150,27 @@
                &null[0],
 #endif
                0,
+               0,
                7,
                CONF_AST,
                CONF_READONLY,
                OP_getconf
        },
+#define OP_hosttype    3
        {
-               &dynamic[4],
+               &dynamic[OP_hosttype+1],
                "HOSTTYPE",
                HOSTTYPE,
                0,
+               0,
                8,
                CONF_AST,
                CONF_READONLY,
                OP_hosttype
        },
+#define OP_libpath     4
        {
-               &dynamic[5],
+               &dynamic[OP_libpath+1],
                "LIBPATH",
 #ifdef CONF_LIBPATH
                CONF_LIBPATH,
@@ -173,13 +178,15 @@
                &null[0],
 #endif
                0,
+               0,
                7,
                CONF_AST,
                0,
                OP_libpath
        },
+#define OP_libprefix   5
        {
-               &dynamic[6],
+               &dynamic[OP_libprefix+1],
                "LIBPREFIX",
 #ifdef CONF_LIBPREFIX
                CONF_LIBPREFIX,
@@ -187,13 +194,15 @@
                "lib",
 #endif
                0,
+               0,
                9,
                CONF_AST,
                0,
                OP_libprefix
        },
+#define OP_libsuffix   6
        {
-               &dynamic[7],
+               &dynamic[OP_libsuffix+1],
                "LIBSUFFIX",
 #ifdef CONF_LIBSUFFIX
                CONF_LIBSUFFIX,
@@ -201,13 +210,15 @@
                ".so",
 #endif
                0,
+               0,
                9,
                CONF_AST,
                0,
                OP_libsuffix
        },
+#define OP_path_attributes     7
        {
-               &dynamic[8],
+               &dynamic[OP_path_attributes+1],
                "PATH_ATTRIBUTES",
 #if _WINIX
                "c",
@@ -215,15 +226,18 @@
                &null[0],
 #endif
                &null[0],
+               0,
                15,
                CONF_AST,
                CONF_READONLY,
                OP_path_attributes
        },
+#define OP_path_resolve        8
        {
-               &dynamic[9],
+               &dynamic[OP_path_resolve+1],
                "PATH_RESOLVE",
                &null[0],
+               "physical",
                "metaphysical",
                12,
                CONF_AST,
@@ -230,11 +244,13 @@
                0,
                OP_path_resolve
        },
+#define OP_universe    9
        {
                0,
                "UNIVERSE",
                &null[0],
                "att",
+               0,
                8,
                CONF_AST,
                0,
@@ -252,6 +268,8 @@
        const char*     name;
        Feature_t*      features;
 
+       int             std;
+
        /* default initialization from here down */
 
        int             prefix;
@@ -266,7 +284,7 @@
 
 } State_t;
 
-static State_t state = { "getconf", "_AST_FEATURES", dynamic };
+static State_t state = { "getconf", "_AST_FEATURES", dynamic, -1 };
 
 static char*   feature(const char*, const char*, const char*, unsigned int, 
Error_f);
 
@@ -293,9 +311,10 @@
        register char*          s;
        register char*          d;
        register char*          v;
+       register char*          p;
        register int            n;
 
-#if DEBUG || DEBUG_astconf
+#if DEBUG_astconf
        if (fp)
                error(-2, "astconf synthesize name=%s path=%s value=%s 
fp=%p%s", fp->name, path, value, fp, state.synthesizing ? " SYNTHESIZING" : "");
 #endif
@@ -376,11 +395,11 @@
                                value = (const char*)d;
                                goto ok;
                        }
-                       for (s = d + n + 1; *s && !isspace(*s); s++);
+                       for (s = p = d + n + 1; *s && !isspace(*s); s++);
                        for (; isspace(*s); s++);
                        for (v = s; *s && !isspace(*s); s++);
                        n = s - v;
-                       if (strneq(v, value, n))
+                       if ((!path || *path == *p && strlen(path) == (v - p - 
1) && !memcmp(path, p, v - p - 1)) && strneq(v, value, n))
                                goto ok;
                        for (; isspace(*s); s++);
                        if (*s)
@@ -433,6 +452,9 @@
        for (s = (char*)path; *d = *s++; d++);
        *d++ = ' ';
        for (s = (char*)value; *d = *s++; d++);
+#if DEBUG_astconf
+       error(-3, "astconf synthesize %s", state.data - state.prefix);
+#endif
        setenviron(state.data - state.prefix);
        if (state.notify)
                (*state.notify)(NiL, NiL, state.data - state.prefix);
@@ -466,7 +488,7 @@
        register char*  p;
        register int    ok = 1;
 
-#if DEBUG || DEBUG_astconf
+#if DEBUG_astconf
        error(-2, "astconf initialize name=%s path=%s command=%s succeed=%s 
fail=%s fp=%p%s", fp->name, path, command, succeed, fail, fp, 
state.synthesizing ? " SYNTHESIZING" : "");
 #endif
        switch (fp->op)
@@ -484,7 +506,7 @@
                ok = fs3d(FS3D_TEST);
                break;
        case OP_universe:
-               ok = streq(_UNIV_DEFAULT, "att");
+               ok = streq(_UNIV_DEFAULT, DEFAULT(OP_universe));
                /*FALLTHROUGH...*/
        default:
                if (p = getenv("PATH"))
@@ -493,7 +515,7 @@
                        register char*  d = p;
                        Sfio_t*         tmp;
 
-#if DEBUG || DEBUG_astconf
+#if DEBUG_astconf
                        error(-2, "astconf initialize name=%s ok=%d PATH=%s", 
fp->name, ok, p);
 #endif
                        if (tmp = sfstropen())
@@ -566,6 +588,9 @@
                }
                break;
        }
+#if DEBUG_astconf
+       error(-1, "AHA#%d state.std=%d %s [%s] std=%s ast=%s value=%s ok=%d", 
__LINE__,  state.std, fp->name, ok ? succeed : fail, fp->std, fp->ast, 
fp->value, ok);
+#endif
        synthesize(fp, path, ok ? succeed : fail);
 }
 
@@ -579,7 +604,7 @@
        register Feature_t*     sp;
        register int            n;
 
-#if DEBUG || DEBUG_astconf
+#if DEBUG_astconf
        error(-2, "astconf format name=%s path=%s value=%s flags=%04x fp=%p%s", 
fp->name, path, value, flags, fp, state.synthesizing ? " SYNTHESIZING" : "");
 #endif
        if (value)
@@ -590,15 +615,27 @@
        {
 
        case OP_conformance:
-               if (value && (streq(value, "strict") || streq(value, "posix") 
|| streq(value, "xopen")))
-                       value = fp->strict;
-               n = streq(fp->value, fp->strict);
+               if (value && STANDARD(value))
+                       value = fp->std;
+               n = state.std = streq(fp->value, fp->std);
+#if DEBUG_astconf
+               error(-1, "AHA#%d state.std=%d %s [%s] std=%s ast=%s value=%s", 
__LINE__,  state.std, fp->name, value, fp->std, fp->ast, fp->value);
+#endif
                if (!synthesize(fp, path, value))
-                       initialize(fp, path, NiL, fp->strict, fp->value);
-               if (!n && streq(fp->value, fp->strict))
+                       initialize(fp, path, NiL, fp->std, fp->value);
+#if DEBUG_astconf
+               error(-1, "AHA#%d state.std=%d %s [%s] std=%s ast=%s value=%s", 
__LINE__,  state.std, fp->name, value, fp->std, fp->ast, fp->value);
+#endif
+               if (!n && STANDARD(fp->value))
+               {
+                       state.std = 1;
                        for (sp = state.features; sp; sp = sp->next)
-                               if (sp->strict && sp->op && sp->op != 
OP_conformance)
-                                       astconf(sp->name, path, sp->strict);
+                               if (sp->std && sp->op && sp->op != 
OP_conformance)
+                                       astconf(sp->name, path, sp->std);
+               }
+#if DEBUG_astconf
+               error(-1, "AHA#%d state.std=%d %s [%s] std=%s ast=%s value=%s", 
__LINE__,  state.std, fp->name, value, fp->std, fp->ast, fp->value);
+#endif
                break;
 
        case OP_fs_3d:
@@ -637,13 +674,13 @@
 
        case OP_path_resolve:
                if (!synthesize(fp, path, value))
-                       initialize(fp, path, NiL, "logical", "metaphysical");
+                       initialize(fp, path, NiL, "logical", 
DEFAULT(OP_path_resolve));
                break;
 
        case OP_universe:
 #if _lib_universe
                if (getuniverse(fp->value) < 0)
-                       strcpy(fp->value, "att");
+                       strcpy(fp->value, DEFAULT(OP_universe));
                if (value)
                        setuniverse(value);
 #else
@@ -672,9 +709,26 @@
                strcpy(fp->value, univ_name[n - 1]);
 #else
                if (value && streq(path, "="))
-                       strcpy(fp->value, value);
+               {
+                       if (state.synthesizing)
+                       {
+                               if (!(fp->flags & CONF_ALLOC))
+                                       fp->value = 0;
+                               n = strlen(value);
+                               if (!(fp->value = newof(fp->value, char, n, 1)))
+                                       fp->value = null;
+                               else
+                               {
+                                       fp->flags |= CONF_ALLOC;
+                                       memcpy(fp->value, value, n);
+                                       fp->value[n] = 0;
+                               }
+                       }
+                       else
+                               synthesize(fp, path, value);
+               }
                else
-                       initialize(fp, path, "echo", "att", "ucb");
+                       initialize(fp, path, "echo", DEFAULT(OP_universe), 
"ucb");
 #endif
 #endif
                break;
@@ -704,7 +758,7 @@
        if (value && (streq(value, "-") || streq(value, "0")))
                value = null;
        for (fp = state.features; fp && !streq(fp->name, name); fp = fp->next);
-#if DEBUG || DEBUG_astconf
+#if DEBUG_astconf
        error(-2, "astconf feature name=%s path=%s value=%s flags=%04x 
fp=%p%s", name, path, value, flags, fp, state.synthesizing ? " SYNTHESIZING" : 
"");
 #endif
        if (!fp)
@@ -720,9 +774,11 @@
                                (*conferror)(&state, &state, 2, "%s: out of 
space", name);
                        return 0;
                }
+               fp->op = -1;
                fp->name = (const char*)fp + sizeof(Feature_t);
                strcpy((char*)fp->name, name);
                fp->length = n;
+               fp->std = &null[0];
                fp->next = state.features;
                state.features = fp;
        }
@@ -807,7 +863,7 @@
                look->section = 1;
 #endif
        look->name = name;
-#if DEBUG || DEBUG_astconf
+#if DEBUG_astconf
        error(-2, "astconf normal name=%s standard=%d section=%d call=%d 
flags=%04x elements=%d", look->name, look->standard, look->section, look->call, 
flags, conf_elements);
 #endif
        c = *((unsigned char*)name);
@@ -814,7 +870,7 @@
        while (lo <= hi)
        {
                mid = lo + (hi - lo) / 2;
-#if DEBUG || DEBUG_astconf
+#if DEBUG_astconf
                error(-3, "astconf lookup name=%s mid=%s", name, mid->name);
 #endif
                if (!(v = c - *((unsigned char*)mid->name)) && !(v = 
strcmp(name, mid->name)))
@@ -849,7 +905,7 @@
        if (look->call < 0 && look->standard >= 0 && (look->section <= 1 || 
(mid->flags & CONF_MINMAX)))
                look->flags |= CONF_MINMAX;
        look->conf = mid;
-#if DEBUG || DEBUG_astconf
+#if DEBUG_astconf
        error(-2, "astconf lookup name=%s standard=%d:%d section=%d:%d 
call=%d:%d", look->name, look->standard, mid->standard, look->section, 
mid->section, look->call, mid->call);
 #endif
        return 1;
@@ -904,9 +960,9 @@
                flags |= CONF_PREFIXED;
        olderrno = errno;
        errno = 0;
-#if DEBUG || DEBUG_astconf
-       error(-1, "astconf name=%s:%s standard=%d section=%d call=%s op=%d 
flags=|%s%s%s%s%s:|%s%s%s%s%s%s%s%s%s%s"
-               , name , p->name, p->standard, p->section, prefix[p->call + 
CONF_call].name, p->op
+#if DEBUG_astconf
+       error(-1, "astconf name=%s:%s:%s standard=%d section=%d call=%s op=%d 
flags=|%s%s%s%s%s:|%s%s%s%s%s%s%s%s%s%s"
+               , name, look->name, p->name, p->standard, p->section, 
prefix[p->call + CONF_call].name, p->op
                , (flags & CONF_FEATURE) ? "FEATURE|" : ""
                , (flags & CONF_LIMIT) ? "LIMIT|" : ""
                , (flags & CONF_MINMAX) ? "MINMAX|" : ""
@@ -1035,7 +1091,7 @@
                call = 0;
                if (p->standard == CONF_AST)
                {
-                       if (streq(look->name, "RELEASE") && (i = 
open("/proc/version", O_RDONLY)) >= 0)
+                       if (streq(p->name, "RELEASE") && (i = 
open("/proc/version", O_RDONLY)) >= 0)
                        {
                                n = read(i, buf, sizeof(buf) - 1);
                                close(i);
@@ -1061,7 +1117,7 @@
        predef:
                if (look->standard == CONF_AST)
                {
-                       if (streq(look->name, "VERSION"))
+                       if (streq(p->name, "VERSION"))
                        {
                                v = _AST_VERSION;
                                break;
@@ -1253,7 +1309,7 @@
        char*           cmd[3];
        long            ops[2];
 
-#if DEBUG || DEBUG_astconf
+#if DEBUG_astconf
        error(-2, "astconf defer %s %s", _pth_getconf, operand);
 #endif
        cmd[0] = (char*)state.id;
--- old/usr/src/lib/libast/common/port/astcopy.c        Fri Sep 25 05:44:20 2009
+++ new/usr/src/lib/libast/common/port/astcopy.c        Fri Sep 25 05:44:18 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/port/astdynamic.c     Fri Sep 25 05:44:22 2009
+++ new/usr/src/lib/libast/common/port/astdynamic.c     Fri Sep 25 05:44:20 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/port/astlicense.c     Fri Sep 25 05:44:25 2009
+++ new/usr/src/lib/libast/common/port/astlicense.c     Fri Sep 25 05:44:23 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -428,7 +428,8 @@
        line = 0;
        for (;;)
        {
-               for (first = 1; c = *s; first = 0)
+               first = 1;
+               while (c = *s)
                {
                        while (c == ' ' || c == '\t' || c == '\n' && ++line || 
c == '\r' || c == ',' || c == ';' || c == ')')
                                c = *++s;
@@ -640,6 +641,7 @@
                        }
                        if (*s)
                                s++;
+                       first = 0;
                }
                if (!options || !*(s = options))
                        break;
--- old/usr/src/lib/libast/common/port/astmath.c        Fri Sep 25 05:44:27 2009
+++ new/usr/src/lib/libast/common/port/astmath.c        Fri Sep 25 05:44:25 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/port/astquery.c       Fri Sep 25 05:44:30 2009
+++ new/usr/src/lib/libast/common/port/astquery.c       Fri Sep 25 05:44:28 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/port/aststatic.c      Fri Sep 25 05:44:32 2009
+++ new/usr/src/lib/libast/common/port/aststatic.c      Fri Sep 25 05:44:30 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/port/astwinsize.c     Fri Sep 25 05:44:35 2009
+++ new/usr/src/lib/libast/common/port/astwinsize.c     Fri Sep 25 05:44:33 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/port/iblocks.c        Fri Sep 25 05:44:37 2009
+++ new/usr/src/lib/libast/common/port/iblocks.c        Fri Sep 25 05:44:35 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/port/lc.c     Fri Sep 25 05:44:40 2009
+++ new/usr/src/lib/libast/common/port/lc.c     Fri Sep 25 05:44:38 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -703,6 +703,8 @@
        lc->language = lp ? lp : &lc_languages[0];
        lc->territory = tp ? tp : &lc_territories[0];
        lc->charset = cp ? cp : &lc_charsets[0];  
+       if (!strcmp(lc->charset->code, "utf8"))
+               lc->flags |= LC_utf8;
        lc->attributes = al;
        for (i = 0; i < elementsof(lc->info); i++)
                lc->info[i].lc = lc;
--- old/usr/src/lib/libast/common/port/lcgen.c  Fri Sep 25 05:44:42 2009
+++ new/usr/src/lib/libast/common/port/lcgen.c  Fri Sep 25 05:44:40 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -323,14 +323,15 @@
        fprintf(hf, "\n");
        fprintf(hf, "#define LC_abbreviated\t\t0x00001\n");
        fprintf(hf, "#define LC_checked\t\t0x00002\n");
-       fprintf(hf, "#define LC_default\t\t0x00004\n");
-       fprintf(hf, "#define LC_defined\t\t0x00008\n");
-       fprintf(hf, "#define LC_debug\t\t0x00010\n");
+       fprintf(hf, "#define LC_debug\t\t0x00004\n");
+       fprintf(hf, "#define LC_default\t\t0x00008\n");
+       fprintf(hf, "#define LC_defined\t\t0x00010\n");
        fprintf(hf, "#define LC_local\t\t0x00020\n");
        fprintf(hf, "#define LC_primary\t\t0x00040\n");
        fprintf(hf, "#define LC_qualified\t\t0x00080\n");
        fprintf(hf, "#define LC_undefined\t\t0x00100\n");
-       fprintf(hf, "#define LC_verbose\t\t0x00200\n");
+       fprintf(hf, "#define LC_utf8\t\t\t0x00200\n");
+       fprintf(hf, "#define LC_verbose\t\t0x00400\n");
        fprintf(hf, "#define LC_user\t\t\t0x10000\n");
        fprintf(lf, "/* : : generated by %s : : */\n", command);
        fprintf(lf, "\n");
--- old/usr/src/lib/libast/common/port/lclang.h Fri Sep 25 05:44:45 2009
+++ new/usr/src/lib/libast/common/port/lclang.h Fri Sep 25 05:44:43 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/port/lclib.h  Fri Sep 25 05:44:47 2009
+++ new/usr/src/lib/libast/common/port/lclib.h  Fri Sep 25 05:44:45 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/port/mc.c     Fri Sep 25 05:44:50 2009
+++ new/usr/src/lib/libast/common/port/mc.c     Fri Sep 25 05:44:48 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/port/mnt.c    Fri Sep 25 05:44:52 2009
+++ new/usr/src/lib/libast/common/port/mnt.c    Fri Sep 25 05:44:50 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/port/touch.c  Fri Sep 25 05:44:55 2009
+++ new/usr/src/lib/libast/common/port/touch.c  Fri Sep 25 05:44:53 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/preroot/getpreroot.c  Fri Sep 25 05:44:57 2009
+++ new/usr/src/lib/libast/common/preroot/getpreroot.c  Fri Sep 25 05:44:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/preroot/ispreroot.c   Fri Sep 25 05:45:00 2009
+++ new/usr/src/lib/libast/common/preroot/ispreroot.c   Fri Sep 25 05:44:58 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/preroot/realopen.c    Fri Sep 25 05:45:02 2009
+++ new/usr/src/lib/libast/common/preroot/realopen.c    Fri Sep 25 05:45:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/preroot/setpreroot.c  Fri Sep 25 05:45:05 2009
+++ new/usr/src/lib/libast/common/preroot/setpreroot.c  Fri Sep 25 05:45:03 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/regex/regalloc.c      Fri Sep 25 05:45:07 2009
+++ new/usr/src/lib/libast/common/regex/regalloc.c      Fri Sep 25 05:45:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/regex/regcache.c      Fri Sep 25 05:45:10 2009
+++ new/usr/src/lib/libast/common/regex/regcache.c      Fri Sep 25 05:45:08 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/regex/regclass.c      Fri Sep 25 05:45:12 2009
+++ new/usr/src/lib/libast/common/regex/regclass.c      Fri Sep 25 05:45:10 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/regex/regcoll.c       Fri Sep 25 05:45:15 2009
+++ new/usr/src/lib/libast/common/regex/regcoll.c       Fri Sep 25 05:45:13 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/regex/regcomp.c       Fri Sep 25 05:45:17 2009
+++ new/usr/src/lib/libast/common/regex/regcomp.c       Fri Sep 25 05:45:15 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -121,6 +121,7 @@
        int             parno;          /* number of last open paren    */
        int             parnest;        /* paren nest count             */
        int             posixkludge;    /* to make * nonspecial         */
+       int             regexp;         /* <regexp.h> compatibility     */
        Token_t         token;          /* token lookahead              */
        Stats_t         stats;          /* RE statistics                */
        int             terminator;     /* pattern terminator           */
@@ -1289,6 +1290,8 @@
                        case 0:
                                goto error;
                        case ':':
+                               if (env->regexp)
+                                       goto normal;
                                if (inrange == 1)
                                {
                                        setadd(e->re.charclass, last);
@@ -1336,6 +1339,8 @@
                                elements++;
                                continue;
                        case '=':
+                               if (env->regexp)
+                                       goto normal;
                                if (inrange == 2)
                                        goto erange;
                                if (inrange == 1)
@@ -1355,6 +1360,8 @@
                                elements++;
                                continue;
                        case '.':
+                               if (env->regexp)
+                                       goto normal;
                                if ((c = regcollate((char*)env->cursor, 
(char**)&env->cursor, (char*)buf, sizeof(buf))) < 0)
                                        goto ecollate;
                                if (c > 1)
@@ -1363,6 +1370,7 @@
                                complicated++;
                                break;
                        default:
+                       normal:
                                if (*env->cursor == env->terminator || 
*env->cursor == env->delimiter && (env->flags & REG_ESCAPE))
                                        goto error;
                                break;
@@ -1535,6 +1543,8 @@
                                        case 0:
                                                goto error;
                                        case ':':
+                                               if (env->regexp)
+                                                       goto complicated_normal;
                                                if (inrange == 1)
                                                        ce = col(ce, ic, rp, 
rw, rc, NiL, 0, 0);
                                                if (!(f = 
regclass((char*)env->cursor, (char**)&env->cursor)))
@@ -1569,6 +1579,8 @@
                                                inrange = 0;
                                                continue;
                                        case '=':
+                                               if (env->regexp)
+                                                       goto complicated_normal;
                                                if (inrange == 2)
                                                        goto erange;
                                                if (inrange == 1)
@@ -1629,6 +1641,8 @@
                                                c = *pp;
                                                continue;
                                        case '.':
+                                               if (env->regexp)
+                                                       goto complicated_normal;
                                                pp = (unsigned 
char*)cb[inrange];
                                                if ((w = 
regcollate((char*)env->cursor, (char**)&env->cursor, (char*)pp, COLL_KEY_MAX)) 
< 0)
                                                        goto ecollate;
@@ -1635,6 +1649,7 @@
                                                c = buf[0];
                                                break;
                                        default:
+                                       complicated_normal:
                                                if (*env->cursor == 
env->terminator || *env->cursor == env->delimiter && (env->flags & REG_ESCAPE))
                                                        goto error;
                                                break;
@@ -3226,6 +3241,7 @@
                env.explicit = env.mappednewline;
        p->env->leading = (env.flags & REG_SHELL_DOT) ? env.mappeddot : -1;
        env.posixkludge = !(env.flags & (REG_EXTENDED|REG_SHELL));
+       env.regexp = !!(env.flags & REG_REGEXP);
        env.token.lex = 0;
        env.token.push = 0;
        if (env.flags & REG_DELIMITED)
--- old/usr/src/lib/libast/common/regex/regdecomp.c     Fri Sep 25 05:45:20 2009
+++ new/usr/src/lib/libast/common/regex/regdecomp.c     Fri Sep 25 05:45:18 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/regex/regerror.c      Fri Sep 25 05:45:23 2009
+++ new/usr/src/lib/libast/common/regex/regerror.c      Fri Sep 25 05:45:21 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/regex/regexec.c       Fri Sep 25 05:45:25 2009
+++ new/usr/src/lib/libast/common/regex/regexec.c       Fri Sep 25 05:45:23 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/regex/regfatal.c      Fri Sep 25 05:45:28 2009
+++ new/usr/src/lib/libast/common/regex/regfatal.c      Fri Sep 25 05:45:26 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/regex/reginit.c       Fri Sep 25 05:45:30 2009
+++ new/usr/src/lib/libast/common/regex/reginit.c       Fri Sep 25 05:45:28 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/regex/reglib.h        Fri Sep 25 05:45:33 2009
+++ new/usr/src/lib/libast/common/regex/reglib.h        Fri Sep 25 05:45:31 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -65,6 +65,10 @@
 #include <ctype.h>
 #include <errno.h>
 
+#if _BLD_DEBUG && !defined(_AST_REGEX_DEBUG)
+#define _AST_REGEX_DEBUG       1
+#endif
+
 #define MBSIZE(p)      ((ast.tmp_int=mbsize(p))>0?ast.tmp_int:1)
 
 #undef RE_DUP_MAX                      /* posix puts this in limits.h! */
--- old/usr/src/lib/libast/common/regex/regnexec.c      Fri Sep 25 05:45:35 2009
+++ new/usr/src/lib/libast/common/regex/regnexec.c      Fri Sep 25 05:45:33 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -406,7 +406,7 @@
        int     r = NONE;
        Rex_t   catcher;
 
-       DEBUG_TEST(0x0010,(sfprintf(sfstdout, "AHA#%04d 0x%04x parserep %s %d 
%d %d `%-.*s'\n", __LINE__, debug_flag, rexname(rex->re.group.expr.rex), 
rex->lo, n, rex->hi, env->end - s, s)),(0));
+       DEBUG_TEST(0x0010,(sfprintf(sfstdout, "AHA#%04d 0x%04x parserep %s %d 
%d %d %d `%-.*s'\n", __LINE__, debug_flag, rexname(rex->re.group.expr.rex), 
rex->re.group.number, rex->lo, n, rex->hi, env->end - s, s)),(0));
        if ((rex->flags & REG_MINIMAL) && n >= rex->lo && n < rex->hi)
        {
                if (env->stack && pospush(env, rex, s, END_ANY))
@@ -438,21 +438,19 @@
                        rex->re.rep_catch.beg = s;
                if (env->stack)
                {
-DEBUG_TEST(0x0004,(sfprintf(sfstdout,"AHA#%04d 0x%04x PUSH (%d,%d)(%d,%d) 
(%d,%d)(%d,%d)\n", __LINE__, debug_flag, rex->re.group.number, 
env->best[0].rm_so, env->best[0].rm_eo, env->best[1].rm_so, env->best[1].rm_eo, 
env->match[0].rm_so, env->match[0].rm_eo, env->match[1].rm_so, 
env->match[1].rm_eo)),(0));
                        if (matchpush(env, rex))
                                return BAD;
                        if (pospush(env, rex, s, BEG_ONE))      
                                return BAD;
-DEBUG_TEST(0x0004,(sfprintf(sfstdout,"AHA#%04d 0x%04x PUSH (%d,%d)(%d,%d) 
(%d,%d)(%d,%d)\n", __LINE__, debug_flag, rex->re.group.number, 
env->best[0].rm_so, env->best[0].rm_eo, env->best[1].rm_so, env->best[1].rm_eo, 
env->match[0].rm_so, env->match[0].rm_eo, env->match[1].rm_so, 
env->match[1].rm_eo)),(0));
+DEBUG_TEST(0x0004,(sfprintf(sfstdout,"AHA#%04d 0x%04x PUSH %d   
(%d,%d)(%d,%d)(%d,%d) (%d,%d)(%d,%d)(%d,%d)\n", __LINE__, debug_flag, 
rex->re.group.number, env->best[0].rm_so, env->best[0].rm_eo, 
env->best[1].rm_so, env->best[1].rm_eo, env->best[2].rm_so, env->best[2].rm_eo, 
env->match[0].rm_so, env->match[0].rm_eo, env->match[1].rm_so, 
env->match[1].rm_eo, env->match[2].rm_so, env->match[2].rm_eo)),(0));
                }
                r = parse(env, rex->re.group.expr.rex, &catcher, s);
-               DEBUG_TEST(0x0010,(sfprintf(sfstdout, "AHA#%04d 0x%04x parserep 
parse %d `%-.*s'\n", __LINE__, debug_flag, r, env->end - s, s)),(0));
+               DEBUG_TEST(0x0010,(sfprintf(sfstdout, "AHA#%04d 0x%04x parserep 
parse %d %d `%-.*s'\n", __LINE__, debug_flag, rex->re.group.number, r, env->end 
- s, s)),(0));
                if (env->stack)
                {
-DEBUG_TEST(0x0004,(sfprintf(sfstdout,"AHA#%04d 0x%04x POP (%d,%d)(%d,%d) 
(%d,%d)(%d,%d)\n", __LINE__, debug_flag, rex->re.group.number, 
env->best[0].rm_so, env->best[0].rm_eo, env->best[1].rm_so, env->best[1].rm_eo, 
env->match[0].rm_so, env->match[0].rm_eo, env->match[1].rm_so, 
env->match[1].rm_eo)),(0));
                        pospop(env);
                        matchpop(env, rex);
-DEBUG_TEST(0x0004,(sfprintf(sfstdout,"AHA#%04d 0x%04x POP (%d,%d)(%d,%d) 
(%d,%d)(%d,%d)\n", __LINE__, debug_flag, rex->re.group.number, 
env->best[0].rm_so, env->best[0].rm_eo, env->best[1].rm_so, env->best[1].rm_eo, 
env->match[0].rm_so, env->match[0].rm_eo, env->match[1].rm_so, 
env->match[1].rm_eo)),(0));
+DEBUG_TEST(0x0004,(sfprintf(sfstdout,"AHA#%04d 0x%04x POP  %d %d 
(%d,%d)(%d,%d)(%d,%d) (%d,%d)(%d,%d)(%d,%d)\n", __LINE__, debug_flag, 
rex->re.group.number, r, env->best[0].rm_so, env->best[0].rm_eo, 
env->best[1].rm_so, env->best[1].rm_eo, env->best[2].rm_so, env->best[2].rm_eo, 
env->match[0].rm_so, env->match[0].rm_eo, env->match[1].rm_so, 
env->match[1].rm_eo, env->match[2].rm_so, env->match[2].rm_eo)),(0));
                }
                switch (r)
                {
--- old/usr/src/lib/libast/common/regex/regrecord.c     Fri Sep 25 05:45:38 2009
+++ new/usr/src/lib/libast/common/regex/regrecord.c     Fri Sep 25 05:45:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/regex/regrexec.c      Fri Sep 25 05:45:41 2009
+++ new/usr/src/lib/libast/common/regex/regrexec.c      Fri Sep 25 05:45:39 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/regex/regstat.c       Fri Sep 25 05:45:43 2009
+++ new/usr/src/lib/libast/common/regex/regstat.c       Fri Sep 25 05:45:41 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/regex/regsub.c        Fri Sep 25 05:45:45 2009
+++ new/usr/src/lib/libast/common/regex/regsub.c        Fri Sep 25 05:45:44 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/regex/regsubcomp.c    Fri Sep 25 05:45:48 2009
+++ new/usr/src/lib/libast/common/regex/regsubcomp.c    Fri Sep 25 05:45:46 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/regex/regsubexec.c    Fri Sep 25 05:45:51 2009
+++ new/usr/src/lib/libast/common/regex/regsubexec.c    Fri Sep 25 05:45:49 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/regex/ucs_names.h     Fri Sep 25 05:45:53 2009
+++ new/usr/src/lib/libast/common/regex/ucs_names.h     Fri Sep 25 05:45:51 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/_sfclrerr.c      Fri Sep 25 05:45:57 2009
+++ new/usr/src/lib/libast/common/sfio/_sfclrerr.c      Fri Sep 25 05:45:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/_sfdlen.c        Fri Sep 25 05:45:59 2009
+++ new/usr/src/lib/libast/common/sfio/_sfdlen.c        Fri Sep 25 05:45:57 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/_sfeof.c Fri Sep 25 05:46:02 2009
+++ new/usr/src/lib/libast/common/sfio/_sfeof.c Fri Sep 25 05:46:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/_sferror.c       Fri Sep 25 05:46:04 2009
+++ new/usr/src/lib/libast/common/sfio/_sferror.c       Fri Sep 25 05:46:02 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/_sffileno.c      Fri Sep 25 05:46:06 2009
+++ new/usr/src/lib/libast/common/sfio/_sffileno.c      Fri Sep 25 05:46:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/_sfgetc.c        Fri Sep 25 05:46:09 2009
+++ new/usr/src/lib/libast/common/sfio/_sfgetc.c        Fri Sep 25 05:46:07 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/_sfgetl.c        Fri Sep 25 05:46:11 2009
+++ new/usr/src/lib/libast/common/sfio/_sfgetl.c        Fri Sep 25 05:46:10 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/_sfgetl2.c       Fri Sep 25 05:46:14 2009
+++ new/usr/src/lib/libast/common/sfio/_sfgetl2.c       Fri Sep 25 05:46:12 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/_sfgetu.c        Fri Sep 25 05:46:16 2009
+++ new/usr/src/lib/libast/common/sfio/_sfgetu.c        Fri Sep 25 05:46:15 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/_sfgetu2.c       Fri Sep 25 05:46:19 2009
+++ new/usr/src/lib/libast/common/sfio/_sfgetu2.c       Fri Sep 25 05:46:17 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/_sfllen.c        Fri Sep 25 05:46:21 2009
+++ new/usr/src/lib/libast/common/sfio/_sfllen.c        Fri Sep 25 05:46:20 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/_sfopen.c        Fri Sep 25 05:46:24 2009
+++ new/usr/src/lib/libast/common/sfio/_sfopen.c        Fri Sep 25 05:46:22 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/_sfputc.c        Fri Sep 25 05:46:26 2009
+++ new/usr/src/lib/libast/common/sfio/_sfputc.c        Fri Sep 25 05:46:25 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/_sfputd.c        Fri Sep 25 05:46:29 2009
+++ new/usr/src/lib/libast/common/sfio/_sfputd.c        Fri Sep 25 05:46:27 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/_sfputl.c        Fri Sep 25 05:46:31 2009
+++ new/usr/src/lib/libast/common/sfio/_sfputl.c        Fri Sep 25 05:46:30 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/_sfputm.c        Fri Sep 25 05:46:34 2009
+++ new/usr/src/lib/libast/common/sfio/_sfputm.c        Fri Sep 25 05:46:32 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/_sfputu.c        Fri Sep 25 05:46:36 2009
+++ new/usr/src/lib/libast/common/sfio/_sfputu.c        Fri Sep 25 05:46:34 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/_sfslen.c        Fri Sep 25 05:46:39 2009
+++ new/usr/src/lib/libast/common/sfio/_sfslen.c        Fri Sep 25 05:46:37 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/_sfstacked.c     Fri Sep 25 05:46:41 2009
+++ new/usr/src/lib/libast/common/sfio/_sfstacked.c     Fri Sep 25 05:46:40 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/_sfulen.c        Fri Sep 25 05:46:44 2009
+++ new/usr/src/lib/libast/common/sfio/_sfulen.c        Fri Sep 25 05:46:42 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/_sfvalue.c       Fri Sep 25 05:46:46 2009
+++ new/usr/src/lib/libast/common/sfio/_sfvalue.c       Fri Sep 25 05:46:44 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfclose.c        Fri Sep 25 05:46:49 2009
+++ new/usr/src/lib/libast/common/sfio/sfclose.c        Fri Sep 25 05:46:47 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfclrlock.c      Fri Sep 25 05:46:51 2009
+++ new/usr/src/lib/libast/common/sfio/sfclrlock.c      Fri Sep 25 05:46:49 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfcvt.c  Fri Sep 25 05:46:54 2009
+++ new/usr/src/lib/libast/common/sfio/sfcvt.c  Fri Sep 25 05:46:52 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -114,7 +114,8 @@
 {
        reg char                *sp;
        reg long                n, v;
-       reg char                *ep, *b, *endsp;
+       reg char                *ep, *b, *endsp, *t;
+       int                     x;
        _ast_flt_unsigned_max_t m;
 
        static char             lx[] = "0123456789abcdef";
@@ -193,7 +194,6 @@
 
                if(format & SFFMT_AFORMAT)
                {       Sfdouble_t      g;
-                       int             x;
                        b = sp = buf;
                        ep = (format & SFFMT_UPPER) ? ux : lx;
                        if(n_digit <= 0 || n_digit >= (size - 9))
@@ -210,9 +210,7 @@
                                while ((x -= 4) >= 0)
                                {       *sp++ = ep[(m >> x) & 0xf];
                                        if (sp >= endsp)
-                                       {       ep = sp + 1;
-                                               goto done;
-                                       }
+                                               goto around;
                                }
                                f -= m;
                                f = ldexpl(f, 8 * sizeof(m));
@@ -369,13 +367,12 @@
                        return SF_INF;
 
                if(format & SFFMT_AFORMAT)
-               {       double  g;
-                       int     x;
+               {       double          g;
                        b = sp = buf;
                        ep = (format & SFFMT_UPPER) ? ux : lx;
                        if(n_digit <= 0 || n_digit >= (size - 9))
                                n_digit = size - 9;
-                       endsp = sp + n_digit;
+                       endsp = sp + n_digit + 1;
 
                        g = frexp(f, &x);
                        *decpt = x;
@@ -387,9 +384,7 @@
                                while ((x -= 4) >= 0)
                                {       *sp++ = ep[(m >> x) & 0xf];
                                        if (sp >= endsp)
-                                       {       ep = sp + 1;
-                                               goto done;
-                                       }
+                                               goto around;
                                }
                                f -= m;
                                f = ldexp(f, 8 * sizeof(m));
@@ -503,9 +498,35 @@
                }
        }
 
-done:
+ done:
        *--ep = '\0';
        if(len)
                *len = ep-b;
        return b;
+ around:
+       if (((m >> x) & 0xf) >= 8)
+       {       t = sp - 1;
+               for (;;)
+               {       if (--t <= b)
+                       {       (*decpt)++;
+                               break;
+                       }
+                       switch (*t)
+                       {
+                       case 'f':
+                       case 'F':
+                               *t = '0';
+                               continue;
+                       case '9':
+                               *t = ep[10];
+                               break;
+                       default:
+                               (*t)++;
+                               break;
+                       }
+                       break;
+               }
+       }
+       ep = sp + 1;
+       goto done;
 }
--- old/usr/src/lib/libast/common/sfio/sfdisc.c Fri Sep 25 05:46:56 2009
+++ new/usr/src/lib/libast/common/sfio/sfdisc.c Fri Sep 25 05:46:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfdlen.c Fri Sep 25 05:46:59 2009
+++ new/usr/src/lib/libast/common/sfio/sfdlen.c Fri Sep 25 05:46:57 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfecvt.c Fri Sep 25 05:47:01 2009
+++ new/usr/src/lib/libast/common/sfio/sfecvt.c Fri Sep 25 05:47:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfexcept.c       Fri Sep 25 05:47:04 2009
+++ new/usr/src/lib/libast/common/sfio/sfexcept.c       Fri Sep 25 05:47:02 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfextern.c       Fri Sep 25 05:47:06 2009
+++ new/usr/src/lib/libast/common/sfio/sfextern.c       Fri Sep 25 05:47:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sffcvt.c Fri Sep 25 05:47:09 2009
+++ new/usr/src/lib/libast/common/sfio/sffcvt.c Fri Sep 25 05:47:07 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sffilbuf.c       Fri Sep 25 05:47:12 2009
+++ new/usr/src/lib/libast/common/sfio/sffilbuf.c       Fri Sep 25 05:47:10 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfflsbuf.c       Fri Sep 25 05:47:14 2009
+++ new/usr/src/lib/libast/common/sfio/sfflsbuf.c       Fri Sep 25 05:47:12 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfgetd.c Fri Sep 25 05:47:17 2009
+++ new/usr/src/lib/libast/common/sfio/sfgetd.c Fri Sep 25 05:47:15 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfgetl.c Fri Sep 25 05:47:19 2009
+++ new/usr/src/lib/libast/common/sfio/sfgetl.c Fri Sep 25 05:47:17 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfgetm.c Fri Sep 25 05:47:22 2009
+++ new/usr/src/lib/libast/common/sfio/sfgetm.c Fri Sep 25 05:47:20 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfgetr.c Fri Sep 25 05:47:24 2009
+++ new/usr/src/lib/libast/common/sfio/sfgetr.c Fri Sep 25 05:47:22 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfgetu.c Fri Sep 25 05:47:27 2009
+++ new/usr/src/lib/libast/common/sfio/sfgetu.c Fri Sep 25 05:47:25 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfhdr.h  Fri Sep 25 05:47:29 2009
+++ new/usr/src/lib/libast/common/sfio/sfhdr.h  Fri Sep 25 05:47:27 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfllen.c Fri Sep 25 05:47:32 2009
+++ new/usr/src/lib/libast/common/sfio/sfllen.c Fri Sep 25 05:47:30 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfmode.c Fri Sep 25 05:47:34 2009
+++ new/usr/src/lib/libast/common/sfio/sfmode.c Fri Sep 25 05:47:32 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfmove.c Fri Sep 25 05:47:37 2009
+++ new/usr/src/lib/libast/common/sfio/sfmove.c Fri Sep 25 05:47:35 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfmutex.c        Fri Sep 25 05:47:39 2009
+++ new/usr/src/lib/libast/common/sfio/sfmutex.c        Fri Sep 25 05:47:38 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfnew.c  Fri Sep 25 05:47:42 2009
+++ new/usr/src/lib/libast/common/sfio/sfnew.c  Fri Sep 25 05:47:40 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfnotify.c       Fri Sep 25 05:47:44 2009
+++ new/usr/src/lib/libast/common/sfio/sfnotify.c       Fri Sep 25 05:47:43 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfnputc.c        Fri Sep 25 05:47:47 2009
+++ new/usr/src/lib/libast/common/sfio/sfnputc.c        Fri Sep 25 05:47:45 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfopen.c Fri Sep 25 05:47:50 2009
+++ new/usr/src/lib/libast/common/sfio/sfopen.c Fri Sep 25 05:47:48 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfpeek.c Fri Sep 25 05:47:52 2009
+++ new/usr/src/lib/libast/common/sfio/sfpeek.c Fri Sep 25 05:47:50 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfpkrd.c Fri Sep 25 05:47:54 2009
+++ new/usr/src/lib/libast/common/sfio/sfpkrd.c Fri Sep 25 05:47:53 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfpoll.c Fri Sep 25 05:47:57 2009
+++ new/usr/src/lib/libast/common/sfio/sfpoll.c Fri Sep 25 05:47:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfpool.c Fri Sep 25 05:48:00 2009
+++ new/usr/src/lib/libast/common/sfio/sfpool.c Fri Sep 25 05:47:58 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -251,8 +251,9 @@
 reg int                mode;
 #endif
 {
-       reg Sfpool_t*   p;
-       reg Sfio_t*     rv;
+       int             k;
+       Sfpool_t*       p;
+       Sfio_t*         rv;
 
        _Sfpmove = _sfpmove;
 
@@ -301,13 +302,21 @@
                SFLOCK(pf,0);
 
        if(!pf) /* deleting f from its current pool */
-       {       if(!(p = f->pool) || p == &_Sfpool ||
-                  _sfpmove(f,-1) < 0 || _sfsetpool(f) < 0)
+       {       if((p = f->pool) != NIL(Sfpool_t*) && p != &_Sfpool)
+                       for(k = 0; k < p->n_sf && pf == NIL(Sfio_t*); ++k)
+                               if(p->sf[k] != f) /* a stream != f represents 
the pool */
+                                       pf = p->sf[k];
+               if(!pf) /* already isolated */
+               {       rv = f; /* just return self */
                        goto done;
+               }
 
-               if((p = f->pool) == &_Sfpool || p->n_sf <= 0)
-                       rv = f;
-               else    rv = p->sf[0];  /* return head of pool */
+               if(_sfpmove(f,-1) < 0 || _sfsetpool(f) < 0)
+                       goto done; /* can't delete */
+
+               if(!pf->pool || pf->pool == &_Sfpool || pf->pool->n_sf <= 0 )
+                       rv = pf;
+               else    rv = pf->pool->sf[0];   /* return head of old pool */
                goto done;
        }
 
--- old/usr/src/lib/libast/common/sfio/sfpopen.c        Fri Sep 25 05:48:02 2009
+++ new/usr/src/lib/libast/common/sfio/sfpopen.c        Fri Sep 25 05:48:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfprintf.c       Fri Sep 25 05:48:05 2009
+++ new/usr/src/lib/libast/common/sfio/sfprintf.c       Fri Sep 25 05:48:03 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfprints.c       Fri Sep 25 05:48:07 2009
+++ new/usr/src/lib/libast/common/sfio/sfprints.c       Fri Sep 25 05:48:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -96,7 +96,7 @@
        {       if(!(*sp = (char*)malloc(n = strlen(s)+1)) )
                        return -1;
                memcpy(*sp, s, n);
-               return n;
+               return n - 1;
        }
 }
 
--- old/usr/src/lib/libast/common/sfio/sfpurge.c        Fri Sep 25 05:48:10 2009
+++ new/usr/src/lib/libast/common/sfio/sfpurge.c        Fri Sep 25 05:48:08 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfputd.c Fri Sep 25 05:48:12 2009
+++ new/usr/src/lib/libast/common/sfio/sfputd.c Fri Sep 25 05:48:10 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfputl.c Fri Sep 25 05:48:15 2009
+++ new/usr/src/lib/libast/common/sfio/sfputl.c Fri Sep 25 05:48:13 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfputm.c Fri Sep 25 05:48:17 2009
+++ new/usr/src/lib/libast/common/sfio/sfputm.c Fri Sep 25 05:48:15 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfputr.c Fri Sep 25 05:48:20 2009
+++ new/usr/src/lib/libast/common/sfio/sfputr.c Fri Sep 25 05:48:18 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -46,7 +46,8 @@
        SFLOCK(f,0);
 
        for(w = 0; (*s || rc >= 0); )
-       {       SFWPEEK(f,ps,p);
+       {       if(SFWPEEK(f,ps,p) < 0)
+                       break;
 
                if(p == 0 || (f->flags&SF_WHOLE) )
                {       n = strlen(s);
--- old/usr/src/lib/libast/common/sfio/sfputu.c Fri Sep 25 05:48:22 2009
+++ new/usr/src/lib/libast/common/sfio/sfputu.c Fri Sep 25 05:48:20 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfraise.c        Fri Sep 25 05:48:25 2009
+++ new/usr/src/lib/libast/common/sfio/sfraise.c        Fri Sep 25 05:48:23 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfrd.c   Fri Sep 25 05:48:27 2009
+++ new/usr/src/lib/libast/common/sfio/sfrd.c   Fri Sep 25 05:48:25 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfread.c Fri Sep 25 05:48:30 2009
+++ new/usr/src/lib/libast/common/sfio/sfread.c Fri Sep 25 05:48:28 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfreserve.c      Fri Sep 25 05:48:32 2009
+++ new/usr/src/lib/libast/common/sfio/sfreserve.c      Fri Sep 25 05:48:31 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -110,7 +110,11 @@
                if(size == 0 || (f->mode&SF_WRITE))
                        iosz = -1;
                else if(size < 0 && n == 0 && f->push) /* maybe stack-pop */
-                       iosz = sz; /* so only get what is asked for */
+               {       if((iosz = f->push->endb - f->push->next) == 0)
+                               iosz = f->push->size;
+                       if(iosz < sz)
+                               iosz = sz; /* so only get what is asked for */
+               }
                else
                {       iosz = sz - n; /* get enough to fulfill requirement */
                        if(size < 0 && iosz < (f->size - n) )
--- old/usr/src/lib/libast/common/sfio/sfresize.c       Fri Sep 25 05:48:35 2009
+++ new/usr/src/lib/libast/common/sfio/sfresize.c       Fri Sep 25 05:48:33 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfscanf.c        Fri Sep 25 05:48:37 2009
+++ new/usr/src/lib/libast/common/sfio/sfscanf.c        Fri Sep 25 05:48:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfseek.c Fri Sep 25 05:48:40 2009
+++ new/usr/src/lib/libast/common/sfio/sfseek.c Fri Sep 25 05:48:38 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfset.c  Fri Sep 25 05:48:43 2009
+++ new/usr/src/lib/libast/common/sfio/sfset.c  Fri Sep 25 05:48:41 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfsetbuf.c       Fri Sep 25 05:48:45 2009
+++ new/usr/src/lib/libast/common/sfio/sfsetbuf.c       Fri Sep 25 05:48:43 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfsetfd.c        Fri Sep 25 05:48:48 2009
+++ new/usr/src/lib/libast/common/sfio/sfsetfd.c        Fri Sep 25 05:48:46 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfsize.c Fri Sep 25 05:48:50 2009
+++ new/usr/src/lib/libast/common/sfio/sfsize.c Fri Sep 25 05:48:48 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfsk.c   Fri Sep 25 05:48:53 2009
+++ new/usr/src/lib/libast/common/sfio/sfsk.c   Fri Sep 25 05:48:51 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfstack.c        Fri Sep 25 05:48:55 2009
+++ new/usr/src/lib/libast/common/sfio/sfstack.c        Fri Sep 25 05:48:53 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfstrtod.c       Fri Sep 25 05:48:58 2009
+++ new/usr/src/lib/libast/common/sfio/sfstrtod.c       Fri Sep 25 05:48:56 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfstrtof.h       Fri Sep 25 05:49:00 2009
+++ new/usr/src/lib/libast/common/sfio/sfstrtof.h       Fri Sep 25 05:48:58 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -33,6 +33,7 @@
  *     S2F_function    the function name
  *     S2F_static      <0:export =0:extern >0:static
  *     S2F_type        0:float 1:double 2:long.double
+ *     S2F_qualifier   1 for optional [fFlL] qualifier suffix
  *     S2F_size        1 for interface with size_t second arg
  *     S2F_scan        1 for alternate interface with these arguments:
  *                             void* handle
@@ -284,6 +285,8 @@
                                        m = -m;
                        }
 
+#if S2F_qualifier
+
                        /*
                         * consume the optional suffix
                         */
@@ -297,6 +300,7 @@
                                c = GET(s);
                                break;
                        }
+#endif
                        PUT(s);
                        if (v == 0)
                                return negative ? -v : v;
@@ -449,6 +453,8 @@
                        digits += n;
        }
 
+#if S2F_qualifier
+
        /*
         * consume the optional suffix
         */
@@ -462,6 +468,7 @@
                c = GET(s);
                break;
        }
+#endif
        PUT(s);
 
        /*
--- old/usr/src/lib/libast/common/sfio/sfswap.c Fri Sep 25 05:49:03 2009
+++ new/usr/src/lib/libast/common/sfio/sfswap.c Fri Sep 25 05:49:01 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfsync.c Fri Sep 25 05:49:05 2009
+++ new/usr/src/lib/libast/common/sfio/sfsync.c Fri Sep 25 05:49:03 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sftable.c        Fri Sep 25 05:49:08 2009
+++ new/usr/src/lib/libast/common/sfio/sftable.c        Fri Sep 25 05:49:06 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sftell.c Fri Sep 25 05:49:10 2009
+++ new/usr/src/lib/libast/common/sfio/sftell.c Fri Sep 25 05:49:09 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sftmp.c  Fri Sep 25 05:49:13 2009
+++ new/usr/src/lib/libast/common/sfio/sftmp.c  Fri Sep 25 05:49:11 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfungetc.c       Fri Sep 25 05:49:15 2009
+++ new/usr/src/lib/libast/common/sfio/sfungetc.c       Fri Sep 25 05:49:14 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfvprintf.c      Fri Sep 25 05:49:18 2009
+++ new/usr/src/lib/libast/common/sfio/sfvprintf.c      Fri Sep 25 05:49:16 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -324,6 +324,12 @@
                        if(thousand > 0)
                                flags |= SFFMT_THOUSAND;
                        goto loop_flags;
+               case ',':
+                       SFSETLOCALE(&decimal,&thousand);
+                       if(thousand < 0)
+                               thousand = fmt;
+                       flags |= SFFMT_THOUSAND;
+                       goto loop_flags;
 
                case '.' :
                        dot += 1;
--- old/usr/src/lib/libast/common/sfio/sfvscanf.c       Fri Sep 25 05:49:21 2009
+++ new/usr/src/lib/libast/common/sfio/sfvscanf.c       Fri Sep 25 05:49:19 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -122,7 +122,7 @@
 
 /* structure to match characters in a character class */
 typedef struct _accept_s
-{      char    ok[SF_MAXCHAR];
+{      char    ok[SF_MAXCHAR+1];
        int     yes;
        char    *form, *endf;
 #if _has_multibyte
--- old/usr/src/lib/libast/common/sfio/sfwr.c   Fri Sep 25 05:49:23 2009
+++ new/usr/src/lib/libast/common/sfio/sfwr.c   Fri Sep 25 05:49:22 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/sfwrite.c        Fri Sep 25 05:49:26 2009
+++ new/usr/src/lib/libast/common/sfio/sfwrite.c        Fri Sep 25 05:49:24 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/sfio/vthread.h        Fri Sep 25 05:49:28 2009
+++ new/usr/src/lib/libast/common/sfio/vthread.h        Fri Sep 25 05:49:27 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/std/bytesex.h Fri Sep 25 05:49:31 2009
+++ new/usr/src/lib/libast/common/std/bytesex.h Fri Sep 25 05:49:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/std/dirent.h  Fri Sep 25 05:49:33 2009
+++ new/usr/src/lib/libast/common/std/dirent.h  Fri Sep 25 05:49:32 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/std/endian.h  Fri Sep 25 05:49:36 2009
+++ new/usr/src/lib/libast/common/std/endian.h  Fri Sep 25 05:49:34 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/std/iconv.h   Fri Sep 25 05:49:38 2009
+++ new/usr/src/lib/libast/common/std/iconv.h   Fri Sep 25 05:49:37 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/std/nl_types.h        Fri Sep 25 05:49:41 2009
+++ new/usr/src/lib/libast/common/std/nl_types.h        Fri Sep 25 05:49:39 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/std/stdio.h   Fri Sep 25 05:49:43 2009
+++ new/usr/src/lib/libast/common/std/stdio.h   Fri Sep 25 05:49:42 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/std/wchar.h   Fri Sep 25 05:49:46 2009
+++ new/usr/src/lib/libast/common/std/wchar.h   Fri Sep 25 05:49:44 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/_doprnt.c       Fri Sep 25 05:49:48 2009
+++ new/usr/src/lib/libast/common/stdio/_doprnt.c       Fri Sep 25 05:49:47 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/_doscan.c       Fri Sep 25 05:49:51 2009
+++ new/usr/src/lib/libast/common/stdio/_doscan.c       Fri Sep 25 05:49:49 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/_filbuf.c       Fri Sep 25 05:49:53 2009
+++ new/usr/src/lib/libast/common/stdio/_filbuf.c       Fri Sep 25 05:49:52 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/_flsbuf.c       Fri Sep 25 05:49:56 2009
+++ new/usr/src/lib/libast/common/stdio/_flsbuf.c       Fri Sep 25 05:49:54 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/_stdfun.c       Fri Sep 25 05:49:58 2009
+++ new/usr/src/lib/libast/common/stdio/_stdfun.c       Fri Sep 25 05:49:57 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -36,10 +36,12 @@
 
 #if _lib___iob_func
 #define IOB            ((char*)__iob_func())
+#elif _lib___p__iob
+#define IOB            ((char*)__p__iob())
 #elif _dat__iob
 #define IOB            ((char*)_iob)
 #else
-#define IOB            ((char*)__p__iob())
+#define IOB            ((char*)_p__iob())
 #endif
 
 #define IOBMAX         (512*32)
--- old/usr/src/lib/libast/common/stdio/_stdopen.c      Fri Sep 25 05:50:01 2009
+++ new/usr/src/lib/libast/common/stdio/_stdopen.c      Fri Sep 25 05:49:59 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/_stdprintf.c    Fri Sep 25 05:50:04 2009
+++ new/usr/src/lib/libast/common/stdio/_stdprintf.c    Fri Sep 25 05:50:02 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/_stdscanf.c     Fri Sep 25 05:50:06 2009
+++ new/usr/src/lib/libast/common/stdio/_stdscanf.c     Fri Sep 25 05:50:04 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/_stdsprnt.c     Fri Sep 25 05:50:09 2009
+++ new/usr/src/lib/libast/common/stdio/_stdsprnt.c     Fri Sep 25 05:50:07 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/_stdvbuf.c      Fri Sep 25 05:50:11 2009
+++ new/usr/src/lib/libast/common/stdio/_stdvbuf.c      Fri Sep 25 05:50:09 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/_stdvsnprnt.c   Fri Sep 25 05:50:14 2009
+++ new/usr/src/lib/libast/common/stdio/_stdvsnprnt.c   Fri Sep 25 05:50:12 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/_stdvsprnt.c    Fri Sep 25 05:50:16 2009
+++ new/usr/src/lib/libast/common/stdio/_stdvsprnt.c    Fri Sep 25 05:50:14 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/_stdvsscn.c     Fri Sep 25 05:50:19 2009
+++ new/usr/src/lib/libast/common/stdio/_stdvsscn.c     Fri Sep 25 05:50:17 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/asprintf.c      Fri Sep 25 05:50:21 2009
+++ new/usr/src/lib/libast/common/stdio/asprintf.c      Fri Sep 25 05:50:19 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/clearerr.c      Fri Sep 25 05:50:24 2009
+++ new/usr/src/lib/libast/common/stdio/clearerr.c      Fri Sep 25 05:50:22 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/fclose.c        Fri Sep 25 05:50:26 2009
+++ new/usr/src/lib/libast/common/stdio/fclose.c        Fri Sep 25 05:50:24 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- /dev/null   Fri Sep 25 05:50:29 2009
+++ new/usr/src/lib/libast/common/stdio/fcloseall.c     Fri Sep 25 05:50:27 2009
@@ -0,0 +1,57 @@
+/***********************************************************************
+*                                                                      *
+*               This software is part of the ast package               *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
+*                      and is licensed under the                       *
+*                  Common Public License, Version 1.0                  *
+*                    by AT&T Intellectual Property                     *
+*                                                                      *
+*                A copy of the License is available at                 *
+*            http://www.opensource.org/licenses/cpl1.0.txt             *
+*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
+*                                                                      *
+*              Information and Software Systems Research               *
+*                            AT&T Research                             *
+*                           Florham Park NJ                            *
+*                                                                      *
+*                 Glenn Fowler <gsf at research.att.com>                  *
+*                  David Korn <dgk at research.att.com>                   *
+*                   Phong Vo <kpv at research.att.com>                    *
+*                                                                      *
+***********************************************************************/
+#pragma prototyped
+
+#include "stdhdr.h"
+
+#define MAXLOOP                3
+
+int
+fcloseall(void)
+{
+       Sfpool_t*       p;
+       Sfpool_t*       next;
+       int             n;
+       int             nclose;
+       int             count;
+       int             loop;
+
+       STDIO_INT(0, "fcloseall", int, (void), ())
+
+       for(loop = 0; loop < MAXLOOP; ++loop)
+       {       nclose = count = 0;
+               for(p = &_Sfpool; p; p = next)
+               {       /* find the next legitimate pool */
+                       for(next = p->next; next; next = next->next)
+                               if(next->n_sf > 0)
+                                       break;
+                       for(n = 0; n < ((p == &_Sfpool) ? p->n_sf : 1); ++n)
+                       {       count += 1;
+                               if(sfclose(p->sf[n]) >= 0)
+                                       nclose += 1;
+                       }
+               }
+               if(nclose == count)
+                       break;
+       }
+       return 0; /* always return 0 per GNU */
+}
--- old/usr/src/lib/libast/common/stdio/fdopen.c        Fri Sep 25 05:50:31 2009
+++ new/usr/src/lib/libast/common/stdio/fdopen.c        Fri Sep 25 05:50:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/feof.c  Fri Sep 25 05:50:34 2009
+++ new/usr/src/lib/libast/common/stdio/feof.c  Fri Sep 25 05:50:32 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/ferror.c        Fri Sep 25 05:50:36 2009
+++ new/usr/src/lib/libast/common/stdio/ferror.c        Fri Sep 25 05:50:34 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/fflush.c        Fri Sep 25 05:50:39 2009
+++ new/usr/src/lib/libast/common/stdio/fflush.c        Fri Sep 25 05:50:37 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,6 +21,10 @@
 ***********************************************************************/
 #pragma prototyped
 
+#ifndef _USE_GNU
+#define _USE_GNU
+#endif
+
 #include "stdhdr.h"
 
 int
@@ -27,7 +31,7 @@
 fflush(Sfio_t* f)
 {
        if (!f)
-               return sfsync(NiL);
+               return fcloseall();
 
        STDIO_INT(f, "fflush", int, (Sfio_t*), (f))
 
--- old/usr/src/lib/libast/common/stdio/fgetc.c Fri Sep 25 05:50:41 2009
+++ new/usr/src/lib/libast/common/stdio/fgetc.c Fri Sep 25 05:50:39 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/fgetpos.c       Fri Sep 25 05:50:44 2009
+++ new/usr/src/lib/libast/common/stdio/fgetpos.c       Fri Sep 25 05:50:42 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/fgets.c Fri Sep 25 05:50:46 2009
+++ new/usr/src/lib/libast/common/stdio/fgets.c Fri Sep 25 05:50:45 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/fgetwc.c        Fri Sep 25 05:50:49 2009
+++ new/usr/src/lib/libast/common/stdio/fgetwc.c        Fri Sep 25 05:50:47 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/fgetws.c        Fri Sep 25 05:50:52 2009
+++ new/usr/src/lib/libast/common/stdio/fgetws.c        Fri Sep 25 05:50:50 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/fileno.c        Fri Sep 25 05:50:54 2009
+++ new/usr/src/lib/libast/common/stdio/fileno.c        Fri Sep 25 05:50:52 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/flockfile.c     Fri Sep 25 05:50:57 2009
+++ new/usr/src/lib/libast/common/stdio/flockfile.c     Fri Sep 25 05:50:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- /dev/null   Fri Sep 25 05:50:59 2009
+++ new/usr/src/lib/libast/common/stdio/fmemopen.c      Fri Sep 25 05:50:57 2009
@@ -0,0 +1,32 @@
+/***********************************************************************
+*                                                                      *
+*               This software is part of the ast package               *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
+*                      and is licensed under the                       *
+*                  Common Public License, Version 1.0                  *
+*                    by AT&T Intellectual Property                     *
+*                                                                      *
+*                A copy of the License is available at                 *
+*            http://www.opensource.org/licenses/cpl1.0.txt             *
+*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
+*                                                                      *
+*              Information and Software Systems Research               *
+*                            AT&T Research                             *
+*                           Florham Park NJ                            *
+*                                                                      *
+*                 Glenn Fowler <gsf at research.att.com>                  *
+*                  David Korn <dgk at research.att.com>                   *
+*                   Phong Vo <kpv at research.att.com>                    *
+*                                                                      *
+***********************************************************************/
+#pragma prototyped
+
+#include "stdhdr.h"
+
+Sfio_t*
+fmemopen(void* buf, size_t size, const char* mode)
+{
+       STDIO_PTR(0, "fmemopen", Sfio_t*, (void*, size_t, const char*), (buf, 
size, mode))
+
+       return sfnew(NiL, buf, size, -1, SF_STRING|_sftype(mode, NiL, NiL));
+}
--- old/usr/src/lib/libast/common/stdio/fopen.c Fri Sep 25 05:51:02 2009
+++ new/usr/src/lib/libast/common/stdio/fopen.c Fri Sep 25 05:51:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/fprintf.c       Fri Sep 25 05:51:04 2009
+++ new/usr/src/lib/libast/common/stdio/fprintf.c       Fri Sep 25 05:51:02 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/fpurge.c        Fri Sep 25 05:51:07 2009
+++ new/usr/src/lib/libast/common/stdio/fpurge.c        Fri Sep 25 05:51:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/fputc.c Fri Sep 25 05:51:09 2009
+++ new/usr/src/lib/libast/common/stdio/fputc.c Fri Sep 25 05:51:08 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/fputs.c Fri Sep 25 05:51:12 2009
+++ new/usr/src/lib/libast/common/stdio/fputs.c Fri Sep 25 05:51:10 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/fputwc.c        Fri Sep 25 05:51:15 2009
+++ new/usr/src/lib/libast/common/stdio/fputwc.c        Fri Sep 25 05:51:13 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/fputws.c        Fri Sep 25 05:51:17 2009
+++ new/usr/src/lib/libast/common/stdio/fputws.c        Fri Sep 25 05:51:15 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/fread.c Fri Sep 25 05:51:20 2009
+++ new/usr/src/lib/libast/common/stdio/fread.c Fri Sep 25 05:51:18 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/freopen.c       Fri Sep 25 05:51:22 2009
+++ new/usr/src/lib/libast/common/stdio/freopen.c       Fri Sep 25 05:51:20 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/fscanf.c        Fri Sep 25 05:51:25 2009
+++ new/usr/src/lib/libast/common/stdio/fscanf.c        Fri Sep 25 05:51:23 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/fseek.c Fri Sep 25 05:51:27 2009
+++ new/usr/src/lib/libast/common/stdio/fseek.c Fri Sep 25 05:51:25 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/fseeko.c        Fri Sep 25 05:51:30 2009
+++ new/usr/src/lib/libast/common/stdio/fseeko.c        Fri Sep 25 05:51:28 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/fsetpos.c       Fri Sep 25 05:51:32 2009
+++ new/usr/src/lib/libast/common/stdio/fsetpos.c       Fri Sep 25 05:51:31 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/ftell.c Fri Sep 25 05:51:35 2009
+++ new/usr/src/lib/libast/common/stdio/ftell.c Fri Sep 25 05:51:33 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/ftello.c        Fri Sep 25 05:51:37 2009
+++ new/usr/src/lib/libast/common/stdio/ftello.c        Fri Sep 25 05:51:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/ftrylockfile.c  Fri Sep 25 05:51:40 2009
+++ new/usr/src/lib/libast/common/stdio/ftrylockfile.c  Fri Sep 25 05:51:38 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/funlockfile.c   Fri Sep 25 05:51:43 2009
+++ new/usr/src/lib/libast/common/stdio/funlockfile.c   Fri Sep 25 05:51:41 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/fwide.c Fri Sep 25 05:51:45 2009
+++ new/usr/src/lib/libast/common/stdio/fwide.c Fri Sep 25 05:51:43 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/fwprintf.c      Fri Sep 25 05:51:48 2009
+++ new/usr/src/lib/libast/common/stdio/fwprintf.c      Fri Sep 25 05:51:46 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/fwrite.c        Fri Sep 25 05:51:50 2009
+++ new/usr/src/lib/libast/common/stdio/fwrite.c        Fri Sep 25 05:51:48 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/fwscanf.c       Fri Sep 25 05:51:53 2009
+++ new/usr/src/lib/libast/common/stdio/fwscanf.c       Fri Sep 25 05:51:51 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/getc.c  Fri Sep 25 05:51:55 2009
+++ new/usr/src/lib/libast/common/stdio/getc.c  Fri Sep 25 05:51:53 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/getchar.c       Fri Sep 25 05:51:58 2009
+++ new/usr/src/lib/libast/common/stdio/getchar.c       Fri Sep 25 05:51:56 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- /dev/null   Fri Sep 25 05:52:00 2009
+++ new/usr/src/lib/libast/common/stdio/getdelim.c      Fri Sep 25 05:51:59 2009
@@ -0,0 +1,96 @@
+/***********************************************************************
+*                                                                      *
+*               This software is part of the ast package               *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
+*                      and is licensed under the                       *
+*                  Common Public License, Version 1.0                  *
+*                    by AT&T Intellectual Property                     *
+*                                                                      *
+*                A copy of the License is available at                 *
+*            http://www.opensource.org/licenses/cpl1.0.txt             *
+*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
+*                                                                      *
+*              Information and Software Systems Research               *
+*                            AT&T Research                             *
+*                           Florham Park NJ                            *
+*                                                                      *
+*                 Glenn Fowler <gsf at research.att.com>                  *
+*                  David Korn <dgk at research.att.com>                   *
+*                   Phong Vo <kpv at research.att.com>                    *
+*                                                                      *
+***********************************************************************/
+#pragma prototyped
+
+#include "stdhdr.h"
+
+ssize_t
+getdelim(char** sp, size_t* np, int delim, Sfio_t* f)
+{
+       ssize_t         m;
+       ssize_t         n;
+       ssize_t         k;
+       ssize_t         p;
+       uchar*          s;
+       uchar*          ps;
+       SFMTXDECL(f);
+
+       STDIO_INT(f, "getdelim", ssize_t, (char**, size_t*, int, Sfio_t*), (sp, 
np, delim, f))
+
+       SFMTXENTER(f, -1);
+
+       if(delim < 0 || delim > 255 || !sp || !np) /* bad parameters */
+               SFMTXRETURN(f, -1);
+
+       if(f->mode != SF_READ && _sfmode(f,SF_READ,0) < 0)
+               SFMTXRETURN(f, -1);
+
+       SFLOCK(f,0);
+
+       if(!(s = (uchar*)(*sp)) || (n = *np) < 0)
+               { s = NIL(uchar*); n = 0; }
+       for(m = 0;; )
+       {       /* read new data */
+               if((p = f->endb - (ps = f->next)) <= 0 )
+               {       f->getr = delim;
+                       f->mode |= SF_RC;
+                       if(SFRPEEK(f,ps,p) <= 0)
+                       {       m = -1;
+                               break;
+                       }
+               }
+
+               for(k = 0; k < p; ++k) /* find the delimiter */
+               {       if(ps[k] == delim)
+                       {       k += 1; /* include delim in copying */
+                               break;
+                       }
+               }
+
+               if((m+k+1) >= n ) /* make sure there is space */
+               {       n = ((m+k+15)/8)*8;
+                       if(!(s = (uchar*)realloc(s, n)) )
+                       {       *sp = 0; *np = 0;
+                               m = -1;
+                               break;
+                       }
+                       *sp = (char*)s; *np = n;
+               }
+
+               memcpy(s+m, ps, k); m += k;
+               f->next = ps+k; /* skip copied data in buffer */
+
+               if(s[m-1] == delim)
+               {       s[m] = 0; /* 0-terminated */
+                       break;
+               }
+       }
+
+       SFOPEN(f,0);
+       SFMTXRETURN(f,m);
+}
+
+ssize_t
+__getdelim(char** sp, size_t* np, int delim, Sfio_t* f)
+{
+       return getdelim(sp, np, delim, f);
+}
--- /dev/null   Fri Sep 25 05:52:03 2009
+++ new/usr/src/lib/libast/common/stdio/getline.c       Fri Sep 25 05:52:01 2009
@@ -0,0 +1,36 @@
+/***********************************************************************
+*                                                                      *
+*               This software is part of the ast package               *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
+*                      and is licensed under the                       *
+*                  Common Public License, Version 1.0                  *
+*                    by AT&T Intellectual Property                     *
+*                                                                      *
+*                A copy of the License is available at                 *
+*            http://www.opensource.org/licenses/cpl1.0.txt             *
+*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
+*                                                                      *
+*              Information and Software Systems Research               *
+*                            AT&T Research                             *
+*                           Florham Park NJ                            *
+*                                                                      *
+*                 Glenn Fowler <gsf at research.att.com>                  *
+*                  David Korn <dgk at research.att.com>                   *
+*                   Phong Vo <kpv at research.att.com>                    *
+*                                                                      *
+***********************************************************************/
+#pragma prototyped
+
+#ifndef _USE_GNU
+#define _USE_GNU
+#endif
+
+#include "stdhdr.h"
+
+ssize_t
+getline(char** sp, size_t* np, Sfio_t* f)
+{
+       STDIO_INT(f, "getline", ssize_t, (char**, size_t*, Sfio_t*), (sp, np, 
f))
+
+       return getdelim(sp, np, '\n', f);
+}
--- old/usr/src/lib/libast/common/stdio/getw.c  Fri Sep 25 05:52:05 2009
+++ new/usr/src/lib/libast/common/stdio/getw.c  Fri Sep 25 05:52:03 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/getwc.c Fri Sep 25 05:52:08 2009
+++ new/usr/src/lib/libast/common/stdio/getwc.c Fri Sep 25 05:52:06 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/getwchar.c      Fri Sep 25 05:52:10 2009
+++ new/usr/src/lib/libast/common/stdio/getwchar.c      Fri Sep 25 05:52:08 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/pclose.c        Fri Sep 25 05:52:13 2009
+++ new/usr/src/lib/libast/common/stdio/pclose.c        Fri Sep 25 05:52:11 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/popen.c Fri Sep 25 05:52:15 2009
+++ new/usr/src/lib/libast/common/stdio/popen.c Fri Sep 25 05:52:13 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/printf.c        Fri Sep 25 05:52:18 2009
+++ new/usr/src/lib/libast/common/stdio/printf.c        Fri Sep 25 05:52:16 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/putc.c  Fri Sep 25 05:52:20 2009
+++ new/usr/src/lib/libast/common/stdio/putc.c  Fri Sep 25 05:52:18 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/putchar.c       Fri Sep 25 05:52:23 2009
+++ new/usr/src/lib/libast/common/stdio/putchar.c       Fri Sep 25 05:52:21 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/puts.c  Fri Sep 25 05:52:25 2009
+++ new/usr/src/lib/libast/common/stdio/puts.c  Fri Sep 25 05:52:24 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/putw.c  Fri Sep 25 05:52:28 2009
+++ new/usr/src/lib/libast/common/stdio/putw.c  Fri Sep 25 05:52:26 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/putwc.c Fri Sep 25 05:52:31 2009
+++ new/usr/src/lib/libast/common/stdio/putwc.c Fri Sep 25 05:52:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/putwchar.c      Fri Sep 25 05:52:33 2009
+++ new/usr/src/lib/libast/common/stdio/putwchar.c      Fri Sep 25 05:52:31 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/rewind.c        Fri Sep 25 05:52:36 2009
+++ new/usr/src/lib/libast/common/stdio/rewind.c        Fri Sep 25 05:52:34 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/scanf.c Fri Sep 25 05:52:38 2009
+++ new/usr/src/lib/libast/common/stdio/scanf.c Fri Sep 25 05:52:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/setbuf.c        Fri Sep 25 05:52:41 2009
+++ new/usr/src/lib/libast/common/stdio/setbuf.c        Fri Sep 25 05:52:39 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/setbuffer.c     Fri Sep 25 05:52:43 2009
+++ new/usr/src/lib/libast/common/stdio/setbuffer.c     Fri Sep 25 05:52:41 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/setlinebuf.c    Fri Sep 25 05:52:46 2009
+++ new/usr/src/lib/libast/common/stdio/setlinebuf.c    Fri Sep 25 05:52:44 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/setvbuf.c       Fri Sep 25 05:52:48 2009
+++ new/usr/src/lib/libast/common/stdio/setvbuf.c       Fri Sep 25 05:52:46 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/snprintf.c      Fri Sep 25 05:52:51 2009
+++ new/usr/src/lib/libast/common/stdio/snprintf.c      Fri Sep 25 05:52:49 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/sprintf.c       Fri Sep 25 05:52:53 2009
+++ new/usr/src/lib/libast/common/stdio/sprintf.c       Fri Sep 25 05:52:51 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/sscanf.c        Fri Sep 25 05:52:56 2009
+++ new/usr/src/lib/libast/common/stdio/sscanf.c        Fri Sep 25 05:52:54 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/stdhdr.h        Fri Sep 25 05:52:58 2009
+++ new/usr/src/lib/libast/common/stdio/stdhdr.h        Fri Sep 25 05:52:56 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/stdio_c99.c     Fri Sep 25 05:53:01 2009
+++ new/usr/src/lib/libast/common/stdio/stdio_c99.c     Fri Sep 25 05:52:59 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/stdio_gnu.c     Fri Sep 25 05:53:03 2009
+++ /dev/null   Fri Sep 25 05:52:03 2009
@@ -1,74 +0,0 @@
-/***********************************************************************
-*                                                                      *
-*               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
-*                      and is licensed under the                       *
-*                  Common Public License, Version 1.0                  *
-*                    by AT&T Intellectual Property                     *
-*                                                                      *
-*                A copy of the License is available at                 *
-*            http://www.opensource.org/licenses/cpl1.0.txt             *
-*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
-*                                                                      *
-*              Information and Software Systems Research               *
-*                            AT&T Research                             *
-*                           Florham Park NJ                            *
-*                                                                      *
-*                 Glenn Fowler <gsf at research.att.com>                  *
-*                  David Korn <dgk at research.att.com>                   *
-*                   Phong Vo <kpv at research.att.com>                    *
-*                                                                      *
-***********************************************************************/
-#pragma prototyped
-
-/*
- * gnu stdio extensions
- */
-
-#include "stdhdr.h"
-
-int
-fcloseall(void)
-{
-       return sfsync(NiL) < 0 ? -1 : 0;
-}
-
-Sfio_t*
-fmemopen(void* buf, size_t size, const char* mode)
-{
-       return sfnew(NiL, buf, size, -1, SF_STRING|_sftype(mode, NiL, NiL));
-}
-
-ssize_t
-__getdelim(char** pbuf, size_t* psize, int del, Sfio_t* sp)
-{
-       char*   s;
-       size_t  n;
-       size_t  m;
-
-       if (!(s = sfgetr(sp, del, 1)))
-               return -1;
-       n = sfsize(sp);
-       m = n + 1;
-       if (!*pbuf || m > *psize)
-       {
-               m = roundof(m, 1024);
-               if (!(*pbuf = newof(*pbuf, char, m, 0)))
-                       return -1;
-               *psize = m;
-       }
-       memcpy(*pbuf, s, n);
-       return n;
-}
-
-ssize_t
-getdelim(char** pbuf, size_t* psize, int del, Sfio_t* sp)
-{
-       return __getdelim(pbuf, psize, del, sp);
-}
-
-ssize_t
-getline(char** pbuf, size_t* psize, Sfio_t* sp)
-{
-       return __getdelim(pbuf, psize, '\n', sp);
-}
--- old/usr/src/lib/libast/common/stdio/swprintf.c      Fri Sep 25 05:53:06 2009
+++ new/usr/src/lib/libast/common/stdio/swprintf.c      Fri Sep 25 05:53:04 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/swscanf.c       Fri Sep 25 05:53:08 2009
+++ new/usr/src/lib/libast/common/stdio/swscanf.c       Fri Sep 25 05:53:06 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/tmpfile.c       Fri Sep 25 05:53:11 2009
+++ new/usr/src/lib/libast/common/stdio/tmpfile.c       Fri Sep 25 05:53:09 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/ungetc.c        Fri Sep 25 05:53:13 2009
+++ new/usr/src/lib/libast/common/stdio/ungetc.c        Fri Sep 25 05:53:12 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/ungetwc.c       Fri Sep 25 05:53:16 2009
+++ new/usr/src/lib/libast/common/stdio/ungetwc.c       Fri Sep 25 05:53:14 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/vasprintf.c     Fri Sep 25 05:53:19 2009
+++ new/usr/src/lib/libast/common/stdio/vasprintf.c     Fri Sep 25 05:53:17 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/vfprintf.c      Fri Sep 25 05:53:21 2009
+++ new/usr/src/lib/libast/common/stdio/vfprintf.c      Fri Sep 25 05:53:19 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/vfscanf.c       Fri Sep 25 05:53:24 2009
+++ new/usr/src/lib/libast/common/stdio/vfscanf.c       Fri Sep 25 05:53:22 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/vfwprintf.c     Fri Sep 25 05:53:26 2009
+++ new/usr/src/lib/libast/common/stdio/vfwprintf.c     Fri Sep 25 05:53:24 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/vfwscanf.c      Fri Sep 25 05:53:29 2009
+++ new/usr/src/lib/libast/common/stdio/vfwscanf.c      Fri Sep 25 05:53:27 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/vprintf.c       Fri Sep 25 05:53:31 2009
+++ new/usr/src/lib/libast/common/stdio/vprintf.c       Fri Sep 25 05:53:30 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/vscanf.c        Fri Sep 25 05:53:34 2009
+++ new/usr/src/lib/libast/common/stdio/vscanf.c        Fri Sep 25 05:53:32 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/vsnprintf.c     Fri Sep 25 05:53:36 2009
+++ new/usr/src/lib/libast/common/stdio/vsnprintf.c     Fri Sep 25 05:53:35 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/vsprintf.c      Fri Sep 25 05:53:39 2009
+++ new/usr/src/lib/libast/common/stdio/vsprintf.c      Fri Sep 25 05:53:37 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/vsscanf.c       Fri Sep 25 05:53:42 2009
+++ new/usr/src/lib/libast/common/stdio/vsscanf.c       Fri Sep 25 05:53:40 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/vswprintf.c     Fri Sep 25 05:53:44 2009
+++ new/usr/src/lib/libast/common/stdio/vswprintf.c     Fri Sep 25 05:53:42 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/vswscanf.c      Fri Sep 25 05:53:47 2009
+++ new/usr/src/lib/libast/common/stdio/vswscanf.c      Fri Sep 25 05:53:45 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/vwprintf.c      Fri Sep 25 05:53:49 2009
+++ new/usr/src/lib/libast/common/stdio/vwprintf.c      Fri Sep 25 05:53:47 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/vwscanf.c       Fri Sep 25 05:53:52 2009
+++ new/usr/src/lib/libast/common/stdio/vwscanf.c       Fri Sep 25 05:53:50 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/wprintf.c       Fri Sep 25 05:53:54 2009
+++ new/usr/src/lib/libast/common/stdio/wprintf.c       Fri Sep 25 05:53:53 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/stdio/wscanf.c        Fri Sep 25 05:53:57 2009
+++ new/usr/src/lib/libast/common/stdio/wscanf.c        Fri Sep 25 05:53:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/base64.c       Fri Sep 25 05:53:59 2009
+++ new/usr/src/lib/libast/common/string/base64.c       Fri Sep 25 05:53:58 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/ccmap.c        Fri Sep 25 05:54:02 2009
+++ new/usr/src/lib/libast/common/string/ccmap.c        Fri Sep 25 05:54:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/ccmapid.c      Fri Sep 25 05:54:05 2009
+++ new/usr/src/lib/libast/common/string/ccmapid.c      Fri Sep 25 05:54:03 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/ccnative.c     Fri Sep 25 05:54:07 2009
+++ new/usr/src/lib/libast/common/string/ccnative.c     Fri Sep 25 05:54:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/chresc.c       Fri Sep 25 05:54:10 2009
+++ new/usr/src/lib/libast/common/string/chresc.c       Fri Sep 25 05:54:08 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/chrtoi.c       Fri Sep 25 05:54:13 2009
+++ new/usr/src/lib/libast/common/string/chrtoi.c       Fri Sep 25 05:54:11 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmtbase.c      Fri Sep 25 05:54:15 2009
+++ new/usr/src/lib/libast/common/string/fmtbase.c      Fri Sep 25 05:54:13 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmtbuf.c       Fri Sep 25 05:54:18 2009
+++ new/usr/src/lib/libast/common/string/fmtbuf.c       Fri Sep 25 05:54:16 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmtclock.c     Fri Sep 25 05:54:20 2009
+++ new/usr/src/lib/libast/common/string/fmtclock.c     Fri Sep 25 05:54:18 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmtdev.c       Fri Sep 25 05:54:23 2009
+++ new/usr/src/lib/libast/common/string/fmtdev.c       Fri Sep 25 05:54:21 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmtelapsed.c   Fri Sep 25 05:54:25 2009
+++ new/usr/src/lib/libast/common/string/fmtelapsed.c   Fri Sep 25 05:54:24 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmterror.c     Fri Sep 25 05:54:28 2009
+++ new/usr/src/lib/libast/common/string/fmterror.c     Fri Sep 25 05:54:26 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmtesc.c       Fri Sep 25 05:54:31 2009
+++ new/usr/src/lib/libast/common/string/fmtesc.c       Fri Sep 25 05:54:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmtfmt.c       Fri Sep 25 05:54:33 2009
+++ new/usr/src/lib/libast/common/string/fmtfmt.c       Fri Sep 25 05:54:31 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmtfs.c        Fri Sep 25 05:54:36 2009
+++ new/usr/src/lib/libast/common/string/fmtfs.c        Fri Sep 25 05:54:34 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmtgid.c       Fri Sep 25 05:54:38 2009
+++ new/usr/src/lib/libast/common/string/fmtgid.c       Fri Sep 25 05:54:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmtident.c     Fri Sep 25 05:54:41 2009
+++ new/usr/src/lib/libast/common/string/fmtident.c     Fri Sep 25 05:54:39 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmtip4.c       Fri Sep 25 05:54:43 2009
+++ new/usr/src/lib/libast/common/string/fmtip4.c       Fri Sep 25 05:54:42 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmtip6.c       Fri Sep 25 05:54:46 2009
+++ new/usr/src/lib/libast/common/string/fmtip6.c       Fri Sep 25 05:54:44 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -141,7 +141,10 @@
                        *s++ = ':';
                        *s++ = ':';
                        if ((i += r[m]) >= n)
+                       {
+                               z = 1;
                                break;
+                       }
                        z = 0;
                }
                else if (i && !(i & 1))
@@ -163,6 +166,8 @@
                        *s++ = dig[k];
                }
        }
+       if (!z && *(s - 1) == ':')
+               *s++ = '0';
        if (bits > 0 && bits <= 128)
                s = dec(s, "/", bits);
        *s = 0;
--- old/usr/src/lib/libast/common/string/fmtls.c        Fri Sep 25 05:54:49 2009
+++ new/usr/src/lib/libast/common/string/fmtls.c        Fri Sep 25 05:54:47 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmtmatch.c     Fri Sep 25 05:54:51 2009
+++ new/usr/src/lib/libast/common/string/fmtmatch.c     Fri Sep 25 05:54:49 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmtmode.c      Fri Sep 25 05:54:54 2009
+++ new/usr/src/lib/libast/common/string/fmtmode.c      Fri Sep 25 05:54:52 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmtnum.c       Fri Sep 25 05:54:56 2009
+++ new/usr/src/lib/libast/common/string/fmtnum.c       Fri Sep 25 05:54:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmtperm.c      Fri Sep 25 05:54:59 2009
+++ new/usr/src/lib/libast/common/string/fmtperm.c      Fri Sep 25 05:54:57 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmtre.c        Fri Sep 25 05:55:02 2009
+++ new/usr/src/lib/libast/common/string/fmtre.c        Fri Sep 25 05:55:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmtscale.c     Fri Sep 25 05:55:04 2009
+++ new/usr/src/lib/libast/common/string/fmtscale.c     Fri Sep 25 05:55:02 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmtsignal.c    Fri Sep 25 05:55:07 2009
+++ new/usr/src/lib/libast/common/string/fmtsignal.c    Fri Sep 25 05:55:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmttime.c      Fri Sep 25 05:55:09 2009
+++ new/usr/src/lib/libast/common/string/fmttime.c      Fri Sep 25 05:55:07 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmttmx.c       Fri Sep 25 05:55:12 2009
+++ new/usr/src/lib/libast/common/string/fmttmx.c       Fri Sep 25 05:55:10 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmttv.c        Fri Sep 25 05:55:14 2009
+++ new/usr/src/lib/libast/common/string/fmttv.c        Fri Sep 25 05:55:13 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmtuid.c       Fri Sep 25 05:55:17 2009
+++ new/usr/src/lib/libast/common/string/fmtuid.c       Fri Sep 25 05:55:15 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/fmtversion.c   Fri Sep 25 05:55:19 2009
+++ new/usr/src/lib/libast/common/string/fmtversion.c   Fri Sep 25 05:55:18 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/memdup.c       Fri Sep 25 05:55:22 2009
+++ new/usr/src/lib/libast/common/string/memdup.c       Fri Sep 25 05:55:20 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/modedata.c     Fri Sep 25 05:55:24 2009
+++ new/usr/src/lib/libast/common/string/modedata.c     Fri Sep 25 05:55:23 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/modei.c        Fri Sep 25 05:55:27 2009
+++ new/usr/src/lib/libast/common/string/modei.c        Fri Sep 25 05:55:25 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/modelib.h      Fri Sep 25 05:55:30 2009
+++ new/usr/src/lib/libast/common/string/modelib.h      Fri Sep 25 05:55:28 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/modex.c        Fri Sep 25 05:55:32 2009
+++ new/usr/src/lib/libast/common/string/modex.c        Fri Sep 25 05:55:30 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/stracmp.c      Fri Sep 25 05:55:35 2009
+++ new/usr/src/lib/libast/common/string/stracmp.c      Fri Sep 25 05:55:33 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strcopy.c      Fri Sep 25 05:55:37 2009
+++ new/usr/src/lib/libast/common/string/strcopy.c      Fri Sep 25 05:55:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strdup.c       Fri Sep 25 05:55:40 2009
+++ new/usr/src/lib/libast/common/string/strdup.c       Fri Sep 25 05:55:38 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strelapsed.c   Fri Sep 25 05:55:43 2009
+++ new/usr/src/lib/libast/common/string/strelapsed.c   Fri Sep 25 05:55:41 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strerror.c     Fri Sep 25 05:55:45 2009
+++ new/usr/src/lib/libast/common/string/strerror.c     Fri Sep 25 05:55:43 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/stresc.c       Fri Sep 25 05:55:48 2009
+++ new/usr/src/lib/libast/common/string/stresc.c       Fri Sep 25 05:55:46 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/streval.c      Fri Sep 25 05:55:50 2009
+++ new/usr/src/lib/libast/common/string/streval.c      Fri Sep 25 05:55:48 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strexpr.c      Fri Sep 25 05:55:53 2009
+++ new/usr/src/lib/libast/common/string/strexpr.c      Fri Sep 25 05:55:51 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strgid.c       Fri Sep 25 05:55:56 2009
+++ new/usr/src/lib/libast/common/string/strgid.c       Fri Sep 25 05:55:54 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strlcat.c      Fri Sep 25 05:55:58 2009
+++ new/usr/src/lib/libast/common/string/strlcat.c      Fri Sep 25 05:55:56 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -40,7 +40,7 @@
 #else
 
 /*
- * append at t onto s limiting total size of s to n
+ * append t onto s limiting total size of s to n
  * s 0 terminated if n>0
  * min(n,strlen(s))+strlen(t) returned
  */
@@ -52,12 +52,17 @@
 extern size_t
 strlcat(register char* s, register const char* t, register size_t n)
 {
+       register size_t m;
        const char*     o = t;
 
-       if (n)
+       if (m = n)
        {
-               while (--n && *s)
+               while (n && *s)
+               {
+                       n--;
                        s++;
+               }
+               m -= n;
                if (n)
                        do
                        {
@@ -72,7 +77,7 @@
        }
        if (!n)
                while (*t++);
-       return t - o - 1;
+       return (t - o) + m - 1;
 }
 
 #endif
--- old/usr/src/lib/libast/common/string/strlcpy.c      Fri Sep 25 05:56:01 2009
+++ new/usr/src/lib/libast/common/string/strlcpy.c      Fri Sep 25 05:55:59 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strlook.c      Fri Sep 25 05:56:03 2009
+++ new/usr/src/lib/libast/common/string/strlook.c      Fri Sep 25 05:56:01 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strmatch.c     Fri Sep 25 05:56:06 2009
+++ new/usr/src/lib/libast/common/string/strmatch.c     Fri Sep 25 05:56:04 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strmode.c      Fri Sep 25 05:56:09 2009
+++ new/usr/src/lib/libast/common/string/strmode.c      Fri Sep 25 05:56:07 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strnacmp.c     Fri Sep 25 05:56:11 2009
+++ new/usr/src/lib/libast/common/string/strnacmp.c     Fri Sep 25 05:56:09 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strncopy.c     Fri Sep 25 05:56:14 2009
+++ new/usr/src/lib/libast/common/string/strncopy.c     Fri Sep 25 05:56:12 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- /dev/null   Fri Sep 25 05:56:16 2009
+++ new/usr/src/lib/libast/common/string/strnpcmp.c     Fri Sep 25 05:56:14 2009
@@ -0,0 +1,51 @@
+/***********************************************************************
+*                                                                      *
+*               This software is part of the ast package               *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
+*                      and is licensed under the                       *
+*                  Common Public License, Version 1.0                  *
+*                    by AT&T Intellectual Property                     *
+*                                                                      *
+*                A copy of the License is available at                 *
+*            http://www.opensource.org/licenses/cpl1.0.txt             *
+*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
+*                                                                      *
+*              Information and Software Systems Research               *
+*                            AT&T Research                             *
+*                           Florham Park NJ                            *
+*                                                                      *
+*                 Glenn Fowler <gsf at research.att.com>                  *
+*                  David Korn <dgk at research.att.com>                   *
+*                   Phong Vo <kpv at research.att.com>                    *
+*                                                                      *
+***********************************************************************/
+#pragma prototyped
+
+#include <ast.h>
+
+/*
+ * path prefix strncmp(3) -- longest first!
+ */
+
+int
+strnpcmp(register const char* a, register const char* b, size_t n)
+{
+       register const char*    e;
+
+       e = a + n;
+       for (;;)
+       {
+               if (a >= e)
+                       return 0;
+               if (*a != *b)
+                       break;
+               if (!*a++)
+                       return 0;
+               b++;
+       }
+       if (*a == 0 && *b == '/')
+               return 1;
+       if (*a == '/' && *b == 0)
+               return -1;
+       return (a < b) ? -1 : 1;
+}
--- old/usr/src/lib/libast/common/string/strntod.c      Fri Sep 25 05:56:19 2009
+++ new/usr/src/lib/libast/common/string/strntod.c      Fri Sep 25 05:56:17 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strntol.c      Fri Sep 25 05:56:21 2009
+++ new/usr/src/lib/libast/common/string/strntol.c      Fri Sep 25 05:56:19 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strntold.c     Fri Sep 25 05:56:24 2009
+++ new/usr/src/lib/libast/common/string/strntold.c     Fri Sep 25 05:56:22 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strntoll.c     Fri Sep 25 05:56:26 2009
+++ new/usr/src/lib/libast/common/string/strntoll.c     Fri Sep 25 05:56:24 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strnton.c      Fri Sep 25 05:56:29 2009
+++ new/usr/src/lib/libast/common/string/strnton.c      Fri Sep 25 05:56:27 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strntonll.c    Fri Sep 25 05:56:31 2009
+++ new/usr/src/lib/libast/common/string/strntonll.c    Fri Sep 25 05:56:30 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strntoul.c     Fri Sep 25 05:56:34 2009
+++ new/usr/src/lib/libast/common/string/strntoul.c     Fri Sep 25 05:56:32 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strntoull.c    Fri Sep 25 05:56:37 2009
+++ new/usr/src/lib/libast/common/string/strntoull.c    Fri Sep 25 05:56:35 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- /dev/null   Fri Sep 25 05:56:39 2009
+++ new/usr/src/lib/libast/common/string/strnvcmp.c     Fri Sep 25 05:56:37 2009
@@ -0,0 +1,86 @@
+/***********************************************************************
+*                                                                      *
+*               This software is part of the ast package               *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
+*                      and is licensed under the                       *
+*                  Common Public License, Version 1.0                  *
+*                    by AT&T Intellectual Property                     *
+*                                                                      *
+*                A copy of the License is available at                 *
+*            http://www.opensource.org/licenses/cpl1.0.txt             *
+*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
+*                                                                      *
+*              Information and Software Systems Research               *
+*                            AT&T Research                             *
+*                           Florham Park NJ                            *
+*                                                                      *
+*                 Glenn Fowler <gsf at research.att.com>                  *
+*                  David Korn <dgk at research.att.com>                   *
+*                   Phong Vo <kpv at research.att.com>                    *
+*                                                                      *
+***********************************************************************/
+#pragma prototyped
+
+#include <ast.h>
+#include <ctype.h>
+
+/*
+ * version strncmp(3)
+ */
+
+int
+strnvcmp(register const char* a, register const char* b, size_t n)
+{
+       register const char*    ae;
+       register const char*    be;
+       register unsigned long  na;
+       register unsigned long  nb;
+
+       ae = a + n;
+       be = b + n;
+       for (;;)
+       {
+               if (a >= ae)
+               {
+                       if (b >= be)
+                               return 0;
+                       return 1;
+               }
+               else if (b >= be)
+                       return -1;
+               if (isdigit(*a) && isdigit(*b))
+               {
+                       na = nb = 0;
+                       while (a < ae && isdigit(*a))
+                               na = na * 10 + *a++ - '0';
+                       while (b < be && isdigit(*b))
+                               nb = nb * 10 + *b++ - '0';
+                       if (na < nb)
+                               return -1;
+                       if (na > nb)
+                               return 1;
+               }
+               else if (*a != *b)
+                       break;
+               else if (!*a)
+                       return 0;
+               else
+               {
+                       a++;
+                       b++;
+               }
+       }
+       if (*a == 0)
+               return -1;
+       if (*b == 0)
+               return 1;
+       if (*a == '.')
+               return -1;
+       if (*b == '.')
+               return 1;
+       if (*a == '-')
+               return -1;
+       if (*b == '-')
+               return 1;
+       return *a < *b ? -1 : 1;
+}
--- old/usr/src/lib/libast/common/string/stropt.c       Fri Sep 25 05:56:42 2009
+++ new/usr/src/lib/libast/common/string/stropt.c       Fri Sep 25 05:56:40 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- /dev/null   Fri Sep 25 05:56:44 2009
+++ new/usr/src/lib/libast/common/string/strpcmp.c      Fri Sep 25 05:56:42 2009
@@ -0,0 +1,44 @@
+/***********************************************************************
+*                                                                      *
+*               This software is part of the ast package               *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
+*                      and is licensed under the                       *
+*                  Common Public License, Version 1.0                  *
+*                    by AT&T Intellectual Property                     *
+*                                                                      *
+*                A copy of the License is available at                 *
+*            http://www.opensource.org/licenses/cpl1.0.txt             *
+*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
+*                                                                      *
+*              Information and Software Systems Research               *
+*                            AT&T Research                             *
+*                           Florham Park NJ                            *
+*                                                                      *
+*                 Glenn Fowler <gsf at research.att.com>                  *
+*                  David Korn <dgk at research.att.com>                   *
+*                   Phong Vo <kpv at research.att.com>                    *
+*                                                                      *
+***********************************************************************/
+#pragma prototyped
+
+#include <ast.h>
+
+/*
+ * path prefix strcmp(3) -- longest first!
+ */
+
+int
+strpcmp(register const char* a, register const char* b)
+{
+       while (*a == *b)
+       {
+               if (!*a++)
+                       return 0;
+               b++;
+       }
+       if (*a == 0 && *b == '/')
+               return 1;
+       if (*a == '/' && *b == 0)
+               return -1;
+       return (a < b) ? -1 : 1;
+}
--- old/usr/src/lib/libast/common/string/strperm.c      Fri Sep 25 05:56:47 2009
+++ new/usr/src/lib/libast/common/string/strperm.c      Fri Sep 25 05:56:45 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strpsearch.c   Fri Sep 25 05:56:49 2009
+++ new/usr/src/lib/libast/common/string/strpsearch.c   Fri Sep 25 05:56:47 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strsearch.c    Fri Sep 25 05:56:52 2009
+++ new/usr/src/lib/libast/common/string/strsearch.c    Fri Sep 25 05:56:50 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strsort.c      Fri Sep 25 05:56:54 2009
+++ new/usr/src/lib/libast/common/string/strsort.c      Fri Sep 25 05:56:53 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strtape.c      Fri Sep 25 05:56:57 2009
+++ new/usr/src/lib/libast/common/string/strtape.c      Fri Sep 25 05:56:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strtoi.h       Fri Sep 25 05:57:00 2009
+++ new/usr/src/lib/libast/common/string/strtoi.h       Fri Sep 25 05:56:58 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -37,6 +37,7 @@
  *     S2I_number      the signed number type
  *     S2I_unumber     the unsigned number type
  *     S2I_unsigned    1 for unsigned, 0 for signed
+ *     S2I_qualifier   1 for optional qualifier suffix, 0 otherwise
  *     S2I_multiplier  1 for optional multiplier suffix, 0 otherwise
  *     S2I_size        the second argument is the input string size
  *
@@ -425,6 +426,8 @@
                c = *(s - 1);
        }
 
+#if S2I_qualifier
+
        /*
         * optional qualifier suffix
         */
@@ -461,6 +464,7 @@
                                break;
                }
        }
+#endif
        if (S2I_valid(s))
        {
 #if S2I_multiplier
--- old/usr/src/lib/libast/common/string/strtoip4.c     Fri Sep 25 05:57:02 2009
+++ new/usr/src/lib/libast/common/string/strtoip4.c     Fri Sep 25 05:57:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strtoip6.c     Fri Sep 25 05:57:05 2009
+++ new/usr/src/lib/libast/common/string/strtoip6.c     Fri Sep 25 05:57:03 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strton.c       Fri Sep 25 05:57:08 2009
+++ new/usr/src/lib/libast/common/string/strton.c       Fri Sep 25 05:57:06 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/strtonll.c     Fri Sep 25 05:57:10 2009
+++ new/usr/src/lib/libast/common/string/strtonll.c     Fri Sep 25 05:57:08 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/struid.c       Fri Sep 25 05:57:13 2009
+++ new/usr/src/lib/libast/common/string/struid.c       Fri Sep 25 05:57:11 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/struniq.c      Fri Sep 25 05:57:15 2009
+++ new/usr/src/lib/libast/common/string/struniq.c      Fri Sep 25 05:57:13 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- /dev/null   Fri Sep 25 05:57:18 2009
+++ new/usr/src/lib/libast/common/string/strvcmp.c      Fri Sep 25 05:57:16 2009
@@ -0,0 +1,74 @@
+/***********************************************************************
+*                                                                      *
+*               This software is part of the ast package               *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
+*                      and is licensed under the                       *
+*                  Common Public License, Version 1.0                  *
+*                    by AT&T Intellectual Property                     *
+*                                                                      *
+*                A copy of the License is available at                 *
+*            http://www.opensource.org/licenses/cpl1.0.txt             *
+*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
+*                                                                      *
+*              Information and Software Systems Research               *
+*                            AT&T Research                             *
+*                           Florham Park NJ                            *
+*                                                                      *
+*                 Glenn Fowler <gsf at research.att.com>                  *
+*                  David Korn <dgk at research.att.com>                   *
+*                   Phong Vo <kpv at research.att.com>                    *
+*                                                                      *
+***********************************************************************/
+#pragma prototyped
+
+#include <ast.h>
+#include <ctype.h>
+
+/*
+ * version strcmp(3)
+ */
+
+int
+strvcmp(register const char* a, register const char* b)
+{
+       register unsigned long  na;
+       register unsigned long  nb;
+
+       for (;;)
+       {
+               if (isdigit(*a) && isdigit(*b))
+               {
+                       na = nb = 0;
+                       while (isdigit(*a))
+                               na = na * 10 + *a++ - '0';
+                       while (isdigit(*b))
+                               nb = nb * 10 + *b++ - '0';
+                       if (na < nb)
+                               return -1;
+                       if (na > nb)
+                               return 1;
+               }
+               else if (*a != *b)
+                       break;
+               else if (!*a)
+                       return 0;
+               else
+               {
+                       a++;
+                       b++;
+               }
+       }
+       if (*a == 0)
+               return -1;
+       if (*b == 0)
+               return 1;
+       if (*a == '.')
+               return -1;
+       if (*b == '.')
+               return 1;
+       if (*a == '-')
+               return -1;
+       if (*b == '-')
+               return 1;
+       return *a < *b ? -1 : 1;
+}
--- old/usr/src/lib/libast/common/string/swapget.c      Fri Sep 25 05:57:20 2009
+++ new/usr/src/lib/libast/common/string/swapget.c      Fri Sep 25 05:57:18 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/swapmem.c      Fri Sep 25 05:57:23 2009
+++ new/usr/src/lib/libast/common/string/swapmem.c      Fri Sep 25 05:57:21 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/swapop.c       Fri Sep 25 05:57:25 2009
+++ new/usr/src/lib/libast/common/string/swapop.c       Fri Sep 25 05:57:23 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/swapput.c      Fri Sep 25 05:57:28 2009
+++ new/usr/src/lib/libast/common/string/swapput.c      Fri Sep 25 05:57:26 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/tok.c  Fri Sep 25 05:57:31 2009
+++ new/usr/src/lib/libast/common/string/tok.c  Fri Sep 25 05:57:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/tokline.c      Fri Sep 25 05:57:33 2009
+++ new/usr/src/lib/libast/common/string/tokline.c      Fri Sep 25 05:57:31 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/string/tokscan.c      Fri Sep 25 05:57:36 2009
+++ new/usr/src/lib/libast/common/string/tokscan.c      Fri Sep 25 05:57:34 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tmdata.c   Fri Sep 25 05:57:38 2009
+++ new/usr/src/lib/libast/common/tm/tmdata.c   Fri Sep 25 05:57:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -93,6 +93,8 @@
        "sixth",        "seventh",      "eighth",       "ninth",        "tenth",
 
        "final",        "ending",       "nth",
+
+       "work",         "working",      "workday",
 };
 
 /*
@@ -99,7 +101,7 @@
  * format[] lex type classes
  */
 
-static char            lex[] =
+static unsigned char   lex[] =
 {
        TM_MONTH_ABBREV,TM_MONTH_ABBREV,TM_MONTH_ABBREV,TM_MONTH_ABBREV,
        TM_MONTH_ABBREV,TM_MONTH_ABBREV,TM_MONTH_ABBREV,TM_MONTH_ABBREV,
@@ -153,6 +155,8 @@
        TM_ORDINALS,    TM_ORDINALS,    TM_ORDINALS,    TM_ORDINALS,    
TM_ORDINALS,
 
        TM_FINAL,       TM_FINAL,       TM_FINAL,
+
+       TM_WORK,        TM_WORK,        TM_WORK,
 };
 
 /*
@@ -185,29 +189,30 @@
 
 static Tm_leap_t       leap[] =
 {
-        1136073622,   23,              /* 2005-12-31+23:59:60 UTC*/
-         915148821,   22,              /* 1998-12-31+23:59:60 UTC */
-         867715220,   21,              /* 1997-06-30+23:59:60 UTC */
-         820454419,   20,              /* 1995-12-31+23:59:60 UTC */
-         773020818,   19,              /* 1994-06-30+23:59:60 UTC */
-         741484817,   18,              /* 1993-06-30+23:59:60 UTC */
-         709948816,   17,              /* 1992-06-30+23:59:60 UTC */
-         662688015,   16,              /* 1990-12-31+23:59:60 UTC */
-         631152014,   15,              /* 1989-12-31+23:59:60 UTC */
-         567993613,   14,              /* 1987-12-31+23:59:60 UTC */
-         489024012,   13,              /* 1985-06-30+23:59:60 UTC */
-         425865611,   12,              /* 1983-06-30+23:59:60 UTC */
-         394329610,   11,              /* 1982-06-30+23:59:60 UTC */
-         362793609,   10,              /* 1981-06-30+23:59:60 UTC */
-         315532808,    9,              /* 1979-12-31+23:59:60 UTC */
-         283996807,    8,              /* 1978-12-31+23:59:60 UTC */
-         252460806,    7,              /* 1977-12-31+23:59:60 UTC */
-         220924805,    6,              /* 1976-12-31+23:59:60 UTC */
-         189302404,    5,              /* 1975-12-31+23:59:60 UTC */
-         157766403,    4,              /* 1974-12-31+23:59:60 UTC */
-         126230402,    3,              /* 1973-12-31+23:59:60 UTC */
-          94694401,    2,              /* 1972-12-31+23:59:60 UTC */
-          78796800,    1,              /* 1972-06-30+23:59:60 UTC */
+        1230768023,   24,              /* 2008-12-31+23:59:60-0000 */
+        1136073622,   23,              /* 2005-12-31+23:59:60-0000 */
+         915148821,   22,              /* 1998-12-31+23:59:60-0000 */
+         867715220,   21,              /* 1997-06-30+23:59:60-0000 */
+         820454419,   20,              /* 1995-12-31+23:59:60-0000 */
+         773020818,   19,              /* 1994-06-30+23:59:60-0000 */
+         741484817,   18,              /* 1993-06-30+23:59:60-0000 */
+         709948816,   17,              /* 1992-06-30+23:59:60-0000 */
+         662688015,   16,              /* 1990-12-31+23:59:60-0000 */
+         631152014,   15,              /* 1989-12-31+23:59:60-0000 */
+         567993613,   14,              /* 1987-12-31+23:59:60-0000 */
+         489024012,   13,              /* 1985-06-30+23:59:60-0000 */
+         425865611,   12,              /* 1983-06-30+23:59:60-0000 */
+         394329610,   11,              /* 1982-06-30+23:59:60-0000 */
+         362793609,   10,              /* 1981-06-30+23:59:60-0000 */
+         315532808,    9,              /* 1979-12-31+23:59:60-0000 */
+         283996807,    8,              /* 1978-12-31+23:59:60-0000 */
+         252460806,    7,              /* 1977-12-31+23:59:60-0000 */
+         220924805,    6,              /* 1976-12-31+23:59:60-0000 */
+         189302404,    5,              /* 1975-12-31+23:59:60-0000 */
+         157766403,    4,              /* 1974-12-31+23:59:60-0000 */
+         126230402,    3,              /* 1973-12-31+23:59:60-0000 */
+          94694401,    2,              /* 1972-12-31+23:59:60-0000 */
+          78796800,    1,              /* 1972-06-30+23:59:60-0000 */
                  0,    0,              /* can reference (tl+1)     */
                  0,    0
 };
@@ -240,10 +245,10 @@
  "CAN",        "AST",  "ADT",   ( 4 * 60),     TM_DST, /* Atlantic             
*/
  0,    "NST",  0,       ( 3 * 60 + 30),     0, /* Newfoundland         */
  "GBR",        "",     "BST",   ( 0 * 60),     TM_DST, /* British Summer       
*/
- "EUR",        "WET",  0,       ( 0 * 60),     TM_DST, /* Western Eurpoean     
*/
- 0,    "CET",  0,      -( 1 * 60),     TM_DST, /* Central European     */
- 0,    "MET",  0,      -( 1 * 60),     TM_DST, /* Middle European      */
- 0,    "EET",  0,      -( 2 * 60),     TM_DST, /* Eastern Eurpoean     */
+ "EUR",        "WET",  "WEST",  ( 0 * 60),     TM_DST, /* Western Eurpoean     
*/
+ 0,    "CET",  "CEST", -( 1 * 60),     TM_DST, /* Central European     */
+ 0,    "MET",  "MEST", -( 1 * 60),     TM_DST, /* Middle European      */
+ 0,    "EET",  "EEST", -( 2 * 60),     TM_DST, /* Eastern Eurpoean     */
  "ISR",        "IST",  "IDT",  -( 3 * 60),     TM_DST, /* Israel               
*/
  "IND",        "IST",  0,      -( 5 * 60 + 30 ),    0, /* India                
*/
  "CHN",        "HKT",  0,      -( 8 * 60),          0, /* Hong Kong            
*/
--- old/usr/src/lib/libast/common/tm/tmdate.c   Fri Sep 25 05:57:41 2009
+++ new/usr/src/lib/libast/common/tm/tmdate.c   Fri Sep 25 05:57:39 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tmequiv.c  Fri Sep 25 05:57:44 2009
+++ new/usr/src/lib/libast/common/tm/tmequiv.c  Fri Sep 25 05:57:42 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -32,7 +32,7 @@
 /*
  * use one of the 14 equivalent calendar years to determine
  * daylight savings time for future years beyond the range
- * of the local system (via tmxmake())
+ * of the local system (via tmxtm())
  */
 
 static const short equiv[] =
--- old/usr/src/lib/libast/common/tm/tmfix.c    Fri Sep 25 05:57:46 2009
+++ new/usr/src/lib/libast/common/tm/tmfix.c    Fri Sep 25 05:57:44 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -28,7 +28,7 @@
  */
 
 #include <ast.h>
-#include <tm.h>
+#include <tmx.h>
 
 #define DAYS(p)        (tm_data.days[(p)->tm_mon]+((p)->tm_mon==1&&LEAP(p)))
 #define LEAP(p)        (tmisleapyear((p)->tm_year))
@@ -36,7 +36,7 @@
 /*
  * correct out of bounds fields in tm
  *
- * tm_isdst is not changed -- call tmxmake() to get that
+ * tm_isdst is not changed -- call tmxtm() to get that
  *
  * tm is the return value
  */
@@ -65,6 +65,16 @@
         * adjust from shortest to longest units
         */
 
+       if ((n = tm->tm_nsec) < 0)
+       {
+               tm->tm_sec -= (TMX_RESOLUTION - n) / TMX_RESOLUTION;
+               tm->tm_nsec = TMX_RESOLUTION - (-n) % TMX_RESOLUTION;
+       }
+       else if (n >= TMX_RESOLUTION)
+       {
+               tm->tm_sec += n / TMX_RESOLUTION;
+               tm->tm_nsec %= TMX_RESOLUTION;
+       }
        if ((n = tm->tm_sec) < 0)
        {
                tm->tm_min -= (60 - n) / 60;
--- old/usr/src/lib/libast/common/tm/tmfmt.c    Fri Sep 25 05:57:49 2009
+++ new/usr/src/lib/libast/common/tm/tmfmt.c    Fri Sep 25 05:57:47 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tmform.c   Fri Sep 25 05:57:51 2009
+++ new/usr/src/lib/libast/common/tm/tmform.c   Fri Sep 25 05:57:49 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tmgoff.c   Fri Sep 25 05:57:54 2009
+++ new/usr/src/lib/libast/common/tm/tmgoff.c   Fri Sep 25 05:57:52 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tminit.c   Fri Sep 25 05:57:56 2009
+++ new/usr/src/lib/libast/common/tm/tminit.c   Fri Sep 25 05:57:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tmleap.c   Fri Sep 25 05:57:59 2009
+++ new/usr/src/lib/libast/common/tm/tmleap.c   Fri Sep 25 05:57:57 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tmlex.c    Fri Sep 25 05:58:02 2009
+++ new/usr/src/lib/libast/common/tm/tmlex.c    Fri Sep 25 05:58:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tmlocale.c Fri Sep 25 05:58:04 2009
+++ new/usr/src/lib/libast/common/tm/tmlocale.c Fri Sep 25 05:58:02 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tmmake.c   Fri Sep 25 05:58:07 2009
+++ new/usr/src/lib/libast/common/tm/tmmake.c   Fri Sep 25 05:58:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tmpoff.c   Fri Sep 25 05:58:09 2009
+++ new/usr/src/lib/libast/common/tm/tmpoff.c   Fri Sep 25 05:58:08 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tmscan.c   Fri Sep 25 05:58:12 2009
+++ new/usr/src/lib/libast/common/tm/tmscan.c   Fri Sep 25 05:58:10 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tmsleep.c  Fri Sep 25 05:58:15 2009
+++ new/usr/src/lib/libast/common/tm/tmsleep.c  Fri Sep 25 05:58:13 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tmtime.c   Fri Sep 25 05:58:17 2009
+++ new/usr/src/lib/libast/common/tm/tmtime.c   Fri Sep 25 05:58:15 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tmtype.c   Fri Sep 25 05:58:20 2009
+++ new/usr/src/lib/libast/common/tm/tmtype.c   Fri Sep 25 05:58:18 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tmweek.c   Fri Sep 25 05:58:22 2009
+++ new/usr/src/lib/libast/common/tm/tmweek.c   Fri Sep 25 05:58:21 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tmword.c   Fri Sep 25 05:58:25 2009
+++ new/usr/src/lib/libast/common/tm/tmword.c   Fri Sep 25 05:58:23 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tmxdate.c  Fri Sep 25 05:58:28 2009
+++ new/usr/src/lib/libast/common/tm/tmxdate.c  Fri Sep 25 05:58:26 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -38,6 +38,8 @@
 #define dig3(s,n)      
((n)=((*(s)++)-'0')*100,(n)+=((*(s)++)-'0')*10,(n)+=(*(s)++)-'0')
 #define dig4(s,n)      
((n)=((*(s)++)-'0')*1000,(n)+=((*(s)++)-'0')*100,(n)+=((*(s)++)-'0')*10,(n)+=(*(s)++)-'0')
 
+#undef BREAK
+
 #define BREAK          (1<<0)
 #define CCYYMMDDHHMMSS (1<<1)
 #define CRON           (1<<2)
@@ -56,9 +58,12 @@
 #define SECOND         (1<<15)
 #define THIS           (1L<<16)
 #define WDAY           (1L<<17)
-#define YEAR           (1L<<18)
-#define ZONE           (1L<<19)
+#define WORK           (1L<<18)
+#define YEAR           (1L<<19)
+#define ZONE           (1L<<20)
 
+#define FFMT           "%s%s%s%s%s%s%s|"
+#define        FLAGS(f)        
(f&EXACT)?"|EXACT":"",(f&LAST)?"|LAST":"",(f&THIS)?"|THIS":"",(f&NEXT)?"|NEXT":"",(f&ORDINAL)?"|ORDINAL":"",(f&FINAL)?"|FINAL":"",(f&WORK)?"|WORK":""
 /*
  * parse cron range into set
  * return: -1:error 0:* 1:some
@@ -112,6 +117,36 @@
 }
 
 /*
+ * normalize <p,q> to power of 10 u in tm
+ */
+
+static void
+powerize(Tm_t* tm, unsigned long p, unsigned long q, unsigned long u)
+{
+       Time_t  t = p;
+
+       while (q > u)
+       {
+               q /= 10;
+               t /= 10;
+       }
+       while (q < u)
+       {
+               q *= 10;
+               t *= 10;
+       }
+       tm->tm_nsec += (int)(t % TMX_RESOLUTION);
+       tm->tm_sec += (int)(t / TMX_RESOLUTION);
+}
+
+#define K1(c1)                 (c1)
+#define K2(c1,c2)              (((c1)<<8)|(c2))
+#define K3(c1,c2,c3)           (((c1)<<16)|((c2)<<8)|(c3))
+#define K4(c1,c2,c3,c4)                (((c1)<<24)|((c2)<<16)|((c3)<<8)|(c4))
+
+#define P_INIT(n)              w = n; p = q = 0; u = (char*)s + 1
+
+/*
  * parse date expression in s and return Time_t value
  *
  * if non-null, e points to the first invalid sequence in s
@@ -130,6 +165,7 @@
        Time_t          fix;
        char*           t;
        char*           u;
+       const char*     o;
        const char*     x;
        char*           last;
        char*           type;
@@ -144,9 +180,10 @@
        int             k;
        int             l;
        long            m;
-       long            p;
-       long            q;
+       unsigned long   p;
+       unsigned long   q;
        Tm_zone_t*      zp;
+       Tm_t            ts;
        char            skip[UCHAR_MAX + 1];
 
        /*
@@ -153,7 +190,7 @@
         * check DATEMSK first
         */
 
-       debug((error(-1, "AHA tmxdate 2008-05-22")));
+       debug((error(-1, "AHA tmxdate 2009-03-06")));
        fix = tmxscan(s, &last, NiL, &t, now, 0);
        if (t && !*last)
        {
@@ -161,6 +198,7 @@
                        *e = last;
                return fix;
        }
+       o = s;
 
  reset:
 
@@ -168,9 +206,10 @@
         * use now for defaults
         */
 
-       tm = tmxmake(now);
-       tm_info.date = tm_info.zone;
+       tm = tmxtm(&ts, now, NiL);
+       tm_info.date = tm->tm_zone;
        day = -1;
+       dir = 0;
        dst = TM_DST;
        set = state = 0;
        type = 0;
@@ -183,12 +222,13 @@
         * get <weekday year month day hour minutes seconds ?[ds]t [ap]m>
         */
 
+ again:
        for (;;)
        {
                state &= (state & HOLD) ? ~(HOLD) : ~(EXACT|LAST|NEXT|THIS);
                if ((set|state) & (YEAR|MONTH|DAY))
                        skip['/'] = 1;
-               message((-1, "AHA#%d state=%s%s%s%s| set=%s%s%s%s|", __LINE__, 
(state & EXACT) ? "|EXACT" : "", (state & LAST) ? "|LAST" : "", (state & THIS) 
? "|THIS" : "", (state & NEXT) ? "|NEXT" : "", (set & EXACT) ? "|EXACT" : "", 
(set & LAST) ? "|LAST" : "", (set & THIS) ? "|THIS" : "", (set & NEXT) ? 
"|NEXT" : ""));
+               message((-1, "AHA#%d state=" FFMT " set=" FFMT, __LINE__, 
FLAGS(state), FLAGS(set)));
                for (;;)
                {
                        if (*s == '.' || *s == '-' || *s == '+')
@@ -234,6 +274,232 @@
                        }
                        break;
                }
+               if ((*s == 'P' || *s == 'p') && (!isalpha(*(s + 1)) || (*(s + 
1) == 'T' || *(s + 1) == 't') && !isalpha(*(s + 2))))
+               {
+                       Tm_t    otm;
+
+                       /*
+                        * iso duration
+                        */
+
+                       otm = *tm;
+                       t = (char*)s;
+                       m = 0;
+                       P_INIT('Y');
+                       do
+                       {
+                               c = *++s;
+                       duration_next:
+                               switch (c)
+                               {
+                               case 0:
+                                       m++;
+                                       if ((char*)s > u)
+                                       {
+                                               s--;
+                                               c = '_';
+                                               goto duration_next;
+                                       }
+                                       break;
+                               case 'T':
+                               case 't':
+                                       m++;
+                                       if ((char*)s > u)
+                                       {
+                                               s++;
+                                               c = 'D';
+                                               goto duration_next;
+                                       }
+                                       continue;
+                               case 'Y':
+                               case 'y':
+                                       m = 0;
+                                       if (q > 1)
+                                               tm->tm_sec += 
(365L*24L*60L*60L) * p / q;
+                                       else
+                                               tm->tm_year += p;
+                                       P_INIT('M');
+                                       continue;
+                               case 'm':
+                                       if (!m)
+                                               m = 1;
+                                       /*FALLTHROUGH*/
+                               case 'M':
+                                       switch (*(s + 1))
+                                       {
+                                       case 'I':
+                                       case 'i':
+                                               s++;
+                                               m = 1;
+                                               w = 'S';
+                                               break;
+                                       case 'O':
+                                       case 'o':
+                                               s++;
+                                               m = 0;
+                                               w = 'H';
+                                               break;
+                                       case 'S':
+                                       case 's':
+                                               s++;
+                                               m = 2;
+                                               w = 's';
+                                               break;
+                                       }
+                                       switch (m)
+                                       {
+                                       case 0:
+                                               m = 1;
+                                               if (q > 1)
+                                                       tm->tm_sec += 
(3042L*24L*60L*60L) * p / q / 100L;
+                                               else
+                                                       tm->tm_mon += p;
+                                               break;
+                                       case 1:
+                                               m = 2;
+                                               if (q > 1)
+                                                       tm->tm_sec += (60L) * p 
/ q;
+                                               else
+                                                       tm->tm_min += p;
+                                               break;
+                                       default:
+                                               if (q > 1)
+                                                       powerize(tm, p, q, 
1000UL);
+                                               else
+                                                       tm->tm_nsec += p * 
1000000L;
+                                               break;
+                                       }
+                                       P_INIT(w);
+                                       continue;
+                               case 'W':
+                               case 'w':
+                                       m = 0;
+                                       if (q > 1)
+                                               tm->tm_sec += (7L*24L*60L*60L) 
* p / q;
+                                       else
+                                               tm->tm_mday += 7 * p;
+                                       P_INIT('D');
+                                       continue;
+                               case 'D':
+                               case 'd':
+                                       m = 0;
+                                       if (q > 1)
+                                               tm->tm_sec += (24L*60L*60L) * p 
/ q;
+                                       else
+                                               tm->tm_mday += p;
+                                       P_INIT('H');
+                                       continue;
+                               case 'H':
+                               case 'h':
+                                       m = 1;
+                                       if (q > 1)
+                                               tm->tm_sec += (60L*60L) * p / q;
+                                       else
+                                               tm->tm_hour += p;
+                                       P_INIT('m');
+                                       continue;
+                               case 'S':
+                               case 's':
+                                       m = 2;
+                                       /*FALLTHROUGH*/
+                               case ' ':
+                               case '_':
+                               case '\n':
+                               case '\r':
+                               case '\t':
+                               case '\v':
+                                       if (q > 1)
+                                               powerize(tm, p, q, 
1000000000UL);
+                                       else
+                                               tm->tm_sec += p;
+                                       P_INIT('U');
+                                       continue;
+                               case 'U':
+                               case 'u':
+                                       switch (*(s + 1))
+                                       {
+                                       case 'S':
+                                       case 's':
+                                               s++;
+                                               break;
+                                       }
+                                       m = 0;
+                                       if (q > 1)
+                                               powerize(tm, p, q, 1000000UL);
+                                       else
+                                               tm->tm_nsec += p * 1000L;
+                                       P_INIT('N');
+                                       continue;
+                               case 'N':
+                               case 'n':
+                                       switch (*(s + 1))
+                                       {
+                                       case 'S':
+                                       case 's':
+                                               s++;
+                                               break;
+                                       }
+                                       m = 0;
+                                       if (q > 1)
+                                               powerize(tm, p, q, 
1000000000UL);
+                                       else
+                                               tm->tm_nsec += p;
+                                       P_INIT('Y');
+                                       continue;
+                               case '.':
+                                       if (q)
+                                               goto exact;
+                                       q = 1;
+                                       continue;
+                               case '-':
+                                       c = 'M';
+                                       u = (char*)s++;
+                                       while (*++u && *u != ':')
+                                               if (*u == '-')
+                                               {
+                                                       c = 'Y';
+                                                       break;
+                                               }
+                                       goto duration_next;
+                               case ':':
+                                       c = 'm';
+                                       u = (char*)s++;
+                                       while (*++u)
+                                               if (*u == ':')
+                                               {
+                                                       c = 'H';
+                                                       break;
+                                               }
+                                       goto duration_next;
+                               case '0':
+                               case '1':
+                               case '2':
+                               case '3':
+                               case '4':
+                               case '5':
+                               case '6':
+                               case '7':
+                               case '8':
+                               case '9':
+                                       q *= 10;
+                                       p = p * 10 + (c - '0');
+                                       continue;
+                               default:
+                               exact:
+                                       *tm = otm;
+                                       s = (const char*)t + 1;
+                                       if (*t == 'p')
+                                       {
+                                               state |= HOLD|EXACT;
+                                               set &= ~(EXACT|LAST|NEXT|THIS);
+                                               set |= state & 
(EXACT|LAST|NEXT|THIS);
+                                       }
+                                       goto again;
+                               }
+                               break;
+                       } while (c);
+                       continue;
+               }
                f = -1;
                if (*s == '+')
                {
@@ -369,7 +635,7 @@
                                if (flags & (MONTH|MDAY|WDAY))
                                {
                                        fix = tmxtime(tm, zone);
-                                       tm = tmxmake(fix);
+                                       tm = tmxtm(tm, fix, tm->tm_zone);
                                        i = tm->tm_mon + 1;
                                        j = tm->tm_mday;
                                        k = tm->tm_wday;
@@ -387,7 +653,7 @@
                                                        tt = tmxtime(tm, zone);
                                                        if (tt < fix)
                                                                goto done;
-                                                       tm = tmxmake(tt);
+                                                       tm = tmxtm(tm, tt, 
tm->tm_zone);
                                                        i = tm->tm_mon + 1;
                                                        j = tm->tm_mday;
                                                        k = tm->tm_wday;
@@ -408,7 +674,7 @@
                                                        {
                                                                tm->tm_mon = i 
- 1;
                                                                tm->tm_mday = j;
-                                                               tm = 
tmxmake(tmxtime(tm, zone));
+                                                               tm = tmxtm(tm, 
tmxtime(tm, zone), tm->tm_zone);
                                                                i = tm->tm_mon 
+ 1;
                                                                j = tm->tm_mday;
                                                                k = tm->tm_wday;
@@ -559,7 +825,8 @@
                                }
                                else
                                        n = -1;
-                               message((-1, "AHA#%d f=%d n=%d", __LINE__, f, 
n));
+                               dir = f;
+                               message((-1, "AHA#%d f=%d n=%d state=" FFMT, 
__LINE__, f, n, FLAGS(state)));
                        }
                        else
                        {
@@ -613,6 +880,8 @@
                                                        }
                                                        else
                                                                dig4(s, m);
+                                                       if (m < 1969 || m >= 
3000)
+                                                               break;
                                                        m -= 1900;
                                                }
                                                else if (i == 10)
@@ -805,353 +1074,481 @@
                        else
                                break;
                }
-               if (isalpha(*s) && n < 1000)
+               if (isalpha(*s))
                {
-                       if ((j = tmlex(s, &t, tm_info.format, TM_NFORM, 
tm_info.format + TM_SUFFIXES, TM_PARTS - TM_SUFFIXES)) >= 0)
+                       if (n > 0)
                        {
-                               s = t;
-                               switch (tm_data.lex[j])
+                               x = s;
+                               q = *s++;
+                               if (isalpha(*s))
                                {
-                               case TM_EXACT:
-                                       state |= HOLD|EXACT;
-                                       set &= ~(EXACT|LAST|NEXT|THIS);
-                                       set |= state & (EXACT|LAST|NEXT|THIS);
+                                       q <<= 8;
+                                       q |= *s++;
+                                       if (isalpha(*s))
+                                       {
+                                               if (tmlex(s, &t, tm_info.format 
+ TM_SUFFIXES, TM_PARTS - TM_SUFFIXES, NiL, 0) >= 0)
+                                                       s = t;
+                                               if (isalpha(*s))
+                                               {
+                                                       q <<= 8;
+                                                       q |= *s++;
+                                                       if (isalpha(*s))
+                                                       {
+                                                               q <<= 8;
+                                                               q |= *s++;
+                                                               if (isalpha(*s))
+                                                                       q = 0;
+                                                       }
+                                               }
+                                       }
+                               }
+                               switch (q)
+                               {
+                               case K1('y'):
+                               case K1('Y'):
+                               case K2('y','r'):
+                               case K2('Y','R'):
+                                       tm->tm_year += n;
+                                       set |= YEAR;
                                        continue;
-                               case TM_LAST:
-                                       state |= HOLD|LAST;
-                                       set &= ~(EXACT|LAST|NEXT|THIS);
-                                       set |= state & (EXACT|LAST|NEXT|THIS);
+                               case K1('M'):
+                               case K2('m','o'):
+                               case K2('M','O'):
+                                       tm->tm_mon += n;
+                                       set |= MONTH;
                                        continue;
-                               case TM_THIS:
-                                       state |= HOLD|THIS;
-                                       set &= ~(EXACT|LAST|NEXT|THIS);
-                                       set |= state & (EXACT|LAST|NEXT|THIS);
-                                       n = 0;
+                               case K1('w'):
+                               case K1('W'):
+                               case K2('w','k'):
+                               case K2('W','K'):
+                                       tm->tm_mday += n * 7;
+                                       set |= DAY;
                                        continue;
-                               case TM_NEXT:
-                                       /*
-                                        * disambiguate english "last ... in" 
-                                        */
-
-                                       if (!((state|set) & LAST))
+                               case K1('d'):
+                               case K1('D'):
+                               case K2('d','a'):
+                               case K2('d','y'):
+                               case K2('D','A'):
+                               case K2('D','Y'):
+                                       tm->tm_mday += n;
+                                       set |= DAY;
+                                       continue;
+                               case K1('h'):
+                               case K1('H'):
+                               case K2('h','r'):
+                               case K2('H','R'):
+                                       tm->tm_hour += n;
+                                       set |= HOUR;
+                                       continue;
+                               case K1('m'):
+                               case K2('m','n'):
+                               case K2('M','N'):
+                                       tm->tm_min += n;
+                                       set |= MINUTE;
+                                       continue;
+                               case K1('s'):
+                               case K2('s','c'):
+                               case K1('S'):
+                               case K2('S','C'):
+                                       tm->tm_sec += n;
+                                       set |= SECOND;
+                                       continue;
+                               case K2('m','s'):
+                               case K3('m','s','c'):
+                               case K4('m','s','e','c'):
+                               case K2('M','S'):
+                               case K3('M','S','C'):
+                               case K4('M','S','E','C'):
+                                       tm->tm_nsec += n * 1000000L;
+                                       continue;
+                               case K1('u'):
+                               case K2('u','s'):
+                               case K3('u','s','c'):
+                               case K4('u','s','e','c'):
+                               case K1('U'):
+                               case K2('U','S'):
+                               case K3('U','S','C'):
+                               case K4('U','S','E','C'):
+                                       tm->tm_nsec += n * 1000L;
+                                       continue;
+                               case K2('n','s'):
+                               case K3('n','s','c'):
+                               case K4('n','s','e','c'):
+                               case K2('N','S'):
+                               case K3('N','S','C'):
+                               case K4('N','S','E','C'):
+                                       tm->tm_nsec += n;
+                                       continue;
+                               }
+                               s = x;
+                       }
+                       if (n < 1000)
+                       {
+                               if ((j = tmlex(s, &t, tm_info.format, TM_NFORM, 
tm_info.format + TM_SUFFIXES, TM_PARTS - TM_SUFFIXES)) >= 0)
+                               {
+                                       s = t;
+                                       switch (tm_data.lex[j])
                                        {
-                                               state |= HOLD|NEXT;
+                                       case TM_EXACT:
+                                               state |= HOLD|EXACT;
                                                set &= ~(EXACT|LAST|NEXT|THIS);
                                                set |= state & 
(EXACT|LAST|NEXT|THIS);
                                                continue;
-                                       }
-                                       /*FALLTHROUGH*/
-                               case TM_FINAL:
-                                       state |= HOLD|THIS|FINAL;
-                                       set &= ~(EXACT|LAST|NEXT|THIS);
-                                       set |= state & 
(EXACT|LAST|NEXT|THIS|FINAL);
-                                       continue;
-                               case TM_ORDINAL:
-                                       j += TM_ORDINALS - TM_ORDINAL;
-                                       message((-1, "AHA#%d j=%d", __LINE__, 
j));
-                                       /*FALLTHROUGH*/
-                               case TM_ORDINALS:
-                                       n = j - TM_ORDINALS + 1;
-                                       message((-1, "AHA#%d n=%d", __LINE__, 
n));
-                                       goto ordinal;
-                               case TM_MERIDIAN:
-                                       if (f >= 0)
-                                               f++;
-                                       else if (state & LAST)
-                                               f = -1;
-                                       else if (state & THIS)
-                                               f = 1;
-                                       else if (state & NEXT)
-                                               f = 2;
-                                       else
-                                               f = 0;
-                                       if (n > 0)
-                                       {
-                                               if (n > 24)
-                                                       goto done;
-                                               tm->tm_hour = n;
-                                       }
-                                       for (k = tm->tm_hour; k < 0; k += 24);
-                                       k %= 24;
-                                       if (j == TM_MERIDIAN)
-                                       {
-                                               if (k == 12)
-                                                       tm->tm_hour -= 12;
-                                       }
-                                       else if (k < 12)
-                                               tm->tm_hour += 12;
-                                       if (n > 0)
-                                               goto clear_min;
-                                       continue;
-                               case TM_DAY_ABBREV:
-                                       j += TM_DAY - TM_DAY_ABBREV;
-                                       /*FALLTHROUGH*/
-                               case TM_DAY:
-                               case TM_PARTS:
-                               case TM_HOURS:
-                                       state |= set & (EXACT|LAST|NEXT|THIS);
-                                       if (!(state & (LAST|NEXT|THIS)))
-                                               for (;;)
+                                       case TM_LAST:
+                                               state |= HOLD|LAST;
+                                               set &= ~(EXACT|LAST|NEXT|THIS);
+                                               set |= state & 
(EXACT|LAST|NEXT|THIS);
+                                               continue;
+                                       case TM_THIS:
+                                               state |= HOLD|THIS;
+                                               set &= ~(EXACT|LAST|NEXT|THIS);
+                                               set |= state & 
(EXACT|LAST|NEXT|THIS);
+                                               n = 0;
+                                               continue;
+                                       case TM_NEXT:
+                                               /*
+                                                * disambiguate english "last 
... in" 
+                                                */
+
+                                               if (!((state|set) & LAST))
                                                {
-                                                       while (skip[*s])
-                                                               s++;
-                                                       if ((k = tmlex(s, &t, 
tm_info.format + TM_LAST, TM_NOISE - TM_LAST, NiL, 0)) >= 0)
+                                                       state |= HOLD|NEXT;
+                                                       set &= 
~(EXACT|LAST|NEXT|THIS);
+                                                       set |= state & 
(EXACT|LAST|NEXT|THIS);
+                                                       continue;
+                                               }
+                                               /*FALLTHROUGH*/
+                                       case TM_FINAL:
+                                               state |= HOLD|THIS|FINAL;
+                                               set &= ~(EXACT|LAST|NEXT|THIS);
+                                               set |= state & 
(EXACT|LAST|NEXT|THIS|FINAL);
+                                               continue;
+                                       case TM_WORK:
+                                               message((-1, "AHA#%d WORK", 
__LINE__));
+                                               state |= WORK;
+                                               set |= DAY;
+                                               if (state & LAST)
+                                               {
+                                                       state &= ~LAST;
+                                                       set &= ~LAST;
+                                                       state |= FINAL;
+                                                       set |= FINAL;
+                                               }
+                                               goto clear_hour;
+                                       case TM_ORDINAL:
+                                               j += TM_ORDINALS - TM_ORDINAL;
+                                               message((-1, "AHA#%d j=%d", 
__LINE__, j));
+                                               /*FALLTHROUGH*/
+                                       case TM_ORDINALS:
+                                               n = j - TM_ORDINALS + 1;
+                                               message((-1, "AHA#%d n=%d", 
__LINE__, n));
+                                               goto ordinal;
+                                       case TM_MERIDIAN:
+                                               if (f >= 0)
+                                                       f++;
+                                               else if (state & LAST)
+                                                       f = -1;
+                                               else if (state & THIS)
+                                                       f = 1;
+                                               else if (state & NEXT)
+                                                       f = 2;
+                                               else
+                                                       f = 0;
+                                               if (n > 0)
+                                               {
+                                                       if (n > 24)
+                                                               goto done;
+                                                       tm->tm_hour = n;
+                                               }
+                                               for (k = tm->tm_hour; k < 0; k 
+= 24);
+                                               k %= 24;
+                                               if (j == TM_MERIDIAN)
+                                               {
+                                                       if (k == 12)
+                                                               tm->tm_hour -= 
12;
+                                               }
+                                               else if (k < 12)
+                                                       tm->tm_hour += 12;
+                                               if (n > 0)
+                                                       goto clear_min;
+                                               continue;
+                                       case TM_DAY_ABBREV:
+                                               j += TM_DAY - TM_DAY_ABBREV;
+                                               /*FALLTHROUGH*/
+                                       case TM_DAY:
+                                       case TM_PARTS:
+                                       case TM_HOURS:
+                                               state |= set & 
(EXACT|LAST|NEXT|THIS);
+                                               if (!(state & (LAST|NEXT|THIS)))
+                                                       for (;;)
                                                        {
-                                                               s = t;
-                                                               if (k <= 2)
-                                                                       state 
|= LAST;
-                                                               else if (k <= 5)
-                                                                       state 
|= THIS;
-                                                               else if (k <= 8)
-                                                                       state 
|= NEXT;
+                                                               while (skip[*s])
+                                                                       s++;
+                                                               if ((k = 
tmlex(s, &t, tm_info.format + TM_LAST, TM_NOISE - TM_LAST, NiL, 0)) >= 0)
+                                                               {
+                                                                       s = t;
+                                                                       if (k 
<= 2)
+                                                                               
state |= LAST;
+                                                                       else if 
(k <= 5)
+                                                                               
state |= THIS;
+                                                                       else if 
(k <= 8)
+                                                                               
state |= NEXT;
+                                                                       else
+                                                                               
state |= EXACT;
+                                                               }
                                                                else
-                                                                       state 
|= EXACT;
+                                                               {
+                                                                       state 
|= (n > 0) ? NEXT : THIS;
+                                                                       break;
+                                                               }
+                                                               set &= 
~(EXACT|LAST|NEXT|THIS);
+                                                               set |= state & 
(EXACT|LAST|NEXT|THIS);
                                                        }
-                                                       else
+                                               /*FALLTHROUGH*/
+                                       case TM_DAYS:
+                                               message((-1, "AHA#%d n=%d j=%d 
f=%d state=" FFMT, __LINE__, n, j, f, FLAGS(state)));
+                                               if (n == -1)
+                                               {
+                                                       /*
+                                                        * disambiguate english 
"second"
+                                                        */
+
+                                                       if (j == TM_PARTS && f 
== -1)
                                                        {
-                                                               state |= (n > 
0) ? NEXT : THIS;
-                                                               break;
+                                                               state &= 
~(LAST|NEXT|THIS|ORDINAL); /*AHA*/
+                                                               n = 2;
+                                                               goto ordinal;
                                                        }
-                                                       set &= 
~(EXACT|LAST|NEXT|THIS);
-                                                       set |= state & 
(EXACT|LAST|NEXT|THIS);
+                                                       n = 1;
                                                }
-                                       /*FALLTHROUGH*/
-                               case TM_DAYS:
-                                       message((-1, "AHA#%d n=%d j=%d f=%d 
state=%s%s%s%s|", __LINE__, n, j, f, (state & EXACT) ? "|EXACT" : "", (state & 
LAST) ? "|LAST" : "", (state & THIS) ? "|THIS" : "", (state & NEXT) ? "|NEXT" : 
""));
-                                       if (n == -1)
-                                       {
+
                                                /*
-                                                * disambiguate english "second"
+                                                * disambiguate "last" vs. { 
"previous" "final" }
                                                 */
 
-                                               if (j == TM_PARTS && f == -1)
+                                               while (isspace(*s))
+                                                       s++;
+                                               message((-1, "AHA#%d 
disambiguate LAST s='%s'", __LINE__, s));
+                                               if ((k = tmlex(s, &t, 
tm_info.format + TM_NEXT, TM_EXACT - TM_NEXT, NiL, 0)) >= 0 || (k = tmlex(s, 
&t, tm_info.format + TM_PARTS + 3, 1, NiL, 0)) >= 0)
                                                {
-                                                       state &= 
~(LAST|NEXT|THIS|ORDINAL); /*AHA*/
-                                                       n = 2;
-                                                       goto ordinal;
+                                                       s = t;
+                                                       if (state & LAST)
+                                                       {
+                                                               state &= ~LAST;
+                                                               set &= ~LAST;
+                                                               state |= FINAL;
+                                                               set |= FINAL;
+                                                               message((-1, 
"AHA#%d LAST => FINAL", __LINE__));
+                                                       }
+                                                       else
+                                                               state &= 
~(THIS|NEXT);
                                                }
-                                               n = 1;
-                                       }
-
-                                       /*
-                                        * disambiguate "last" vs. { "previous" 
"final" }
-                                        */
-
-                                       while (isspace(*s))
-                                               s++;
-                                       message((-1, "AHA#%d disambiguate LAST 
s='%s'", __LINE__, s));
-                                       if ((k = tmlex(s, &t, tm_info.format + 
TM_NEXT, TM_EXACT - TM_NEXT, NiL, 0)) >= 0)
-                                       {
-                                               s = t;
+                                               message((-1, "AHA#%d 
disambiguate LAST k=%d", __LINE__, k));
                                                if (state & LAST)
+                                                       n = -n;
+                                               else if (!(state & NEXT))
+                                                       n--;
+                                               m = (f > 0) ? f * n : n;
+                                               message((-1, "AHA#%d f=%d n=%d 
i=%d j=%d k=%d l=%d m=%d state=" FFMT, __LINE__, f, n, i, j, k, l, m, 
FLAGS(state)));
+                                               switch (j)
                                                {
-                                                       state &= ~LAST;
-                                                       set &= ~LAST;
-                                                       state |= FINAL;
-                                                       set |= FINAL;
-                                                       message((-1, "AHA#%d 
LAST => FINAL", __LINE__));
+                                               case TM_DAYS+0:
+                                                       tm->tm_mday--;
+                                                       set |= DAY;
+                                                       goto clear_hour;
+                                               case TM_DAYS+1:
+                                                       set |= DAY;
+                                                       goto clear_hour;
+                                               case TM_DAYS+2:
+                                                       tm->tm_mday++;
+                                                       set |= DAY;
+                                                       goto clear_hour;
+                                               case TM_PARTS+0:
+                                                       set |= SECOND;
+                                                       if ((m < 0 ? -m : m) > 
(365L*24L*60L*60L))
+                                                       {
+                                                               now = 
tmxtime(tm, zone) + tmxsns(m, 0);
+                                                               goto reset;
+                                                       }
+                                                       tm->tm_sec += m;
+                                                       goto clear_nsec;
+                                               case TM_PARTS+1:
+                                                       tm->tm_min += m;
+                                                       set |= MINUTE;
+                                                       goto clear_sec;
+                                               case TM_PARTS+2:
+                                                       tm->tm_hour += m;
+                                                       set |= MINUTE;
+                                                       goto clear_min;
+                                               case TM_PARTS+3:
+                                                       message((-1, "AHA#%d 
DAY m=%d n=%d%s", __LINE__, m, n, (state & LAST) ? " LAST" : ""));
+                                                       if ((state & 
(LAST|NEXT|THIS)) == LAST)
+                                                               tm->tm_mday = 
tm_data.days[tm->tm_mon] + (tm->tm_mon == 1 && tmisleapyear(tm->tm_year));
+                                                       else if (state & 
ORDINAL)
+                                                               tm->tm_mday = m 
+ 1;
+                                                       else
+                                                               tm->tm_mday += 
m;
+                                                       if (!(set & 
(FINAL|WORK)))
+                                                               set |= HOUR;
+                                                       goto clear_hour;
+                                               case TM_PARTS+4:
+                                                       tm = tmxtm(tm, 
tmxtime(tm, zone), tm->tm_zone);
+                                                       tm->tm_mday += 7 * m - 
tm->tm_wday + 1;
+                                                       set |= DAY;
+                                                       goto clear_hour;
+                                               case TM_PARTS+5:
+                                                       tm->tm_mon += m;
+                                                       set |= MONTH;
+                                                       goto clear_mday;
+                                               case TM_PARTS+6:
+                                                       tm->tm_year += m;
+                                                       goto clear_mon;
+                                               case TM_HOURS+0:
+                                                       tm->tm_mday += m;
+                                                       set |= DAY;
+                                                       goto clear_hour;
+                                               case TM_HOURS+1:
+                                                       tm->tm_mday += m;
+                                                       tm->tm_hour = 6;
+                                                       set |= HOUR;
+                                                       goto clear_min;
+                                               case TM_HOURS+2:
+                                                       tm->tm_mday += m;
+                                                       tm->tm_hour = 12;
+                                                       set |= HOUR;
+                                                       goto clear_min;
+                                               case TM_HOURS+3:
+                                                       tm->tm_mday += m;
+                                                       tm->tm_hour = 18;
+                                                       set |= HOUR;
+                                                       goto clear_min;
                                                }
-                                               else
-                                                       state &= ~(THIS|NEXT);
-                                       }
-                                       message((-1, "AHA#%d disambiguate LAST 
k=%d", __LINE__, k));
-                                       if (state & LAST)
-                                               n = -n;
-                                       else if (!(state & NEXT))
-                                               n--;
-                                       m = (f > 0) ? f * n : n;
-                                       message((-1, "AHA#%d f=%d n=%d i=%d 
j=%d k=%d l=%d m=%d state=%s%s%s%s|", __LINE__, f, n, i, j, k, l, m, (state & 
EXACT) ? "|EXACT" : "", (state & LAST) ? "|LAST" : "", (state & THIS) ? "|THIS" 
: "", (state & NEXT) ? "|NEXT" : ""));
-                                       switch (j)
-                                       {
-                                       case TM_DAYS+0:
-                                               tm->tm_mday--;
-                                               set |= DAY;
-                                               goto clear_hour;
-                                       case TM_DAYS+1:
-                                               set |= DAY;
-                                               goto clear_hour;
-                                       case TM_DAYS+2:
-                                               tm->tm_mday++;
-                                               set |= DAY;
-                                               goto clear_hour;
-                                       case TM_PARTS+0:
-                                               set |= SECOND;
-                                               if ((m < 0 ? -m : m) > 
(365L*24L*60L*60L))
+                                               if (m >= 0 && (state & ORDINAL))
+                                                       tm->tm_mday = 1;
+                                               tm = tmxtm(tm, tmxtime(tm, 
zone), tm->tm_zone);
+                                               day = j -= TM_DAY;
+                                               if (!dir)
+                                                       dir = m;
+                                               message((-1, "AHA#%d j=%d 
m=%d", __LINE__, j, m));
+                                               j -= tm->tm_wday;
+                                               message((-1, "AHA#%d mday=%d 
wday=%d day=%d dir=%d f=%d i=%d j=%d l=%d m=%d", __LINE__, tm->tm_mday, 
tm->tm_wday, day, dir, f, i, j, l, m));
+                                               if (state & (LAST|NEXT|THIS))
                                                {
-                                                       now = tmxtime(tm, zone) 
+ tmxsns(m, 0);
-                                                       goto reset;
+                                                       if (state & ORDINAL)
+                                                       {
+                                                               while 
(isspace(*s))
+                                                                       s++;
+                                                               if (isdigit(*s) 
|| tmlex(s, &t, tm_info.format, TM_DAY_ABBREV, NiL, 0) >= 0)
+                                                               {
+                                                                       state 
&= ~(LAST|NEXT|THIS);
+                                                                       goto 
clear_hour;
+                                                               }
+                                                       }
+                                                       if (j < 0)
+                                                               j += 7;
                                                }
-                                               tm->tm_sec += m;
-                                               goto clear_nsec;
-                                       case TM_PARTS+1:
-                                               tm->tm_min += m;
-                                               set |= MINUTE;
-                                               goto clear_sec;
-                                       case TM_PARTS+2:
-                                               tm->tm_hour += m;
-                                               set |= MINUTE;
-                                               goto clear_min;
-                                       case TM_PARTS+3:
-                                               tm->tm_mday += m;
-                                               if (!(set & FINAL))
-                                                       set |= HOUR;
-                                               goto clear_hour;
-                                       case TM_PARTS+4:
-                                               tm = tmxmake(tmxtime(tm, zone));
-                                               tm->tm_mday += 7 * m - 
tm->tm_wday + 1;
+                                               else if (j > 0)
+                                                       j -= 7;
+                                               message((-1, "AHA#%d day=%d 
mday=%d f=%d m=%d j=%d state=" FFMT, __LINE__, day, tm->tm_mday, f, m, j, 
FLAGS(state)));
                                                set |= DAY;
-                                               goto clear_hour;
-                                       case TM_PARTS+5:
-                                               tm->tm_mon += m;
-                                               set |= MONTH;
-                                               goto clear_mday;
-                                       case TM_PARTS+6:
-                                               tm->tm_year += m;
-                                               goto clear_mon;
-                                       case TM_HOURS+0:
-                                               tm->tm_mday += m;
-                                               set |= DAY;
-                                               goto clear_hour;
-                                       case TM_HOURS+1:
-                                               tm->tm_mday += m;
-                                               tm->tm_hour = 6;
-                                               set |= HOUR;
-                                               goto clear_min;
-                                       case TM_HOURS+2:
-                                               tm->tm_mday += m;
-                                               tm->tm_hour = 12;
-                                               set |= HOUR;
-                                               goto clear_min;
-                                       case TM_HOURS+3:
-                                               tm->tm_mday += m;
-                                               tm->tm_hour = 18;
-                                               set |= HOUR;
-                                               goto clear_min;
-                                       }
-                                       if (m >= 0 && (state & ORDINAL))
-                                               tm->tm_mday = 1;
-                                       tm = tmxmake(tmxtime(tm, zone));
-                                       day = j -= TM_DAY;
-                                       dir = m;
-                                       message((-1, "AHA#%d j=%d m=%d", 
__LINE__, j, m));
-                                       j -= tm->tm_wday;
-                                       message((-1, "AHA#%d mday=%d wday=%d 
day=%d dir=%d f=%d i=%d j=%d l=%d m=%d", __LINE__, tm->tm_mday, tm->tm_wday, 
day, dir, f, i, j, l, m));
-                                       if (state & (LAST|NEXT|THIS))
-                                       {
-                                               if (state & ORDINAL)
+                                               if (set & (FINAL|WORK))
+                                                       goto clear_hour;
+                                               else if (state & 
(LAST|NEXT|THIS))
                                                {
-                                                       while (isspace(*s))
+                                                       if (f >= 0)
+                                                               day = -1;
+                                                       else if (m > 0 && 
(state & (NEXT|YEAR|MONTH)) == NEXT && j >= 0)
+                                                               m--;
+                                                       tm->tm_mday += j + m * 
7;
+                                                       set &= 
~(LAST|NEXT|THIS|ORDINAL); /*AHA*/
+                                                       state &= 
~(LAST|NEXT|THIS|ORDINAL); /*AHA*/
+                                                       if (!(state & EXACT))
+                                                               goto clear_hour;
+                                               }
+                                               continue;
+                                       case TM_MONTH_ABBREV:
+                                               j += TM_MONTH - TM_MONTH_ABBREV;
+                                               /*FALLTHROUGH*/
+                                       case TM_MONTH:
+                                               if (state & MONTH)
+                                                       goto done;
+                                               state |= MONTH;
+                                               i = tm->tm_mon;
+                                               tm->tm_mon = j - TM_MONTH;
+                                               if (n < 0)
+                                               {
+                                                       while (skip[*s])
                                                                s++;
-                                                       if (isdigit(*s) || 
tmlex(s, &t, tm_info.format, TM_DAY_ABBREV, NiL, 0) >= 0)
+                                                       if (isdigit(*s))
                                                        {
-                                                               state &= 
~(LAST|NEXT|THIS);
-                                                               goto clear_hour;
+                                                               n = strtol(s, 
&t, 10);
+                                                               if (n <= 31 && 
*t != ':')
+                                                                       s = t;
+                                                               else
+                                                                       n = -1;
                                                        }
                                                }
-                                               if (j < 0)
-                                                       j += 7;
-                                       }
-                                       else if (j > 0)
-                                               j -= 7;
-                                       message((-1, "AHA#%d day=%d mday=%d 
f=%d m=%d j=%d state=%s%s%s%s|", __LINE__, day, tm->tm_mday, f, m, j, (state & 
EXACT) ? "|EXACT" : "", (state & LAST) ? "|LAST" : "", (state & THIS) ? "|THIS" 
: "", (state & NEXT) ? "|NEXT" : ""));
-                                       set |= DAY;
-                                       if (set & FINAL)
-                                               goto clear_hour;
-                                       else if (state & (LAST|NEXT|THIS))
-                                       {
-                                               if (f >= 0)
-                                                       day = -1;
-                                               else if (m > 0 && (state & 
(NEXT|YEAR|MONTH)) == NEXT && j >= 0)
-                                                       m--;
-                                               tm->tm_mday += j + m * 7;
-                                               set &= 
~(LAST|NEXT|THIS|ORDINAL); /*AHA*/
-                                               state &= 
~(LAST|NEXT|THIS|ORDINAL); /*AHA*/
-                                               if (!(state & EXACT))
-                                                       goto clear_hour;
-                                       }
-                                       continue;
-                               case TM_MONTH_ABBREV:
-                                       j += TM_MONTH - TM_MONTH_ABBREV;
-                                       /*FALLTHROUGH*/
-                               case TM_MONTH:
-                                       if (state & MONTH)
-                                               goto done;
-                                       state |= MONTH;
-                                       i = tm->tm_mon;
-                                       tm->tm_mon = j - TM_MONTH;
-                                       if (n < 0)
-                                       {
-                                               while (skip[*s])
-                                                       s++;
-                                               if (isdigit(*s))
+                                               if (n >= 0)
                                                {
-                                                       n = strtol(s, &t, 10);
-                                                       if (n <= 31 && *t != 
':')
-                                                               s = t;
-                                                       else
-                                                               n = -1;
+                                                       if (n > 31)
+                                                               goto done;
+                                                       state |= DAY|MDAY;
+                                                       tm->tm_mday = n;
+                                                       if (f > 0)
+                                                               tm->tm_year += 
f;
                                                }
-                                       }
-                                       if (n >= 0)
-                                       {
-                                               if (n > 31)
+                                               if (state & (LAST|NEXT|THIS))
+                                               {
+                                                       n = i;
+                                                       goto rel_month;
+                                               }
+                                               continue;
+                                       case TM_UT:
+                                               if (state & ZONE)
                                                        goto done;
-                                               state |= DAY|MDAY;
-                                               tm->tm_mday = n;
-                                               if (f > 0)
-                                                       tm->tm_year += f;
+                                               state |= ZONE;
+                                               zone = tmgoff(s, &t, 0);
+                                               s = t;
+                                               continue;
+                                       case TM_DT:
+                                               if (!dst)
+                                                       goto done;
+                                               if (!(state & ZONE))
+                                               {
+                                                       dst = tm->tm_zone->dst;
+                                                       zone = 
tm->tm_zone->west;
+                                               }
+                                               zone += tmgoff(s, &t, dst);
+                                               s = t;
+                                               dst = 0;
+                                               state |= ZONE;
+                                               continue;
+                                       case TM_NOISE:
+                                               continue;
                                        }
-                                       if (state & (LAST|NEXT|THIS))
-                                       {
-                                               n = i;
-                                               goto rel_month;
-                                       }
-                                       continue;
-                               case TM_UT:
-                                       if (state & ZONE)
-                                               goto done;
-                                       state |= ZONE;
-                                       zone = tmgoff(s, &t, 0);
+                               }
+                               if (!(state & ZONE) && (zp = tmzone(s, &t, 
type, &dst)))
+                               {
                                        s = t;
-                                       continue;
-                               case TM_DT:
-                                       if (!dst)
-                                               goto done;
-                                       if (!(state & ZONE))
-                                       {
-                                               dst = tm_info.zone->dst;
-                                               zone = tm_info.zone->west;
-                                       }
-                                       zone += tmgoff(s, &t, dst);
-                                       s = t;
-                                       dst = 0;
+                                       zone = zp->west + dst;
+                                       tm_info.date = zp;
                                        state |= ZONE;
-                                       continue;
-                               case TM_NOISE:
-                                       continue;
+                                       if (n < 0)
+                                               continue;
                                }
+                               else if (!type && (zp = tmtype(s, &t)))
+                               {
+                                       s = t;
+                                       type = zp->type;
+                                       if (n < 0)
+                                               continue;
+                               }
+                               state |= BREAK;
                        }
-                       if (!(state & ZONE) && (zp = tmzone(s, &t, type, &dst)))
-                       {
-                               s = t;
-                               zone = zp->west + dst;
-                               tm_info.date = zp;
-                               state |= ZONE;
-                               if (n < 0)
-                                       continue;
-                       }
-                       else if (!type && (zp = tmtype(s, &t)))
-                       {
-                               s = t;
-                               type = zp->type;
-                               if (n < 0)
-                                       continue;
-                       }
-                       state |= BREAK;
                }
                else if (*s == '/')
                {
-                       if (!(state & (YEAR|MONTH)) && n >= 1900 && n < 3000 && 
(i = strtol(s + 1, &t, 10)) > 0 && i <= 12)
+                       if (!(state & (YEAR|MONTH)) && n >= 1969 && n < 3000 && 
(i = strtol(s + 1, &t, 10)) > 0 && i <= 12)
                        {
                                state |= YEAR;
                                tm->tm_year = n - 1900;
@@ -1216,7 +1613,7 @@
                        break;
                if (w == 4)
                {
-                       if ((state & YEAR) || n < 1900 || n >= 3000)
+                       if ((state & YEAR) || n < 1969 || n >= 3000)
                                break;
                        state |= YEAR;
                        tm->tm_year = n - 1900;
@@ -1288,13 +1685,13 @@
  done:
        if (day >= 0 && !(state & (MDAY|WDAY)))
        {
-               message((-1, "AHA#%d day=%d dir=%d%s", __LINE__, day, dir, 
(state & FINAL) ? " FINAL" : ""));
+               message((-1, "AHA#%d day=%d dir=%d state=" FFMT, __LINE__, day, 
dir, FLAGS(state)));
                m = dir;
                if (state & MONTH)
                        tm->tm_mday = 1;
                else if (m < 0)
                        m++;
-               tm = tmxmake(tmxtime(tm, zone));
+               tm = tmxtm(tm, tmxtime(tm, zone), tm->tm_zone);
                j = day - tm->tm_wday;
                if (j < 0)
                        j += 7;
@@ -1304,7 +1701,25 @@
        }
        else if (day < 0 && (state & FINAL) && (set & DAY))
                tm->tm_mday = tm_data.days[tm->tm_mon] + (tm->tm_mon == 1 && 
tmisleapyear(tm->tm_year));
+       if (state & WORK)
+       {
+               tm->tm_mday = (set & FINAL) ? (tm_data.days[tm->tm_mon] + 
(tm->tm_mon == 1 && tmisleapyear(tm->tm_year))) : 1;
+               tmfix(tm);
+               message((-1, "AHA#%d WORK mday=%d wday=%d", __LINE__, 
tm->tm_mday, tm->tm_wday));
+               if (tm->tm_wday == 0 && (j = 1) || tm->tm_wday == 6 && (j = 2))
+               {
+                       if ((tm->tm_mday + j) > (tm_data.days[tm->tm_mon] + 
(tm->tm_mon == 1 && tmisleapyear(tm->tm_year))))
+                               j -= 3;
+                       tm->tm_mday += j;
+               }
+       }
+       now = tmxtime(tm, zone);
+       if (tm->tm_year <= 70 && tmxsec(now) > 31536000)
+       {
+               now = 0;
+               last = (char*)o;
+       }
        if (e)
                *e = last;
-       return tmxtime(tm, zone);
+       return now;
 }
--- /dev/null   Fri Sep 25 05:58:30 2009
+++ new/usr/src/lib/libast/common/tm/tmxduration.c      Fri Sep 25 05:58:29 2009
@@ -0,0 +1,81 @@
+/***********************************************************************
+*                                                                      *
+*               This software is part of the ast package               *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
+*                      and is licensed under the                       *
+*                  Common Public License, Version 1.0                  *
+*                    by AT&T Intellectual Property                     *
+*                                                                      *
+*                A copy of the License is available at                 *
+*            http://www.opensource.org/licenses/cpl1.0.txt             *
+*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
+*                                                                      *
+*              Information and Software Systems Research               *
+*                            AT&T Research                             *
+*                           Florham Park NJ                            *
+*                                                                      *
+*                 Glenn Fowler <gsf at research.att.com>                  *
+*                  David Korn <dgk at research.att.com>                   *
+*                   Phong Vo <kpv at research.att.com>                    *
+*                                                                      *
+***********************************************************************/
+#pragma prototyped
+
+#include <tmx.h>
+#include <ctype.h>
+
+/*
+ * parse duration expression in s and return Time_t value
+ * if non-null, e points to the first unused char in s
+ * returns 0 with *e==s on error
+ */
+
+Time_t
+tmxduration(const char* s, char** e)
+{
+       double          d;
+       Time_t          ns;
+       Time_t          ts;
+       Time_t          now;
+       char*           last;
+       char*           t;
+       char*           x;
+       Sfio_t*         f;
+       int             i;
+
+       now = TMX_NOW;
+       while (isspace(*s))
+               s++;
+       if (*s == 'P' || *s == 'p')
+               ns = tmxdate(s, &last, now) - now;
+       else
+       {
+               ns = strtod(s, &last) * TMX_RESOLUTION;
+               if (*last && (f = sfstropen()))
+               {
+                       sfprintf(f, "exact %s", s);
+                       t = sfstruse(f);
+                       ts = tmxdate(t, &x, now);
+                       if ((i = x - t - 6) > (last - s))
+                       {
+                               last = (char*)s + i;
+                               ns = ts - now;
+                       }
+                       else
+                       {
+                               sfprintf(f, "p%s", s);
+                               t = sfstruse(f);
+                               ts = tmxdate(t, &x, now);
+                               if ((i = x - t - 1) > (last - s))
+                               {
+                                       last = (char*)s + i;
+                                       ns = ts - now;
+                               }
+                       }
+                       sfstrclose(f);
+               }
+       }
+       if (e)
+               *e = last;
+       return ns;
+}
--- old/usr/src/lib/libast/common/tm/tmxfmt.c   Fri Sep 25 05:58:33 2009
+++ new/usr/src/lib/libast/common/tm/tmxfmt.c   Fri Sep 25 05:58:31 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -104,22 +104,26 @@
        int             c;
        int             i;
        int             flags;
+       int             alt;
        int             pad;
        int             delimiter;
        int             width;
        int             prec;
        int             parts;
+       char*           arg;
        char*           f;
        const char*     oformat;
-       Tm_t*           tp;
+       Tm_t*           tm;
        Tm_zone_t*      zp;
        Time_t          now;
        Stack_t*        sp;
        Stack_t         stack[8];
+       Tm_t            ts;
+       char            argbuf[256];
        char            fmt[32];
 
        tmlocale();
-       tp = tmxmake(t);
+       tm = tmxtm(&ts, t, NiL);
        if (!format || !*format)
                format = tm_info.deformat;
        oformat = format;
@@ -146,6 +150,8 @@
                                *cp++ = c;
                        continue;
                }
+               alt = 0;
+               arg = 0;
                pad = 0;
                width = 0;
                prec = 0;
@@ -162,6 +168,7 @@
                        case 'O':
                                if (!isalpha(*format))
                                        break;
+                               alt = c;
                                continue;
                        case '0':
                                if (!parts)
@@ -196,6 +203,26 @@
                                if (!parts++)
                                        parts++;
                                continue;
+                       case '(':
+                               i = 1;
+                               arg = argbuf;
+                               for (;;)
+                               {
+                                       if (!(c = *format++))
+                                       {
+                                               format--;
+                                               break;
+                                       }
+                                       else if (c == '(')
+                                               i++;
+                                       else if (c == ')' && !--i)
+                                               break;
+                                       else if (arg < &argbuf[sizeof(argbuf) - 
1])
+                                               *arg++ = c;
+                               }
+                               *arg = 0;
+                               arg = argbuf;
+                               continue;
                        default:
                                break;
                        }
@@ -217,38 +244,37 @@
                                format = tm_info.format[TM_DEFAULT];
                        continue;
                case 'a':       /* abbreviated day of week name */
-                       n = TM_DAY_ABBREV + tp->tm_wday;
+                       n = TM_DAY_ABBREV + tm->tm_wday;
                        goto index;
                case 'A':       /* day of week name */
-                       n = TM_DAY + tp->tm_wday;
+                       n = TM_DAY + tm->tm_wday;
                        goto index;
                case 'b':       /* abbreviated month name */
                case 'h':
-                       n = TM_MONTH_ABBREV + tp->tm_mon;
+                       n = TM_MONTH_ABBREV + tm->tm_mon;
                        goto index;
                case 'B':       /* month name */
-                       n = TM_MONTH + tp->tm_mon;
+                       n = TM_MONTH + tm->tm_mon;
                        goto index;
                case 'c':       /* `ctime(3)' date sans newline */
                        p = tm_info.format[TM_CTIME];
                        goto push;
                case 'C':       /* 2 digit century */
-                       cp = number(cp, ep, (long)(1900 + tp->tm_year) / 100, 
2, width, pad);
+                       cp = number(cp, ep, (long)(1900 + tm->tm_year) / 100, 
2, width, pad);
                        continue;
                case 'd':       /* day of month */
-                       cp = number(cp, ep, (long)tp->tm_mday, 2, width, pad);
+                       cp = number(cp, ep, (long)tm->tm_mday, 2, width, pad);
                        continue;
                case 'D':       /* date */
                        p = tm_info.format[TM_DATE];
                        goto push;
                case 'E':       /* OBSOLETE no pad day of month */
-                       cp = number(cp, ep, (long)tp->tm_mday, 0, width, pad);
+                       cp = number(cp, ep, (long)tm->tm_mday, 0, width, pad);
                        continue;
                case 'e':       /* blank padded day of month */
-                       cp = number(cp, ep, (long)tp->tm_mday, -2, width, pad);
+                       cp = number(cp, ep, (long)tm->tm_mday, -2, width, pad);
                        continue;
                case 'f':       /* TM_DEFAULT override */
-               case 'o':       /* OBSOLETE */
                        p = tm_info.deformat;
                        goto push;
                case 'F':       /* ISO 8601:2000 standard date format */
@@ -256,15 +282,15 @@
                        goto push;
                case 'g':       /* %V 2 digit year */
                case 'G':       /* %V 4 digit year */
-                       n = tp->tm_year + 1900;
-                       if (tp->tm_yday < 7)
+                       n = tm->tm_year + 1900;
+                       if (tm->tm_yday < 7)
                        {
-                               if (tmweek(tp, 2, -1, -1) >= 52)
+                               if (tmweek(tm, 2, -1, -1) >= 52)
                                        n--;
                        }
-                       else if (tp->tm_yday > 358)
+                       else if (tm->tm_yday > 358)
                        {
-                               if (tmweek(tp, 2, -1, -1) <= 1)
+                               if (tmweek(tm, 2, -1, -1) <= 1)
                                        n++;
                        }
                        if (c == 'g')
@@ -277,27 +303,38 @@
                        cp = number(cp, ep, (long)n, c, width, pad);
                        continue;
                case 'H':       /* hour (0 - 23) */
-                       cp = number(cp, ep, (long)tp->tm_hour, 2, width, pad);
+                       cp = number(cp, ep, (long)tm->tm_hour, 2, width, pad);
                        continue;
                case 'i':       /* international `date(1)' date */
                        p = tm_info.format[TM_INTERNATIONAL];
                        goto push;
                case 'I':       /* hour (0 - 12) */
-                       if ((n = tp->tm_hour) > 12) n -= 12;
+                       if ((n = tm->tm_hour) > 12) n -= 12;
                        else if (n == 0) n = 12;
                        cp = number(cp, ep, (long)n, 2, width, pad);
                        continue;
                case 'J':       /* Julian date (0 offset) */
-                       cp = number(cp, ep, (long)tp->tm_yday, 3, width, pad);
+                       cp = number(cp, ep, (long)tm->tm_yday, 3, width, pad);
                        continue;
                case 'j':       /* Julian date (1 offset) */
-                       cp = number(cp, ep, (long)(tp->tm_yday + 1), 3, width, 
pad);
+                       cp = number(cp, ep, (long)(tm->tm_yday + 1), 3, width, 
pad);
                        continue;
                case 'k':       /* `date(1)' date */
                        p = tm_info.format[TM_DATE_1];
                        goto push;
                case 'K':
-                       p = "%Y-%m-%d+%H:%M:%S";
+                       switch (alt)
+                       {
+                       case 'E':
+                               p = (pad == '_') ? "%Y-%m-%d %H:%M:%S.%N %z" : 
"%Y-%m-%d+%H:%M:%S.%N%z";
+                               break;
+                       case 'O':
+                               p = (pad == '_') ? "%Y-%m-%d %H:%M:%S.%N" : 
"%Y-%m-%d+%H:%M:%S.%N";
+                               break;
+                       default:
+                               p = (pad == '_') ? "%Y-%m-%d %H:%M:%S" : 
"%Y-%m-%d+%H:%M:%S";
+                               break;
+                       }
                        goto push;
                case 'l':       /* `ls -l' date */
                        if (t)
@@ -316,10 +353,10 @@
                        p = tm_info.format[TM_DEFAULT];
                        goto push;
                case 'm':       /* month number */
-                       cp = number(cp, ep, (long)(tp->tm_mon + 1), 2, width, 
pad);
+                       cp = number(cp, ep, (long)(tm->tm_mon + 1), 2, width, 
pad);
                        continue;
                case 'M':       /* minutes */
-                       cp = number(cp, ep, (long)tp->tm_min, 2, width, pad);
+                       cp = number(cp, ep, (long)tm->tm_min, 2, width, pad);
                        continue;
                case 'n':
                        if (cp < ep)
@@ -326,15 +363,21 @@
                                *cp++ = '\n';
                        continue;
                case 'N':       /* nanosecond part */
-                       cp = number(cp, ep, (long)tp->tm_nsec, 9, width, pad);
+                       cp = number(cp, ep, (long)tm->tm_nsec, 9, width, pad);
                        continue;
+               case 'o':       /* set options */
+                       if (arg)
+                               goto options;
+                       /*OBSOLETE*/
+                       p = tm_info.deformat;
+                       goto push;
                case 'p':       /* meridian */
-                       n = TM_MERIDIAN + (tp->tm_hour >= 12);
+                       n = TM_MERIDIAN + (tm->tm_hour >= 12);
                        goto index;
                case 'q':       /* time zone type (nation code) */
                        if (!(flags & TM_UTC))
                        {
-                               if ((zp = tm_info.zone) != tm_info.local)
+                               if ((zp = tm->tm_zone) != tm_info.local)
                                        for (; zp >= tm_data.zone; zp--)
                                                if (p = zp->type)
                                                        goto string;
@@ -393,10 +436,7 @@
                        goto push;
                case 's':       /* seconds[.nanoseconds] since the epoch */
                case '#':
-                       if (t)
-                               now = t;
-                       else
-                               now = tmxgettime();
+                       now = t;
                        f = fmt;
                        *f++ = '%';
                        if (pad == '0')
@@ -414,7 +454,7 @@
                        }
                        continue;
                case 'S':       /* seconds */
-                       cp = number(cp, ep, (long)tp->tm_sec, 2, width, pad);
+                       cp = number(cp, ep, (long)tm->tm_sec, 2, width, pad);
                        if ((flags & TM_SUBSECOND) && (format - 2) != oformat)
                        {
                                p = ".%N";
@@ -429,21 +469,21 @@
                        p = tm_info.format[TM_TIME];
                        goto push;
                case 'u':       /* weekday number [1(Monday)-7] */
-                       if (!(i = tp->tm_wday))
+                       if (!(i = tm->tm_wday))
                                i = 7;
                        cp = number(cp, ep, (long)i, 0, width, pad);
                        continue;
                case 'U':       /* week number, Sunday as first day */
-                       cp = number(cp, ep, (long)tmweek(tp, 0, -1, -1), 2, 
width, pad);
+                       cp = number(cp, ep, (long)tmweek(tm, 0, -1, -1), 2, 
width, pad);
                        continue;
                case 'V':       /* ISO week number */
-                       cp = number(cp, ep, (long)tmweek(tp, 2, -1, -1), 2, 
width, pad);
+                       cp = number(cp, ep, (long)tmweek(tm, 2, -1, -1), 2, 
width, pad);
                        continue;
                case 'W':       /* week number, Monday as first day */
-                       cp = number(cp, ep, (long)tmweek(tp, 1, -1, -1), 2, 
width, pad);
+                       cp = number(cp, ep, (long)tmweek(tm, 1, -1, -1), 2, 
width, pad);
                        continue;
                case 'w':       /* weekday number [0(Sunday)-6] */
-                       cp = number(cp, ep, (long)tp->tm_wday, 0, width, pad);
+                       cp = number(cp, ep, (long)tm->tm_wday, 0, width, pad);
                        continue;
                case 'x':
                        p = tm_info.format[TM_DATE];
@@ -452,34 +492,74 @@
                        p = tm_info.format[TM_TIME];
                        goto push;
                case 'y':       /* year in the form yy */
-                       cp = number(cp, ep, (long)(tp->tm_year % 100), 2, 
width, pad);
+                       cp = number(cp, ep, (long)(tm->tm_year % 100), 2, 
width, pad);
                        continue;
                case 'Y':       /* year in the form ccyy */
-                       cp = number(cp, ep, (long)(1900 + tp->tm_year), 4, 
width, pad);
+                       cp = number(cp, ep, (long)(1900 + tm->tm_year), 4, 
width, pad);
                        continue;
                case 'z':       /* time zone west offset */
+                       if (arg)
+                       {
+                               if ((zp = tmzone(arg, &f, 0, 0)) && !*f && 
tm->tm_zone != zp)
+                                       tm = tmxtm(tm, tmxtime(tm, 
tm->tm_zone->west + (tm->tm_isdst ? tm->tm_zone->dst : 0)), zp);
+                               continue;
+                       }
                        if ((ep - cp) >= 16)
-                               cp = tmpoff(cp, ep - cp, "", (flags & TM_UTC) ? 
0 : tm_info.zone->west - (tp->tm_isdst ? 60 : 0), 24 * 60);
+                               cp = tmpoff(cp, ep - cp, "", (flags & TM_UTC) ? 
0 : tm->tm_zone->west + (tm->tm_isdst ? tm->tm_zone->dst : 0), 24 * 60);
                        continue;
                case 'Z':       /* time zone */
-                       p = (flags & TM_UTC) ? tm_info.format[TM_UT] : 
tp->tm_isdst && tm_info.zone->daylight ? tm_info.zone->daylight : 
tm_info.zone->standard;
+                       if (arg)
+                       {
+                               if ((zp = tmzone(arg, &f, 0, 0)) && !*f && 
tm->tm_zone != zp)
+                                       tm = tmxtm(tm, tmxtime(tm, 
tm->tm_zone->west + (tm->tm_isdst ? tm->tm_zone->dst : 0)), zp);
+                               continue;
+                       }
+                       p = (flags & TM_UTC) ? tm_info.format[TM_UT] : 
tm->tm_isdst && tm->tm_zone->daylight ? tm->tm_zone->daylight : 
tm->tm_zone->standard;
                        goto string;
                case '+':       /* old %+flag */
                case '!':       /* old %!flag */
                        format--;
                        /*FALLTHROUGH*/
-               case '=':       /* %=[=][+-]flag */
-                       if (i = *format == '=')
+               case '=':       /* old %=[=][+-]flag */
+                       for (arg = argbuf; *format == '=' || *format == '-' || 
*format == '+' || *format == '!'; format++)
+                               if (arg < &argbuf[sizeof(argbuf) - 2])
+                                       *arg++ = *format;
+                       if (*arg++ = *format)
                                format++;
-                       if (*format == '+' || *format == '-' || *format == '!')
-                               c = *format++;
-                       else
-                               c = '+';
-                       switch (*format++)
+                       *arg = 0;
+                       arg = argbuf;
+                       goto options;
+               default:
+                       if (cp < ep)
+                               *cp++ = '%';
+                       if (cp < ep)
+                               *cp++ = c;
+                       continue;
+               }
+       index:
+               p = tm_info.format[n];
+       string:
+               while (cp < ep && (*cp = *p++))
+                       cp++;
+               continue;
+       options:
+               c = '+';
+               i = 0;
+               for (;;)
+               {
+                       switch (*arg++)
                        {
                        case 0:
-                               format--;
+                               n = 0;
+                               break;
+                       case '=':
+                               i = !i;
                                continue;
+                       case '+':
+                       case '-':
+                       case '!':
+                               c = *(arg - 1);
+                               continue;
                        case 'l':
                                n = TM_LEAP;
                                break;
@@ -490,47 +570,37 @@
                        case 'u':
                                n = TM_UTC;
                                break;
+                       default:
+                               continue;
                        }
-                       if (n)
-                       {
-                               /*
-                                * right, the global state stinks
-                                * but we respect its locale-like status
-                                */
+                       if (!n)
+                               break;
 
-                               if (c == '+')
+                       /*
+                        * right, the global state stinks
+                        * but we respect its locale-like status
+                        */
+
+                       if (c == '+')
+                       {
+                               if (!(flags & n))
                                {
-                                       if (!(flags & n))
-                                       {
-                                               flags |= n;
-                                               tm_info.flags |= n;
-                                               tp = tmxmake(t);
-                                               if (!i)
-                                                       tm_info.flags &= ~n;
-                                       }
-                               }
-                               else if (flags & n)
-                               {
-                                       flags &= ~n;
-                                       tm_info.flags &= ~n;
-                                       tp = tmxmake(t);
+                                       flags |= n;
+                                       tm_info.flags |= n;
+                                       tm = tmxtm(tm, t, (flags & TM_UTC) ? 
&tm_data.zone[2] : tm->tm_zone);
                                        if (!i)
-                                               tm_info.flags |= n;
+                                               tm_info.flags &= ~n;
                                }
                        }
-                       continue;
-               default:
-                       if (cp < ep)
-                               *cp++ = '%';
-                       if (cp < ep)
-                               *cp++ = c;
-                       continue;
+                       else if (flags & n)
+                       {
+                               flags &= ~n;
+                               tm_info.flags &= ~n;
+                               tm = tmxtm(tm, t, (flags & TM_UTC) ? 
&tm_data.zone[2] : tm->tm_zone);
+                               if (!i)
+                                       tm_info.flags |= n;
+                       }
                }
-       index:
-               p = tm_info.format[n];
-       string:
-               while (cp < ep && (*cp = *p++))
-                       cp++;
                continue;
        push:
                c = 0;
--- old/usr/src/lib/libast/common/tm/tmxgettime.c       Fri Sep 25 05:58:36 2009
+++ new/usr/src/lib/libast/common/tm/tmxgettime.c       Fri Sep 25 05:58:34 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tmxleap.c  Fri Sep 25 05:58:38 2009
+++ new/usr/src/lib/libast/common/tm/tmxleap.c  Fri Sep 25 05:58:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tmxmake.c  Fri Sep 25 05:58:41 2009
+++ new/usr/src/lib/libast/common/tm/tmxmake.c  Fri Sep 25 05:58:39 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -37,7 +37,7 @@
  */
 
 Tm_t*
-tmxmake(Time_t t)
+tmxtm(register Tm_t* tm, Time_t t, Tm_zone_t* zone)
 {
        register struct tm*     tp;
        register Tm_leap_t*     lp;
@@ -51,10 +51,7 @@
        Time_t                  z;
        uint32_t                i;
 #endif
-       Tm_t                    tm;
 
-       static Tm_t             ts;
-
        tmset(tm_info.zone);
        leapsec = 0;
        if ((tm_info.flags & (TM_ADJUST|TM_LEAP)) == (TM_ADJUST|TM_LEAP) && (n 
= tmxsec(t)))
@@ -68,67 +65,76 @@
                }
        }
        x = tmxsec(t);
-       if (tm_info.flags & TM_UTC)
+       if (!(tm->tm_zone = zone))
        {
-               tm.tm_zone = &tm_data.zone[2];
-               o = 0;
+               if (tm_info.flags & TM_UTC)
+                       tm->tm_zone = &tm_data.zone[2];
+               else
+                       tm->tm_zone = tm_info.zone;
        }
-       else
+       if ((o = 60 * tm->tm_zone->west) && x > o)
        {
-               tm.tm_zone = tm_info.zone;
-               o = 60 * tm.tm_zone->west;
-               if (x > o)
-               {
-                       x -= o;
-                       o = 0;
-               }
+               x -= o;
+               o = 0;
        }
 #if TMX_FLOAT
        i = x / (24 * 60 * 60);
        z = i;
        n = x - z * (24 * 60 * 60);
-       tm.tm_sec = n % 60 + leapsec;
+       tm->tm_sec = n % 60 + leapsec;
        n /= 60;
-       tm.tm_min = n % 60;
+       tm->tm_min = n % 60;
        n /= 60;
-       tm.tm_hour = n % 24;
+       tm->tm_hour = n % 24;
 #define x      i
 #else
-       tm.tm_sec = x % 60 + leapsec;
+       tm->tm_sec = x % 60 + leapsec;
        x /= 60;
-       tm.tm_min = x % 60;
+       tm->tm_min = x % 60;
        x /= 60;
-       tm.tm_hour = x % 24;
+       tm->tm_hour = x % 24;
        x /= 24;
 #endif
-       tm.tm_wday = (x + 4) % 7;
-       tm.tm_year = (400 * (x + 25202)) / 146097 + 1;
-       n = tm.tm_year - 1;
+       tm->tm_wday = (x + 4) % 7;
+       tm->tm_year = (400 * (x + 25202)) / 146097 + 1;
+       n = tm->tm_year - 1;
        x -= n * 365 + n / 4 - n / 100 + (n + (1900 - 1600)) / 400 - (1970 - 
1901) * 365 - (1970 - 1901) / 4;
-       tm.tm_mon = 0;
-       tm.tm_mday = x + 1;
-       tmfix(&tm);
+       tm->tm_mon = 0;
+       tm->tm_mday = x + 1;
+       tm->tm_nsec = tmxnsec(t);
+       tmfix(tm);
        n += 1900;
-       tm.tm_isdst = 0;
-       if (tm.tm_zone->daylight)
+       tm->tm_isdst = 0;
+       if (tm->tm_zone->daylight)
        {
-               if ((y = tmequiv(&tm) - 1900) == tm.tm_year)
+               if ((y = tmequiv(tm) - 1900) == tm->tm_year)
                        now = tmxsec(t);
                else
                {
                        Tm_t    te;
 
-                       te = tm;
+                       te = *tm;
                        te.tm_year = y;
-                       now = tmxsec(tmxtime(&te, tm.tm_zone->west));
+                       now = tmxsec(tmxtime(&te, tm->tm_zone->west));
                }
-               if ((tp = tmlocaltime(&now)) && ((tm.tm_isdst = tp->tm_isdst) 
|| o))
+               if ((tp = tmlocaltime(&now)) && ((tm->tm_isdst = tp->tm_isdst) 
|| o))
                {
-                       tm.tm_min -= o / 60 + (tm.tm_isdst ? tm.tm_zone->dst : 
0);
-                       tmfix(&tm);
+                       tm->tm_min -= o / 60 + (tm->tm_isdst ? tm->tm_zone->dst 
: 0);
+                       tmfix(tm);
                }
        }
-       tm.tm_nsec = tmxnsec(t);
-       ts = tm;
-       return &ts;
+       return tm;
+}
+
+/*
+ * return Tm_t for t
+ * time zone and leap seconds accounted for in return value
+ */
+
+Tm_t*
+tmxmake(Time_t t)
+{
+       static Tm_t             ts;
+
+       return tmxtm(&ts, t, NiL);
 }
--- old/usr/src/lib/libast/common/tm/tmxscan.c  Fri Sep 25 05:58:43 2009
+++ new/usr/src/lib/libast/common/tm/tmxscan.c  Fri Sep 25 05:58:42 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -74,6 +74,7 @@
 gen(register Tm_t* tm, register Set_t* set)
 {
        register int    n;
+       int             z;
        Time_t          t;
 
        if (set->year >= 0)
@@ -132,26 +133,32 @@
                        tm->tm_hour -= 12;
        }
        t = tmxtime(tm, set->zone);
-       tm = 0;
        if (set->yday >= 0)
        {
-               tm = tmxmake(t);
+               z = 1;
+               tm = tmxtm(tm, t, tm->tm_zone);
                tm->tm_mday += set->yday - tm->tm_yday;
        }
        else if (set->wday >= 0)
        {
-               tm = tmxmake(t);
+               z = 1;
+               tm = tmxtm(tm, t, tm->tm_zone);
                if ((n = set->wday - tm->tm_wday) < 0)
                        n += 7;
                tm->tm_mday += n;
        }
+       else
+               z = 0;
        if (set->nsec < 1000000000L)
        {
-               if (!tm)
-                       tm = tmxmake(t);
+               if (!z)
+               {
+                       z = 1;
+                       tm = tmxtm(tm, t, tm->tm_zone);
+               }
                tm->tm_nsec = set->nsec;
        }
-       return tm ? tmxtime(tm, set->zone) : t;
+       return z ? tmxtime(tm, set->zone) : t;
 }
 
 /*
@@ -175,6 +182,7 @@
        Time_t          x;
        Set_t           set;
        Tm_zone_t*      zp;
+       Tm_t            ts;
 
        char**          sp = &stack[0];
 
@@ -183,8 +191,7 @@
        b = s;
  again:
        CLEAR(set);
-       tm = tmxmake(t);
-       tm_info.date = tm_info.zone;
+       tm = tmxtm(&ts, t, NiL);
        pedantic = (flags & TM_PEDANTIC) != 0;
        for (;;)
        {
@@ -315,7 +322,7 @@
                                x = strtoul(s, &u, 0);
                                if (s == u)
                                        goto next;
-                               tm = tmxmake(tmxsns(x, 0));
+                               tm = tmxtm(tm, tmxsns(x, 0), tm->tm_zone);
                                s = u;
                                CLEAR(set);
                                continue;
--- old/usr/src/lib/libast/common/tm/tmxsettime.c       Fri Sep 25 05:58:46 2009
+++ new/usr/src/lib/libast/common/tm/tmxsettime.c       Fri Sep 25 05:58:44 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tmxsleep.c Fri Sep 25 05:58:49 2009
+++ new/usr/src/lib/libast/common/tm/tmxsleep.c Fri Sep 25 05:58:47 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tmxtime.c  Fri Sep 25 05:58:51 2009
+++ new/usr/src/lib/libast/common/tm/tmxtime.c  Fri Sep 25 05:58:49 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tmxtouch.c Fri Sep 25 05:58:54 2009
+++ new/usr/src/lib/libast/common/tm/tmxtouch.c Fri Sep 25 05:58:52 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tmzone.c   Fri Sep 25 05:58:56 2009
+++ new/usr/src/lib/libast/common/tm/tmzone.c   Fri Sep 25 05:58:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tvcmp.c    Fri Sep 25 05:58:59 2009
+++ new/usr/src/lib/libast/common/tm/tvcmp.c    Fri Sep 25 05:58:57 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tvgettime.c        Fri Sep 25 05:59:02 2009
+++ new/usr/src/lib/libast/common/tm/tvgettime.c        Fri Sep 25 05:59:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tvsettime.c        Fri Sep 25 05:59:04 2009
+++ new/usr/src/lib/libast/common/tm/tvsettime.c        Fri Sep 25 05:59:02 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tvsleep.c  Fri Sep 25 05:59:07 2009
+++ new/usr/src/lib/libast/common/tm/tvsleep.c  Fri Sep 25 05:59:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/tm/tvtouch.c  Fri Sep 25 05:59:09 2009
+++ new/usr/src/lib/libast/common/tm/tvtouch.c  Fri Sep 25 05:59:08 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/uwin/a64l.c   Fri Sep 25 05:59:12 2009
+++ new/usr/src/lib/libast/common/uwin/a64l.c   Fri Sep 25 05:59:10 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/uwin/cbrt.c   Fri Sep 25 05:59:15 2009
+++ new/usr/src/lib/libast/common/uwin/cbrt.c   Fri Sep 25 05:59:13 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/uwin/err.c    Fri Sep 25 05:59:17 2009
+++ new/usr/src/lib/libast/common/uwin/err.c    Fri Sep 25 05:59:16 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/uwin/getpass.c        Fri Sep 25 05:59:20 2009
+++ new/usr/src/lib/libast/common/uwin/getpass.c        Fri Sep 25 05:59:18 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/uwin/rand48.c Fri Sep 25 05:59:23 2009
+++ new/usr/src/lib/libast/common/uwin/rand48.c Fri Sep 25 05:59:21 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/uwin/rint.c   Fri Sep 25 05:59:25 2009
+++ new/usr/src/lib/libast/common/uwin/rint.c   Fri Sep 25 05:59:23 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vec/vecargs.c Fri Sep 25 05:59:28 2009
+++ new/usr/src/lib/libast/common/vec/vecargs.c Fri Sep 25 05:59:26 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vec/vecfile.c Fri Sep 25 05:59:30 2009
+++ new/usr/src/lib/libast/common/vec/vecfile.c Fri Sep 25 05:59:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vec/vecfree.c Fri Sep 25 05:59:33 2009
+++ new/usr/src/lib/libast/common/vec/vecfree.c Fri Sep 25 05:59:31 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vec/vecload.c Fri Sep 25 05:59:36 2009
+++ new/usr/src/lib/libast/common/vec/vecload.c Fri Sep 25 05:59:34 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vec/vecstring.c       Fri Sep 25 05:59:38 2009
+++ new/usr/src/lib/libast/common/vec/vecstring.c       Fri Sep 25 05:59:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vmalloc/malloc.c      Fri Sep 25 05:59:41 2009
+++ new/usr/src/lib/libast/common/vmalloc/malloc.c      Fri Sep 25 05:59:39 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -43,6 +43,7 @@
 #endif
 
 #include       "vmhdr.h"
+#include       <errno.h>
 
 #if _UWIN
 
@@ -555,6 +556,27 @@
        return addr;
 }
 
+#if __STD_C
+extern int posix_memalign(reg Void_t **memptr, reg size_t align, reg size_t 
size)
+#else
+extern int posix_memalign(memptr, align, size)
+reg Void_t**   memptr;
+reg size_t     align;
+reg size_t     size;
+#endif
+{
+       Void_t  *mem;
+
+       if(align == 0 || (align%sizeof(Void_t*)) != 0 || ((align-1)&align) != 0 
)
+               return EINVAL;
+
+       if(!(mem = memalign(align, size)) )
+               return ENOMEM;
+
+       *memptr = mem;
+       return 0;
+}
+
 #if __STD_C
 extern Void_t* valloc(reg size_t size)
 #else
--- old/usr/src/lib/libast/common/vmalloc/vmbest.c      Fri Sep 25 05:59:44 2009
+++ new/usr/src/lib/libast/common/vmalloc/vmbest.c      Fri Sep 25 05:59:42 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -887,7 +887,7 @@
        reg int         local, inuse;
 
 #ifdef DEBUG
-       if((local = (int)data) >= 0 && local <= 0xf)
+       if((local = (int)integralof(data)) >= 0 && local <= 0xf)
        {       int     vmassert = _Vmassert;
                _Vmassert = local ? local : vmassert ? vmassert : 
(VM_check|VM_abort);
                _vmbestcheck(vd, NIL(Block_t*));
@@ -1279,6 +1279,56 @@
 #endif
 #define BRK_FAILED     ((Void_t*)(-1))
 
+/* make sure that allocated memory are addressable */
+
+#if _PACKAGE_ast
+#include       <sig.h>
+#else
+#include       <signal.h>
+typedef void   (*Sig_handler_t)(int);
+#endif
+
+static int     Gotsegv = 0;
+
+#if __STD_C
+static void sigsegv(int sig)
+#else
+static void sigsegv(sig)
+int    sig;
+#endif
+{
+       if(sig == SIGSEGV)
+               Gotsegv = 1;
+}
+
+#if __STD_C
+static int okaddr(Void_t* addr, size_t nsize)
+#else
+static int okaddr(addr, nsize)
+Void_t*        addr;
+size_t nsize;
+#endif
+{
+       Sig_handler_t   segv;
+       int             rv;
+
+       Gotsegv = 0; /* catch segment fault */
+       segv = signal(SIGSEGV, sigsegv);
+
+       if(Gotsegv == 0)
+               rv = *((char*)addr);
+       if(Gotsegv == 0)
+               rv += *(((char*)addr)+nsize-1);
+       if(Gotsegv == 0)
+               rv = rv == 0 ? 0 : 1;
+       else    rv = -1;
+
+       signal(SIGSEGV, segv); /* restore signal catcher */
+       Gotsegv = 0;
+
+       return rv;
+}
+
 /* A discipline to get raw memory using sbrk/VirtualAlloc/mmap */
 #if __STD_C
 static Void_t* sbrkmem(Vmalloc_t* vm, Void_t* caddr,
@@ -1323,8 +1373,15 @@
                {
                        addr = (Vmuchar_t*)sbrk(0); /* old break value */
                        if(addr && addr != (Vmuchar_t*)BRK_FAILED )
+                       {
+                               if((addr+nsize) < addr)
+                                       return NIL(Void_t*);
                                if(brk(addr+nsize) == 0 ) 
-                                       return addr;
+                               {       if(okaddr(addr,nsize) >= 0)
+                                               return addr;
+                                       (void)brk(addr); /* release reserved 
address */
+                               }
+                       }
                }
 #endif /* _mem_sbrk */
 
@@ -1333,7 +1390,10 @@
                        addr = (Vmuchar_t*)mmap(0, nsize, PROT_READ|PROT_WRITE,
                                                MAP_ANON|MAP_PRIVATE, -1, 0);
                        if(addr && addr != (Vmuchar_t*)MAP_FAILED)
-                               return addr;
+                       {       if(okaddr(addr,nsize) >= 0)
+                                       return addr;
+                               (void)munmap(addr, nsize); /* release reserved 
address */
+                       }
                }
 #endif /* _mem_mmap_anon */
 
@@ -1357,8 +1417,11 @@
                        addr = (Vmuchar_t*)mmap(0, nsize, PROT_READ|PROT_WRITE,
                                                MAP_PRIVATE, mmdc->fd, 
mmdc->offset);
                        if(addr && addr != (Vmuchar_t*)MAP_FAILED)
-                       {       mmdc->offset += nsize;
-                               return addr;
+                       {       if(okaddr(addr, nsize) >= 0)
+                               {       mmdc->offset += nsize;
+                                       return addr;
+                               }
+                               (void)munmap(addr, nsize); /* release reserved 
address */
                        }
                }
 #endif /* _mem_mmap_zero */
@@ -1374,10 +1437,11 @@
                        if(!addr || addr == (Vmuchar_t*)BRK_FAILED)
                                addr = caddr;
                        else if(((Vmuchar_t*)caddr+csize) == addr) /* in 
sbrk-space */
-                       {       if(nsize > csize)
-                                       addr += nsize-csize;
-                               else    addr -= csize-nsize;
-                               return brk(addr) == 0 ? caddr : NIL(Void_t*);
+                       {       if(nsize <= csize)
+                                       addr -= csize-nsize;
+                               else if((addr += nsize-csize) < 
(Vmuchar_t*)caddr)
+                                       return NIL(Void_t*); /* wrapped around 
address */
+                               else    return brk(addr) == 0 ? caddr : 
NIL(Void_t*);
                        }
                }
 #endif /* _mem_sbrk */
--- old/usr/src/lib/libast/common/vmalloc/vmclear.c     Fri Sep 25 05:59:46 2009
+++ new/usr/src/lib/libast/common/vmalloc/vmclear.c     Fri Sep 25 05:59:45 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vmalloc/vmclose.c     Fri Sep 25 05:59:49 2009
+++ new/usr/src/lib/libast/common/vmalloc/vmclose.c     Fri Sep 25 05:59:47 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vmalloc/vmdcheap.c    Fri Sep 25 05:59:51 2009
+++ new/usr/src/lib/libast/common/vmalloc/vmdcheap.c    Fri Sep 25 05:59:50 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vmalloc/vmdebug.c     Fri Sep 25 05:59:54 2009
+++ new/usr/src/lib/libast/common/vmalloc/vmdebug.c     Fri Sep 25 05:59:52 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vmalloc/vmdisc.c      Fri Sep 25 05:59:57 2009
+++ new/usr/src/lib/libast/common/vmalloc/vmdisc.c      Fri Sep 25 05:59:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vmalloc/vmexit.c      Fri Sep 25 05:59:59 2009
+++ new/usr/src/lib/libast/common/vmalloc/vmexit.c      Fri Sep 25 05:59:58 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vmalloc/vmgetmem.c    Fri Sep 25 06:00:02 2009
+++ new/usr/src/lib/libast/common/vmalloc/vmgetmem.c    Fri Sep 25 06:00:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vmalloc/vmhdr.h       Fri Sep 25 06:00:05 2009
+++ new/usr/src/lib/libast/common/vmalloc/vmhdr.h       Fri Sep 25 06:00:03 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -157,11 +157,13 @@
 #endif /*DEBUG*/
 
 #define VMPAGESIZE     8192
+
 #if _AST_PAGESIZE > VMPAGESIZE
 #undef VMPAGESIZE
 #define VMPAGESIZE     _AST_PAGESIZE
 #endif
-#if _lib_getpagesize
+
+#if _lib_getpagesize && !defined(_AST_PAGESIZE)
 #define GETPAGESIZE(x) ((x) ? (x) : \
                         (((x)=getpagesize()) < VMPAGESIZE ? ((x)=VMPAGESIZE) : 
(x)) )
 #else
@@ -168,6 +170,12 @@
 #define GETPAGESIZE(x) ((x) = VMPAGESIZE)
 #endif
 
+#ifdef _AST_PAGESIZE
+#define VMHEAPINCR     (_Vmpagesize*1)
+#else
+#define VMHEAPINCR     (_Vmpagesize*4)
+#endif
+
 /* Blocks are allocated such that their sizes are 0%(BITS+1)
 ** This frees up enough low order bits to store state information
 */
--- old/usr/src/lib/libast/common/vmalloc/vmlast.c      Fri Sep 25 06:00:07 2009
+++ new/usr/src/lib/libast/common/vmalloc/vmlast.c      Fri Sep 25 06:00:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -153,6 +153,7 @@
 
        CLRLOCK(vd, local);
        ANNOUNCE(local, vm, VM_FREE, data, vm->disc);
+
        CLRINUSE(vd, inuse);
        return 0;
 }
--- old/usr/src/lib/libast/common/vmalloc/vmmopen.c     Fri Sep 25 06:00:10 2009
+++ new/usr/src/lib/libast/common/vmalloc/vmmopen.c     Fri Sep 25 06:00:08 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vmalloc/vmopen.c      Fri Sep 25 06:00:12 2009
+++ new/usr/src/lib/libast/common/vmalloc/vmopen.c      Fri Sep 25 06:00:11 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vmalloc/vmpool.c      Fri Sep 25 06:00:15 2009
+++ new/usr/src/lib/libast/common/vmalloc/vmpool.c      Fri Sep 25 06:00:13 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vmalloc/vmprivate.c   Fri Sep 25 06:00:18 2009
+++ new/usr/src/lib/libast/common/vmalloc/vmprivate.c   Fri Sep 25 06:00:16 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -27,7 +27,7 @@
 
 #include       "vmhdr.h"
 
-static char*   Version = "\n@(#)$Id: Vmalloc (AT&T Research) 2007-09-11 $\0\n";
+static char*   Version = "\n@(#)$Id: Vmalloc (AT&T Research) 2009-06-19 $\0\n";
 
 #if _sys_stat
 #include       <sys/stat.h>
@@ -77,7 +77,7 @@
 #endif
 
        if(vd->incr <= 0) /* this is just _Vmheap on the first call */
-               vd->incr = _Vmpagesize;
+               vd->incr = VMHEAPINCR;
 
        /* Get slightly more for administrative data */
        s = size + sizeof(Seg_t) + sizeof(Block_t) + sizeof(Head_t) + 2*ALIGN;
--- old/usr/src/lib/libast/common/vmalloc/vmprofile.c   Fri Sep 25 06:00:20 2009
+++ new/usr/src/lib/libast/common/vmalloc/vmprofile.c   Fri Sep 25 06:00:18 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vmalloc/vmregion.c    Fri Sep 25 06:00:23 2009
+++ new/usr/src/lib/libast/common/vmalloc/vmregion.c    Fri Sep 25 06:00:21 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vmalloc/vmsegment.c   Fri Sep 25 06:00:26 2009
+++ new/usr/src/lib/libast/common/vmalloc/vmsegment.c   Fri Sep 25 06:00:24 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vmalloc/vmset.c       Fri Sep 25 06:00:28 2009
+++ new/usr/src/lib/libast/common/vmalloc/vmset.c       Fri Sep 25 06:00:26 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vmalloc/vmstat.c      Fri Sep 25 06:00:31 2009
+++ new/usr/src/lib/libast/common/vmalloc/vmstat.c      Fri Sep 25 06:00:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vmalloc/vmstrdup.c    Fri Sep 25 06:00:33 2009
+++ new/usr/src/lib/libast/common/vmalloc/vmstrdup.c    Fri Sep 25 06:00:32 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vmalloc/vmtrace.c     Fri Sep 25 06:00:36 2009
+++ new/usr/src/lib/libast/common/vmalloc/vmtrace.c     Fri Sep 25 06:00:34 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/common/vmalloc/vmwalk.c      Fri Sep 25 06:00:39 2009
+++ new/usr/src/lib/libast/common/vmalloc/vmwalk.c      Fri Sep 25 06:00:37 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/align.h     Fri Sep 25 06:00:41 2009
+++ new/usr/src/lib/libast/i386/include/ast/align.h     Fri Sep 25 06:00:39 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/align.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/align.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_align_ast
 #define _def_align_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/include/ast/ast.h       Fri Sep 25 06:00:44 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast.h       Fri Sep 25 06:00:42 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -185,7 +185,7 @@
 #define mbcoll()       (ast.mb_xfrm!=0)
 #define mbwide()       (mbmax()>1)
 
-#define mbchar(p)      
(mbwide()?((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),mbmax()))>0?((p+=ast.tmp_int),ast.tmp_wchar):(p++,ast.tmp_int)):(*(unsigned
 char*)(p++)))
+#define mbchar(p)      
(mbwide()?((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),mbmax()))>0?((p+=ast.tmp_int),ast.tmp_wchar):(p+=ast.mb_sync+1,ast.tmp_int)):(*(unsigned
 char*)(p++)))
 #define mbinit()       
(mbwide()?(*ast.mb_towc)((wchar_t*)0,(char*)0,mbmax()):0)
 #define mbsize(p)      (mbwide()?(*ast.mb_len)((char*)(p),mbmax()):((p),1))
 #define mbconv(s,w)    (ast.mb_conv?(*ast.mb_conv)(s,w):((*(s)=(w)),1))
@@ -309,6 +309,7 @@
 extern __MANGLE__ char*                pathpath __PROTO__((char*, const char*, 
const char*, int));
 extern __MANGLE__ size_t               pathposix __PROTO__((const char*, 
char*, size_t));
 extern __MANGLE__ char*                pathprobe __PROTO__((char*, char*, 
const char*, const char*, const char*, int));
+extern __MANGLE__ size_t               pathprog __PROTO__((const char*, char*, 
size_t));
 extern __MANGLE__ char*                pathrepl __PROTO__((char*, const char*, 
const char*));
 extern __MANGLE__ int          pathsetlink __PROTO__((const char*, const 
char*));
 extern __MANGLE__ char*                pathshell __PROTO__((void));
@@ -329,6 +330,7 @@
 extern __MANGLE__ int          strmode __PROTO__((const char*));
 extern __MANGLE__ int          strnacmp __PROTO__((const char*, const char*, 
size_t));
 extern __MANGLE__ char*                strncopy __PROTO__((char*, const char*, 
size_t));
+extern __MANGLE__ int          strnpcmp __PROTO__((const char*, const char*, 
size_t));
 extern __MANGLE__ double               strntod __PROTO__((const char*, size_t, 
char**));
 extern __MANGLE__ _ast_fltmax_t        strntold __PROTO__((const char*, 
size_t, char**));
 extern __MANGLE__ long         strntol __PROTO__((const char*, size_t, char**, 
int));
@@ -337,7 +339,9 @@
 extern __MANGLE__ unsigned long        strntoul __PROTO__((const char*, 
size_t, char**, int));
 extern __MANGLE__ intmax_t             strntonll __PROTO__((const char*, 
size_t, char**, char*, int));
 extern __MANGLE__ uintmax_t    strntoull __PROTO__((const char*, size_t, 
char**, int));
+extern __MANGLE__ int          strnvcmp __PROTO__((const char*, const char*, 
size_t));
 extern __MANGLE__ int          stropt __PROTO__((const char*, const __V_*, 
int, int(*)(__V_*, const __V_*, int, const char*), __V_*));
+extern __MANGLE__ int          strpcmp __PROTO__((const char*, const char*));
 extern __MANGLE__ int          strperm __PROTO__((const char*, char**, int));
 extern __MANGLE__ __V_*                strpsearch __PROTO__((const __V_*, 
size_t, size_t, const char*, char**));
 extern __MANGLE__ __V_*                strsearch __PROTO__((const __V_*, 
size_t, size_t, Strcmp_f, const char*, __V_*));
@@ -350,6 +354,7 @@
 extern __MANGLE__ intmax_t             strtonll __PROTO__((const char*, 
char**, char*, int));
 extern __MANGLE__ int          struid __PROTO__((const char*));
 extern __MANGLE__ int          struniq __PROTO__((char**, int));
+extern __MANGLE__ int          strvcmp __PROTO__((const char*, const char*));
 
 #undef __MANGLE__
 #define __MANGLE__ __LINKAGE__
--- old/usr/src/lib/libast/i386/include/ast/ast_botch.h Fri Sep 25 06:00:46 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_botch.h Fri Sep 25 06:00:45 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/botch.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/botch.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_botch_ast
 #define _def_botch_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/include/ast/ast_ccode.h Fri Sep 25 06:00:49 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_ccode.h Fri Sep 25 06:00:47 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/ccode
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/ccode
 by iffe version 2009-05-01 : : */
 #ifndef _def_ccode_ast
 #define _def_ccode_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/include/ast/ast_common.h        Fri Sep 25 
06:00:52 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_common.h        Fri Sep 25 
06:00:50 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/common
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/common
 by iffe version 2009-05-01 : : */
 #ifndef _AST_COMMON_H
 #define _AST_COMMON_H  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -176,9 +176,6 @@
 #define _typ_uintmax_t 1       /* uintmax_t is a type */
 
 #ifndef va_listref
-#define va_listref(p) (p)      /* pass va_list to varargs function */
-#define va_listval(p) (p)      /* retrieve va_list from va_arg(ap,va_listarg) 
*/
-#define va_listarg va_list     /* va_arg() va_list type */
 #ifndef        va_start
 #if __STD_C
 #include <stdarg.h>
@@ -186,6 +183,9 @@
 #include <varargs.h>
 #endif
 #endif
+#define va_listref(p) (p)      /* pass va_list to varargs function */
+#define va_listval(p) (p)      /* retrieve va_list from va_arg(ap,va_listarg) 
*/
+#define va_listarg va_list     /* va_arg() va_list type */
 #endif
 #ifndef _AST_STD_H
 #      if __STD_C && _hdr_stddef
--- old/usr/src/lib/libast/i386/include/ast/ast_dir.h   Fri Sep 25 06:00:54 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_dir.h   Fri Sep 25 06:00:52 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/ast_dirent.h        Fri Sep 25 
06:00:57 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_dirent.h        Fri Sep 25 
06:00:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/dirent
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/dirent
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_dirent_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/include/ast/ast_fcntl.h Fri Sep 25 06:00:59 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_fcntl.h Fri Sep 25 06:00:58 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/fcntl.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/fcntl.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_fcntl_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/i386/include/ast/ast_float.h Fri Sep 25 06:01:02 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_float.h Fri Sep 25 06:01:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/float
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/float
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_float_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/include/ast/ast_fs.h    Fri Sep 25 06:01:05 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_fs.h    Fri Sep 25 06:01:03 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/fs
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/fs
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_fs_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/include/ast/ast_iconv.h Fri Sep 25 06:01:07 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_iconv.h Fri Sep 25 06:01:06 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/iconv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/iconv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_iconv_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/include/ast/ast_lib.h   Fri Sep 25 06:01:10 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_lib.h   Fri Sep 25 06:01:08 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/lib
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/lib
 by iffe version 2009-05-01 : : */
 #ifndef _def_lib_ast
 #define _def_lib_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/include/ast/ast_limits.h        Fri Sep 25 
06:01:13 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_limits.h        Fri Sep 25 
06:01:11 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/limits.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/limits.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_limits_ast
 #define _def_limits_ast        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/include/ast/ast_map.h   Fri Sep 25 06:01:15 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_map.h   Fri Sep 25 06:01:14 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/map.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/map.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_map_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
@@ -219,6 +219,8 @@
 #define pathposix      _ast_pathposix
 #undef pathprobe
 #define pathprobe      _ast_pathprobe
+#undef pathprog
+#define pathprog       _ast_pathprog
 #undef pathrepl
 #define pathrepl       _ast_pathrepl
 #undef pathsetlink
--- old/usr/src/lib/libast/i386/include/ast/ast_mmap.h  Fri Sep 25 06:01:18 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_mmap.h  Fri Sep 25 06:01:16 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/mmap
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/mmap
 by iffe version 2009-05-01 : : */
 #ifndef _def_mmap_ast
 #define _def_mmap_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -28,6 +28,7 @@
 #define _lib_mmap64    1       /* mmap64 interface and implementation work */
 #define _mmap_anon     1       /* use mmap MAP_ANON to get raw memory */
 #define _mmap_devzero  1       /* use mmap on /dev/zero to get raw memory */
+#define _mmap_worthy   2       /* mmap is good */
 
 /* some systems get it wrong but escape concise detection */
 #ifndef _NO_MMAP
--- old/usr/src/lib/libast/i386/include/ast/ast_mode.h  Fri Sep 25 06:01:21 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_mode.h  Fri Sep 25 06:01:19 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/mode.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/mode.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_mode_ast
 #define _def_mode_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/include/ast/ast_namval.h        Fri Sep 25 
06:01:23 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_namval.h        Fri Sep 25 
06:01:22 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/ast_ndbm.h  Fri Sep 25 06:01:26 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_ndbm.h  Fri Sep 25 06:01:24 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/ndbm
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/ndbm
 by iffe version 2009-05-01 : : */
 #ifndef _def_ndbm_ast
 #define _def_ndbm_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/include/ast/ast_nl_types.h      Fri Sep 25 
06:01:29 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_nl_types.h      Fri Sep 25 
06:01:27 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/nl_types
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/nl_types
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_nl_types_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/include/ast/ast_param.h Fri Sep 25 06:01:31 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_param.h Fri Sep 25 06:01:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/param.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/param.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_param_ast
 #define _def_param_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/include/ast/ast_standards.h     Fri Sep 25 
06:01:34 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_standards.h     Fri Sep 25 
06:01:32 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,29 +19,11 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/standards
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/standards
 by iffe version 2009-05-01 : : */
 #ifndef _def_standards_ast
 #define _def_standards_ast     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-/* _ALL_SOURCE & _ISOC99_SOURCE & _POSIX_SOURCE & _POSIX_C_SOURCE & 
_XOPEN_SOURCE & __EXTENSIONS__ works */
-#ifndef _ALL_SOURCE
-#define _ALL_SOURCE    1
-#endif
-#ifndef _ISOC99_SOURCE
-#define _ISOC99_SOURCE 1
-#endif
-#ifndef _POSIX_SOURCE
-#define _POSIX_SOURCE  1
-#endif
-#ifndef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE        21000101L
-#endif
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE  9900
-#endif
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE    1
-#endif
+/* __EXTENSIONS__ works */
 #ifndef __EXTENSIONS__
 #define __EXTENSIONS__ 1
 #endif
--- old/usr/src/lib/libast/i386/include/ast/ast_std.h   Fri Sep 25 06:01:36 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_std.h   Fri Sep 25 06:01:35 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -117,9 +117,18 @@
 #define __MANGLE__ __LINKAGE__         __EXPORT__
 #endif
 
+#if !_UWIN /* for ast54 compatibility */
+
 #undef getenv
 #define getenv         _ast_getenv
 
+#undef setenviron
+#define setenviron     _ast_setenviron
+
+extern __MANGLE__ char*                getenv __PROTO__((const char*));
+
+#endif
+
 #undef localeconv
 #define localeconv     _ast_localeconv
 
@@ -126,13 +135,9 @@
 #undef setlocale
 #define setlocale      _ast_setlocale
 
-#undef setenviron
-#define setenviron     _ast_setenviron
-
 #undef strerror
 #define strerror       _ast_strerror
 
-extern __MANGLE__ char*                getenv __PROTO__((const char*));
 extern __MANGLE__ struct lconv*        localeconv __PROTO__((void));
 extern __MANGLE__ char*                setenviron __PROTO__((const char*));
 extern __MANGLE__ char*                setlocale __PROTO__((int, const char*));
@@ -248,8 +253,9 @@
        int             (*mb_conv) __PROTO__((char*, wchar_t));
 
        uint32_t        env_serial;
+       uint32_t        mb_sync;
 
-       char            pad[944];
+       char            pad[940];
 
 } _Ast_info_t;
 
--- old/usr/src/lib/libast/i386/include/ast/ast_stdio.h Fri Sep 25 06:01:39 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_stdio.h Fri Sep 25 06:01:37 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/stdio
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/stdio
 by iffe version 2009-05-01 : : */
                   
 #ifndef _SFSTDIO_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/include/ast/ast_sys.h   Fri Sep 25 06:01:42 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_sys.h   Fri Sep 25 06:01:40 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/sys
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/sys
 by iffe version 2009-05-01 : : */
                   
 #ifndef _AST_SYS_H
 #if !defined(__PROTO__)
@@ -125,7 +125,6 @@
 #include <limits.h>
 #include <fcntl.h>
 #include <locale.h>
-#include <sys/localedef.h>
 #define _hdr_time      1       /* #include <time.h> ok */
 #define _sys_time      1       /* #include <sys/time.h> ok */
 #define _sys_times     1       /* #include <sys/times.h> ok */
--- old/usr/src/lib/libast/i386/include/ast/ast_time.h  Fri Sep 25 06:01:45 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_time.h  Fri Sep 25 06:01:43 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/time
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/time
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_time_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/include/ast/ast_tty.h   Fri Sep 25 06:01:47 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_tty.h   Fri Sep 25 06:01:45 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/tty
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/tty
 by iffe version 2009-05-01 : : */
 #ifndef _def_tty_ast
 #define _def_tty_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/include/ast/ast_version.h       Fri Sep 25 
06:01:50 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_version.h       Fri Sep 25 
06:01:48 2009
@@ -7,4 +7,4 @@
 #if !defined(__LINKAGE__)
 #define __LINKAGE__            /* 2004-08-11 transition */
 #endif
-#define _AST_VERSION   20080910L
+#define _AST_VERSION   20090202L
--- old/usr/src/lib/libast/i386/include/ast/ast_vfork.h Fri Sep 25 06:01:52 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_vfork.h Fri Sep 25 06:01:51 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/vfork
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/vfork
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_vfork_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/include/ast/ast_wait.h  Fri Sep 25 06:01:55 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_wait.h  Fri Sep 25 06:01:53 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/wait
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/wait
 by iffe version 2009-05-01 : : */
 #ifndef _def_wait_ast
 #define _def_wait_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/include/ast/ast_wchar.h Fri Sep 25 06:01:58 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_wchar.h Fri Sep 25 06:01:56 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/wchar
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/wchar
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_wchar_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/include/ast/ast_windows.h       Fri Sep 25 
06:02:00 2009
+++ new/usr/src/lib/libast/i386/include/ast/ast_windows.h       Fri Sep 25 
06:01:58 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/bytesex.h   Fri Sep 25 06:02:03 2009
+++ new/usr/src/lib/libast/i386/include/ast/bytesex.h   Fri Sep 25 06:02:01 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/ccode.h     Fri Sep 25 06:02:06 2009
+++ new/usr/src/lib/libast/i386/include/ast/ccode.h     Fri Sep 25 06:02:04 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/cdt.h       Fri Sep 25 06:02:08 2009
+++ new/usr/src/lib/libast/i386/include/ast/cdt.h       Fri Sep 25 06:02:06 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/debug.h     Fri Sep 25 06:02:11 2009
+++ new/usr/src/lib/libast/i386/include/ast/debug.h     Fri Sep 25 06:02:09 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -55,14 +55,17 @@
 #define DEBUG_ASSERT(p)                ((p) ? 0 : (debug_fatal(__FILE__, 
__LINE__),0))
 #define DEBUG_COUNT(n)         ((n) += 1)
 #define DEBUG_TALLY(c,n,v)     ((c) ? ((n) += (v)) : (n))
+#define DEBUG_INCREASE(n)      ((n) += 1)
+#define DEBUG_DECREASE(n)      ((n) -= 1)
 #define DEBUG_DECLARE(t,v)     t v
 #define DEBUG_SET(n,v)         ((n) = (v))
 #define DEBUG_PRINT(fd,s,v)    do {char 
_b[1024];write(fd,_b,sfsprintf(_b,sizeof(_b),s,v));} while(0)
 #define DEBUG_WRITE(fd,d,n)    write((fd),(d),(n))
 #define DEBUG_TEMP(temp)       (temp) /* debugging stuff that should be 
removed */
-#define DEBUG_RETURN(x)                (debug_fatal(__FILE__, __LINE__), (x))
-#define DEBUG_BREAK            (debug_fatal(__FILE__, __LINE__))
+#define DEBUG_BREAK            break
+#define DEBUG_CONTINUE         continue
 #define DEBUG_GOTO(label)      do { debug_fatal(__FILE__, __LINE__); goto 
label; } while(0)
+#define DEBUG_RETURN(x)                do { debug_fatal(__FILE__, __LINE__); 
return(x); } while(0)
 
 #else
 
@@ -75,17 +78,33 @@
 #define DEBUG_ASSERT(p)
 #define DEBUG_COUNT(n)
 #define DEBUG_TALLY(c,n,v)
+#define DEBUG_INCREASE(n)
+#define DEBUG_DECREASE(n)
 #define DEBUG_DECLARE(t,v)
 #define DEBUG_SET(n,v)
 #define DEBUG_PRINT(fd,s,v)
 #define DEBUG_WRITE(fd,d,n)
-#define DEBUG_KPV(x)
-#define DEBUG_RETURN(x)                return(x)
+#define DEBUG_TEMP(x)
 #define DEBUG_BREAK            break
+#define DEBUG_CONTINUE         continue
 #define DEBUG_GOTO(label)      goto label
+#define DEBUG_RETURN(x)                return(x)
 
 #endif
 
+#ifndef BREAK
+#define BREAK                  DEBUG_BREAK
+#endif
+#ifndef CONTINUE
+#define CONTINUE               DEBUG_CONTINUE
+#endif
+#ifndef GOTO
+#define GOTO(label)            DEBUG_GOTO(label)
+#endif
+#ifndef RETURN
+#define RETURN(x)              DEBUG_RETURN(x)
+#endif
+
 #if _BLD_ast && defined(__EXPORT__)
 #undef __MANGLE__
 #define __MANGLE__ __LINKAGE__         __EXPORT__
--- old/usr/src/lib/libast/i386/include/ast/dirent.h    Fri Sep 25 06:02:13 2009
+++ new/usr/src/lib/libast/i386/include/ast/dirent.h    Fri Sep 25 06:02:12 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/dt.h        Fri Sep 25 06:02:16 2009
+++ new/usr/src/lib/libast/i386/include/ast/dt.h        Fri Sep 25 06:02:14 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/endian.h    Fri Sep 25 06:02:19 2009
+++ new/usr/src/lib/libast/i386/include/ast/endian.h    Fri Sep 25 06:02:17 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/error.h     Fri Sep 25 06:02:21 2009
+++ new/usr/src/lib/libast/i386/include/ast/error.h     Fri Sep 25 06:02:19 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/find.h      Fri Sep 25 06:02:24 2009
+++ new/usr/src/lib/libast/i386/include/ast/find.h      Fri Sep 25 06:02:22 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/fnmatch.h   Fri Sep 25 06:02:26 2009
+++ new/usr/src/lib/libast/i386/include/ast/fnmatch.h   Fri Sep 25 06:02:25 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/fnv.h       Fri Sep 25 06:02:29 2009
+++ new/usr/src/lib/libast/i386/include/ast/fnv.h       Fri Sep 25 06:02:27 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/fs3d.h      Fri Sep 25 06:02:32 2009
+++ new/usr/src/lib/libast/i386/include/ast/fs3d.h      Fri Sep 25 06:02:30 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -104,7 +104,9 @@
 #define FS3D_SIZE(n)   ((n)<<4)
 #define FS3D_SIZEOF(n) ((n)>>4)
 
-extern __MANGLE__ int          mount __PROTO__((const char*, char*, int, 
__V_*));
+#if !_BLD_3d
+#define mount(s,t,f,d) fs3d_mount(s,t,f,d)
+#endif
 
 #if _BLD_ast && defined(__EXPORT__)
 #undef __MANGLE__
@@ -112,6 +114,7 @@
 #endif
 
 extern __MANGLE__ int          fs3d __PROTO__((int));
+extern __MANGLE__ int          fs3d_mount __PROTO__((const char*, char*, int, 
__V_*));
 extern __MANGLE__ char*                pathnext __PROTO__((char*, char*, 
long*));
 
 #undef __MANGLE__
--- old/usr/src/lib/libast/i386/include/ast/fts.h       Fri Sep 25 06:02:34 2009
+++ new/usr/src/lib/libast/i386/include/ast/fts.h       Fri Sep 25 06:02:32 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/ftw.h       Fri Sep 25 06:02:37 2009
+++ new/usr/src/lib/libast/i386/include/ast/ftw.h       Fri Sep 25 06:02:35 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/ftwalk.h    Fri Sep 25 06:02:40 2009
+++ new/usr/src/lib/libast/i386/include/ast/ftwalk.h    Fri Sep 25 06:02:38 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/glob.h      Fri Sep 25 06:02:42 2009
+++ new/usr/src/lib/libast/i386/include/ast/glob.h      Fri Sep 25 06:02:40 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/hash.h      Fri Sep 25 06:02:45 2009
+++ new/usr/src/lib/libast/i386/include/ast/hash.h      Fri Sep 25 06:02:43 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/hashkey.h   Fri Sep 25 06:02:48 2009
+++ new/usr/src/lib/libast/i386/include/ast/hashkey.h   Fri Sep 25 06:02:46 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/hashpart.h  Fri Sep 25 06:02:50 2009
+++ new/usr/src/lib/libast/i386/include/ast/hashpart.h  Fri Sep 25 06:02:48 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/iconv.h     Fri Sep 25 06:02:53 2009
+++ new/usr/src/lib/libast/i386/include/ast/iconv.h     Fri Sep 25 06:02:51 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/lc.h        Fri Sep 25 06:02:55 2009
+++ new/usr/src/lib/libast/i386/include/ast/lc.h        Fri Sep 25 06:02:54 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -38,14 +38,15 @@
 
 #define LC_abbreviated         0x00001
 #define LC_checked             0x00002
-#define LC_default             0x00004
-#define LC_defined             0x00008
-#define LC_debug               0x00010
+#define LC_debug               0x00004
+#define LC_default             0x00008
+#define LC_defined             0x00010
 #define LC_local               0x00020
 #define LC_primary             0x00040
 #define LC_qualified           0x00080
 #define LC_undefined           0x00100
-#define LC_verbose             0x00200
+#define LC_utf8                        0x00200
+#define LC_verbose             0x00400
 #define LC_user                        0x10000
 #define LC_language_attribute_max              2
 #define LC_territory_language_max              4
--- old/usr/src/lib/libast/i386/include/ast/ls.h        Fri Sep 25 06:02:58 2009
+++ new/usr/src/lib/libast/i386/include/ast/ls.h        Fri Sep 25 06:02:56 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -76,8 +76,8 @@
 #define LS_USER                (1<<10)         /* first user flag bit          
*/
 
 #define LS_W_BLOCKS    6               /* LS_BLOCKS field width        */
-#define LS_W_INUMBER   7               /* LS_INUMBER field width       */
-#define LS_W_LONG      55              /* LS_LONG width (w/o names)    */
+#define LS_W_INUMBER   9               /* LS_INUMBER field width       */
+#define LS_W_LONG      57              /* LS_LONG width (w/o names)    */
 #define LS_W_LINK      4               /* link text width (w/o names)  */
 #define LS_W_MARK      1               /* LS_MARK field width          */
 #define LS_W_NAME      9               /* group|user name field width  */
--- old/usr/src/lib/libast/i386/include/ast/magic.h     Fri Sep 25 06:03:01 2009
+++ new/usr/src/lib/libast/i386/include/ast/magic.h     Fri Sep 25 06:02:59 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/magicid.h   Fri Sep 25 06:03:03 2009
+++ new/usr/src/lib/libast/i386/include/ast/magicid.h   Fri Sep 25 06:03:01 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/mc.h        Fri Sep 25 06:03:06 2009
+++ new/usr/src/lib/libast/i386/include/ast/mc.h        Fri Sep 25 06:03:04 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/mime.h      Fri Sep 25 06:03:09 2009
+++ new/usr/src/lib/libast/i386/include/ast/mime.h      Fri Sep 25 06:03:07 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/mnt.h       Fri Sep 25 06:03:11 2009
+++ new/usr/src/lib/libast/i386/include/ast/mnt.h       Fri Sep 25 06:03:09 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/modecanon.h Fri Sep 25 06:03:14 2009
+++ new/usr/src/lib/libast/i386/include/ast/modecanon.h Fri Sep 25 06:03:12 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/modex.h     Fri Sep 25 06:03:16 2009
+++ new/usr/src/lib/libast/i386/include/ast/modex.h     Fri Sep 25 06:03:15 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/namval.h    Fri Sep 25 06:03:19 2009
+++ new/usr/src/lib/libast/i386/include/ast/namval.h    Fri Sep 25 06:03:17 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/nl_types.h  Fri Sep 25 06:03:22 2009
+++ new/usr/src/lib/libast/i386/include/ast/nl_types.h  Fri Sep 25 06:03:20 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/option.h    Fri Sep 25 06:03:24 2009
+++ new/usr/src/lib/libast/i386/include/ast/option.h    Fri Sep 25 06:03:22 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/preroot.h   Fri Sep 25 06:03:27 2009
+++ new/usr/src/lib/libast/i386/include/ast/preroot.h   Fri Sep 25 06:03:25 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/preroot.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/preroot.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_preroot_ast
 #define _def_preroot_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/include/ast/proc.h      Fri Sep 25 06:03:30 2009
+++ new/usr/src/lib/libast/i386/include/ast/proc.h      Fri Sep 25 06:03:28 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/re_comp.h   Fri Sep 25 06:03:32 2009
+++ new/usr/src/lib/libast/i386/include/ast/re_comp.h   Fri Sep 25 06:03:30 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/recfmt.h    Fri Sep 25 06:03:35 2009
+++ new/usr/src/lib/libast/i386/include/ast/recfmt.h    Fri Sep 25 06:03:33 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/regex.h     Fri Sep 25 06:03:37 2009
+++ new/usr/src/lib/libast/i386/include/ast/regex.h     Fri Sep 25 06:03:36 2009
@@ -53,6 +53,8 @@
 #define REG_SHELL_ESCAPED 0x00400000   /* \ not special                */
 #define REG_SHELL_PATH 0x00800000      /* explicit / match             */
 
+#define REG_REGEXP     0x40000000      /* <regexp.h> compatibility     */
+
 /* regexec flags */
 
 #define REG_NOTBOL     0x00000040      /* ^ is not a special char      */
--- old/usr/src/lib/libast/i386/include/ast/regexp.h    Fri Sep 25 06:03:40 2009
+++ new/usr/src/lib/libast/i386/include/ast/regexp.h    Fri Sep 25 06:03:38 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/sfdisc.h    Fri Sep 25 06:03:43 2009
+++ new/usr/src/lib/libast/i386/include/ast/sfdisc.h    Fri Sep 25 06:03:41 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/sfio.h      Fri Sep 25 06:03:45 2009
+++ new/usr/src/lib/libast/i386/include/ast/sfio.h      Fri Sep 25 06:03:43 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/sfio_s.h    Fri Sep 25 06:03:48 2009
+++ new/usr/src/lib/libast/i386/include/ast/sfio_s.h    Fri Sep 25 06:03:46 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/sfio_t.h    Fri Sep 25 06:03:51 2009
+++ new/usr/src/lib/libast/i386/include/ast/sfio_t.h    Fri Sep 25 06:03:49 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/shcmd.h     Fri Sep 25 06:03:53 2009
+++ new/usr/src/lib/libast/i386/include/ast/shcmd.h     Fri Sep 25 06:03:51 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -75,18 +75,19 @@
 #   undef Shell_t
 #   undef Namval_t
 #else 
-#   define sh_run(c, ac, av)   ((c)?(*((Shbltin_t*)(c))->shrun)(ac,av):-1)
-#   define sh_system(c,str)    
((c)?(*((Shbltin_t*)(c))->shtrap)(str,0):system(str))
-#   define sh_exit(c,n)                
((c)?(*((Shbltin_t*)(c))->shexit)(n):exit(n))
-#   define sh_checksig(c)      ((c) && ((Shbltin_t*)(c))->sigset)
+#   define sh_context(c)       ((Shbltin_t*)(c))
+#   define sh_run(c, ac, av)   ((c)?(*sh_context(c)->shrun)(ac,av):-1)
+#   define sh_system(c,str)    
((c)?(*sh_context(c)->shtrap)(str,0):system(str))
+#   define sh_exit(c,n)                
((c)?(*sh_context(c)->shexit)(n):exit(n))
+#   define sh_checksig(c)      ((c) && sh_context(c)->sigset)
 #   if defined(SFIO_VERSION) || defined(_AST_H)
 #      define LIB_INIT(c)
 #   else
-#      define LIB_INIT(c)      ((c) && (((Shbltin_t*)(c))->nosfio = 1))
+#      define LIB_INIT(c)      ((c) && (sh_context(c)->nosfio = 1))
 #   endif
 #   ifndef _CMD_H
 #      define cmdinit(ac,av,c,cat,flg)         do { if((ac)<=0) return(0); \
-           (((Shbltin_t*)(c))->notify = ((flg)&ERROR_NOTIFY)?1:0);} while(0)
+           (sh_context(c)->notify = ((flg)&ERROR_NOTIFY)?1:0);} while(0)
 #   endif
 #endif
 
--- old/usr/src/lib/libast/i386/include/ast/sig.h       Fri Sep 25 06:03:56 2009
+++ new/usr/src/lib/libast/i386/include/ast/sig.h       Fri Sep 25 06:03:54 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/sig.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/sig.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_sig_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/i386/include/ast/stack.h     Fri Sep 25 06:03:59 2009
+++ new/usr/src/lib/libast/i386/include/ast/stack.h     Fri Sep 25 06:03:57 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/stak.h      Fri Sep 25 06:04:01 2009
+++ new/usr/src/lib/libast/i386/include/ast/stak.h      Fri Sep 25 06:03:59 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/stdio.h     Fri Sep 25 06:04:04 2009
+++ new/usr/src/lib/libast/i386/include/ast/stdio.h     Fri Sep 25 06:04:02 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/stk.h       Fri Sep 25 06:04:06 2009
+++ new/usr/src/lib/libast/i386/include/ast/stk.h       Fri Sep 25 06:04:05 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/swap.h      Fri Sep 25 06:04:09 2009
+++ new/usr/src/lib/libast/i386/include/ast/swap.h      Fri Sep 25 06:04:07 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/tar.h       Fri Sep 25 06:04:12 2009
+++ new/usr/src/lib/libast/i386/include/ast/tar.h       Fri Sep 25 06:04:10 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/times.h     Fri Sep 25 06:04:14 2009
+++ new/usr/src/lib/libast/i386/include/ast/times.h     Fri Sep 25 06:04:12 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/tm.h        Fri Sep 25 06:04:17 2009
+++ new/usr/src/lib/libast/i386/include/ast/tm.h        Fri Sep 25 06:04:15 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -102,8 +102,9 @@
 #define TM_ERA_YEAR            115
 #define TM_ORDINALS            116
 #define TM_FINAL               126
+#define TM_WORK                        129
 
-#define TM_NFORM               129
+#define TM_NFORM               132
 
 typedef struct                         /* leap second info             */
 {
@@ -123,7 +124,7 @@
 typedef struct                         /* tm library readonly data     */
 {
        char**          format;         /* default TM_* format strings  */
-       char*           lex;            /* format lex type classes      */
+       unsigned char*  lex;            /* format lex type classes      */
        char*           digit;          /* output digits                */
        short*          days;           /* days in month i              */
        short*          sum;            /* days in months before i      */
--- old/usr/src/lib/libast/i386/include/ast/tmx.h       Fri Sep 25 06:04:20 2009
+++ new/usr/src/lib/libast/i386/include/ast/tmx.h       Fri Sep 25 06:04:18 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/tmx
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/tmx
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TMX_H
 #if !defined(__PROTO__)
@@ -129,6 +129,7 @@
 #endif
 
 extern __MANGLE__ Time_t               tmxdate __PROTO__((const char*, char**, 
Time_t));
+extern __MANGLE__ Time_t               tmxduration __PROTO__((const char*, 
char**));
 extern __MANGLE__ char*                tmxfmt __PROTO__((char*, size_t, const 
char*, Time_t));
 extern __MANGLE__ Time_t               tmxleap __PROTO__((Time_t));
 extern __MANGLE__ Tm_t*                tmxmake __PROTO__((Time_t));
@@ -135,6 +136,7 @@
 extern __MANGLE__ Time_t               tmxscan __PROTO__((const char*, char**, 
const char*, char**, Time_t, long));
 extern __MANGLE__ int          tmxsleep __PROTO__((Time_t));
 extern __MANGLE__ Time_t               tmxtime __PROTO__((Tm_t*, int));
+extern __MANGLE__ Tm_t*                tmxtm __PROTO__((Tm_t*, Time_t, 
Tm_zone_t*));
 
 extern __MANGLE__ Time_t               tmxgettime __PROTO__((void));
 extern __MANGLE__ int          tmxsettime __PROTO__((Time_t));
--- old/usr/src/lib/libast/i386/include/ast/tok.h       Fri Sep 25 06:04:22 2009
+++ new/usr/src/lib/libast/i386/include/ast/tok.h       Fri Sep 25 06:04:20 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/tv.h        Fri Sep 25 06:04:25 2009
+++ new/usr/src/lib/libast/i386/include/ast/tv.h        Fri Sep 25 06:04:23 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/tv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/tv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TV_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/include/ast/usage.h     Fri Sep 25 06:04:27 2009
+++ new/usr/src/lib/libast/i386/include/ast/usage.h     Fri Sep 25 06:04:26 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/vdb.h       Fri Sep 25 06:04:30 2009
+++ new/usr/src/lib/libast/i386/include/ast/vdb.h       Fri Sep 25 06:04:28 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/vecargs.h   Fri Sep 25 06:04:33 2009
+++ new/usr/src/lib/libast/i386/include/ast/vecargs.h   Fri Sep 25 06:04:31 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/vmalloc.h   Fri Sep 25 06:04:35 2009
+++ new/usr/src/lib/libast/i386/include/ast/vmalloc.h   Fri Sep 25 06:04:34 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/wait.h      Fri Sep 25 06:04:38 2009
+++ new/usr/src/lib/libast/i386/include/ast/wait.h      Fri Sep 25 06:04:36 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/wchar.h     Fri Sep 25 06:04:41 2009
+++ new/usr/src/lib/libast/i386/include/ast/wchar.h     Fri Sep 25 06:04:39 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/include/ast/wordexp.h   Fri Sep 25 06:04:43 2009
+++ new/usr/src/lib/libast/i386/include/ast/wordexp.h   Fri Sep 25 06:04:42 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/align    Fri Sep 25 
06:04:46 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/align    Fri Sep 25 
06:04:44 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/align.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/align.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_align_ast
 #define _def_align_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/botch    Fri Sep 25 
06:04:49 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/botch    Fri Sep 25 
06:04:47 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/botch.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/botch.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_botch_ast
 #define _def_botch_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/ccode    Fri Sep 25 
06:04:51 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/ccode    Fri Sep 25 
06:04:50 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/ccode
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/ccode
 by iffe version 2009-05-01 : : */
 #ifndef _def_ccode_ast
 #define _def_ccode_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/common   Fri Sep 25 
06:04:54 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/common   Fri Sep 25 
06:04:52 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/common
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/common
 by iffe version 2009-05-01 : : */
 #ifndef _AST_COMMON_H
 #define _AST_COMMON_H  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -155,9 +155,6 @@
 #define _typ_uintmax_t 1       /* uintmax_t is a type */
 
 #ifndef va_listref
-#define va_listref(p) (p)      /* pass va_list to varargs function */
-#define va_listval(p) (p)      /* retrieve va_list from va_arg(ap,va_listarg) 
*/
-#define va_listarg va_list     /* va_arg() va_list type */
 #ifndef        va_start
 #if __STD_C
 #include <stdarg.h>
@@ -165,6 +162,9 @@
 #include <varargs.h>
 #endif
 #endif
+#define va_listref(p) (p)      /* pass va_list to varargs function */
+#define va_listval(p) (p)      /* retrieve va_list from va_arg(ap,va_listarg) 
*/
+#define va_listarg va_list     /* va_arg() va_list type */
 #endif
 #ifndef _AST_STD_H
 #      if __STD_C && _hdr_stddef
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/dirent   Fri Sep 25 
06:04:57 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/dirent   Fri Sep 25 
06:04:55 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/dirent
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/dirent
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_dirent_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/eaccess  Fri Sep 25 
06:04:59 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/eaccess  Fri Sep 25 
06:04:57 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/eaccess
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/eaccess
 by iffe version 2009-05-01 : : */
 #ifndef _def_eaccess_ast
 #define _def_eaccess_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/errno    Fri Sep 25 
06:05:02 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/errno    Fri Sep 25 
06:05:00 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/errno
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/errno
 by iffe version 2009-05-01 : : */
 #ifndef _def_errno_ast
 #define _def_errno_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/fcntl    Fri Sep 25 
06:05:04 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/fcntl    Fri Sep 25 
06:05:03 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/fcntl.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/fcntl.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_fcntl_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/float    Fri Sep 25 
06:05:07 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/float    Fri Sep 25 
06:05:05 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/float
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/float
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_float_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/fs       Fri Sep 25 
06:05:10 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/fs       Fri Sep 25 
06:05:08 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/fs
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/fs
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_fs_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/hack     Fri Sep 25 
06:05:12 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/hack     Fri Sep 25 
06:05:11 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/hack
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/hack
 by iffe version 2009-05-01 : : */
 #ifndef _def_hack_ast
 #define _def_hack_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/iconv    Fri Sep 25 
06:05:15 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/iconv    Fri Sep 25 
06:05:13 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/iconv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/iconv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_iconv_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/isoc99   Fri Sep 25 
06:05:18 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/isoc99   Fri Sep 25 
06:05:16 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/isoc99
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/isoc99
 by iffe version 2009-05-01 : : */
 #ifndef _def_isoc99_ast
 #define _def_isoc99_ast        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/lib      Fri Sep 25 
06:05:20 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/lib      Fri Sep 25 
06:05:18 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/lib
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/lib
 by iffe version 2009-05-01 : : */
 #ifndef _def_lib_ast
 #define _def_lib_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/libpath  Fri Sep 25 
06:05:23 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/libpath  Fri Sep 25 
06:05:21 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/libpath.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/libpath.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_libpath_ast
 #define _def_libpath_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/limits   Fri Sep 25 
06:05:26 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/limits   Fri Sep 25 
06:05:24 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/limits.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/limits.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_limits_ast
 #define _def_limits_ast        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/map      Fri Sep 25 
06:05:28 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/map      Fri Sep 25 
06:05:26 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/map.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/map.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_map_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
@@ -198,6 +198,8 @@
 #define pathposix      _ast_pathposix
 #undef pathprobe
 #define pathprobe      _ast_pathprobe
+#undef pathprog
+#define pathprog       _ast_pathprog
 #undef pathrepl
 #define pathrepl       _ast_pathrepl
 #undef pathsetlink
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/mmap     Fri Sep 25 
06:05:31 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/mmap     Fri Sep 25 
06:05:29 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/mmap
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/mmap
 by iffe version 2009-05-01 : : */
 #ifndef _def_mmap_ast
 #define _def_mmap_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -7,6 +7,7 @@
 #define _lib_mmap64    1       /* mmap64 interface and implementation work */
 #define _mmap_anon     1       /* use mmap MAP_ANON to get raw memory */
 #define _mmap_devzero  1       /* use mmap on /dev/zero to get raw memory */
+#define _mmap_worthy   2       /* mmap is good */
 
 /* some systems get it wrong but escape concise detection */
 #ifndef _NO_MMAP
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/mode     Fri Sep 25 
06:05:34 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/mode     Fri Sep 25 
06:05:32 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/mode.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/mode.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_mode_ast
 #define _def_mode_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/ndbm     Fri Sep 25 
06:05:36 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/ndbm     Fri Sep 25 
06:05:34 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/ndbm
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/ndbm
 by iffe version 2009-05-01 : : */
 #ifndef _def_ndbm_ast
 #define _def_ndbm_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/nl_types Fri Sep 25 
06:05:39 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/nl_types Fri Sep 25 
06:05:37 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/nl_types
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/nl_types
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_nl_types_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/omitted  Fri Sep 25 
06:05:41 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/omitted  Fri Sep 25 
06:05:40 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/omitted
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/omitted
 by iffe version 2009-05-01 : : */
 #ifndef _def_omitted_ast
 #define _def_omitted_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/param    Fri Sep 25 
06:05:44 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/param    Fri Sep 25 
06:05:42 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/param.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/param.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_param_ast
 #define _def_param_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/preroot  Fri Sep 25 
06:05:47 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/preroot  Fri Sep 25 
06:05:45 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/preroot.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/preroot.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_preroot_ast
 #define _def_preroot_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- /dev/null   Fri Sep 25 06:05:49 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/prog     Fri Sep 25 
06:05:47 2009
@@ -0,0 +1,7 @@
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/prog
 by iffe version 2009-05-01 : : */
+#ifndef _def_prog_ast
+#define _def_prog_ast  1
+#define _sys_types     1       /* #include <sys/types.h> ok */
+#define _lib_getexecname       1       /* getexecname() in default lib(s) */
+#define _PROC_PROG     "/proc/self/path/a.out"
+#endif
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sfinit   Fri Sep 25 
06:05:52 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sfinit   Fri Sep 25 
06:05:50 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/sfinit.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/sfinit.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_sfinit_ast
 #define _def_sfinit_ast        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sfio     Fri Sep 25 
06:05:55 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sfio     Fri Sep 25 
06:05:53 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/sfio
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/sfio
 by iffe version 2009-05-01 : : */
 #ifndef _def_sfio_ast
 #define _def_sfio_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sig      Fri Sep 25 
06:05:57 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sig      Fri Sep 25 
06:05:56 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/sig.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/sig.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_sig_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/siglist  Fri Sep 25 
06:06:00 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/siglist  Fri Sep 25 
06:05:58 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/siglist
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/siglist
 by iffe version 2009-05-01 : : */
 #ifndef _def_siglist_ast
 #define _def_siglist_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -5,6 +5,9 @@
 #define _hdr_string    1       /* #include <string.h> ok */
 #define _hdr_signal    1       /* #include <signal.h> ok */
 #define _lib_strsignal 1       /* strsignal() in default lib(s) */
+#if defined(SIGHUP) && !defined(HAD_SIGHUP)
+0,"HUP",SIGHUP,
+#endif
 #if defined(SIGINT) && !defined(HAD_SIGINT)
 0,"INT",SIGINT,
 #endif
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/signal   Fri Sep 25 
06:06:03 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/signal   Fri Sep 25 
06:06:01 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/signal.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/signal.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_signal_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/standards        Fri Sep 
25 06:06:05 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/standards        Fri Sep 
25 06:06:04 2009
@@ -1,26 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/standards
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/standards
 by iffe version 2009-05-01 : : */
 #ifndef _def_standards_ast
 #define _def_standards_ast     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-/* _ALL_SOURCE & _ISOC99_SOURCE & _POSIX_SOURCE & _POSIX_C_SOURCE & 
_XOPEN_SOURCE & __EXTENSIONS__ works */
-#ifndef _ALL_SOURCE
-#define _ALL_SOURCE    1
-#endif
-#ifndef _ISOC99_SOURCE
-#define _ISOC99_SOURCE 1
-#endif
-#ifndef _POSIX_SOURCE
-#define _POSIX_SOURCE  1
-#endif
-#ifndef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE        21000101L
-#endif
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE  9900
-#endif
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE    1
-#endif
+/* __EXTENSIONS__ works */
 #ifndef __EXTENSIONS__
 #define __EXTENSIONS__ 1
 #endif
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/stdio    Fri Sep 25 
06:06:08 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/stdio    Fri Sep 25 
06:06:06 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/stdio
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/stdio
 by iffe version 2009-05-01 : : */
                   
 #ifndef _SFSTDIO_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sys      Fri Sep 25 
06:06:11 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sys      Fri Sep 25 
06:06:09 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/sys
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/sys
 by iffe version 2009-05-01 : : */
                   
 #ifndef _AST_SYS_H
 #if !defined(__PROTO__)
@@ -104,7 +104,6 @@
 #include <limits.h>
 #include <fcntl.h>
 #include <locale.h>
-#include <sys/localedef.h>
 #define _hdr_time      1       /* #include <time.h> ok */
 #define _sys_time      1       /* #include <sys/time.h> ok */
 #define _sys_times     1       /* #include <sys/times.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/time     Fri Sep 25 
06:06:13 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/time     Fri Sep 25 
06:06:12 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/time
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/time
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_time_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tmlib    Fri Sep 25 
06:06:16 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tmlib    Fri Sep 25 
06:06:14 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/tmlib
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/tmlib
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_tmlib_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tmx      Fri Sep 25 
06:06:19 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tmx      Fri Sep 25 
06:06:17 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/tmx
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/tmx
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TMX_H
 #if !defined(__PROTO__)
@@ -108,6 +108,7 @@
 #endif
 
 extern __MANGLE__ Time_t               tmxdate __PROTO__((const char*, char**, 
Time_t));
+extern __MANGLE__ Time_t               tmxduration __PROTO__((const char*, 
char**));
 extern __MANGLE__ char*                tmxfmt __PROTO__((char*, size_t, const 
char*, Time_t));
 extern __MANGLE__ Time_t               tmxleap __PROTO__((Time_t));
 extern __MANGLE__ Tm_t*                tmxmake __PROTO__((Time_t));
@@ -114,6 +115,7 @@
 extern __MANGLE__ Time_t               tmxscan __PROTO__((const char*, char**, 
const char*, char**, Time_t, long));
 extern __MANGLE__ int          tmxsleep __PROTO__((Time_t));
 extern __MANGLE__ Time_t               tmxtime __PROTO__((Tm_t*, int));
+extern __MANGLE__ Tm_t*                tmxtm __PROTO__((Tm_t*, Time_t, 
Tm_zone_t*));
 
 extern __MANGLE__ Time_t               tmxgettime __PROTO__((void));
 extern __MANGLE__ int          tmxsettime __PROTO__((Time_t));
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tty      Fri Sep 25 
06:06:21 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tty      Fri Sep 25 
06:06:20 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/tty
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/tty
 by iffe version 2009-05-01 : : */
 #ifndef _def_tty_ast
 #define _def_tty_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tv       Fri Sep 25 
06:06:24 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tv       Fri Sep 25 
06:06:22 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/tv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/tv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TV_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tvlib    Fri Sep 25 
06:06:27 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tvlib    Fri Sep 25 
06:06:25 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/tvlib
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/tvlib
 by iffe version 2009-05-01 : : */
 #ifndef _def_tvlib_ast
 #define _def_tvlib_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/uwin     Fri Sep 25 
06:06:29 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/uwin     Fri Sep 25 
06:06:28 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/uwin
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/uwin
 by iffe version 2009-05-01 : : */
 #ifndef _def_uwin_ast
 #define _def_uwin_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/vfork    Fri Sep 25 
06:06:32 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/vfork    Fri Sep 25 
06:06:30 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/vfork
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/vfork
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_vfork_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/vmalloc  Fri Sep 25 
06:06:35 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/vmalloc  Fri Sep 25 
06:06:33 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/vmalloc
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/vmalloc
 by iffe version 2009-05-01 : : */
 #ifndef _def_vmalloc_ast
 #define _def_vmalloc_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/wait     Fri Sep 25 
06:06:37 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/wait     Fri Sep 25 
06:06:36 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/wait
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/wait
 by iffe version 2009-05-01 : : */
 #ifndef _def_wait_ast
 #define _def_wait_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/FEATURE/wchar    Fri Sep 25 
06:06:40 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/FEATURE/wchar    Fri Sep 25 
06:06:38 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/wchar
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/wchar
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_wchar_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/src/lib/libast/align.h  Fri Sep 25 06:06:43 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/align.h  Fri Sep 25 06:06:41 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/align.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/align.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_align_ast
 #define _def_align_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_botch.h      Fri Sep 25 
06:06:45 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_botch.h      Fri Sep 25 
06:06:43 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/botch.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/botch.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_botch_ast
 #define _def_botch_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_ccode.h      Fri Sep 25 
06:06:48 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_ccode.h      Fri Sep 25 
06:06:46 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/ccode
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/ccode
 by iffe version 2009-05-01 : : */
 #ifndef _def_ccode_ast
 #define _def_ccode_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_common.h     Fri Sep 25 
06:06:51 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_common.h     Fri Sep 25 
06:06:49 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/common
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/common
 by iffe version 2009-05-01 : : */
 #ifndef _AST_COMMON_H
 #define _AST_COMMON_H  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -155,9 +155,6 @@
 #define _typ_uintmax_t 1       /* uintmax_t is a type */
 
 #ifndef va_listref
-#define va_listref(p) (p)      /* pass va_list to varargs function */
-#define va_listval(p) (p)      /* retrieve va_list from va_arg(ap,va_listarg) 
*/
-#define va_listarg va_list     /* va_arg() va_list type */
 #ifndef        va_start
 #if __STD_C
 #include <stdarg.h>
@@ -165,6 +162,9 @@
 #include <varargs.h>
 #endif
 #endif
+#define va_listref(p) (p)      /* pass va_list to varargs function */
+#define va_listval(p) (p)      /* retrieve va_list from va_arg(ap,va_listarg) 
*/
+#define va_listarg va_list     /* va_arg() va_list type */
 #endif
 #ifndef _AST_STD_H
 #      if __STD_C && _hdr_stddef
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_dirent.h     Fri Sep 25 
06:06:53 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_dirent.h     Fri Sep 25 
06:06:52 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/dirent
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/dirent
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_dirent_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_fcntl.h      Fri Sep 25 
06:06:56 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_fcntl.h      Fri Sep 25 
06:06:54 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/fcntl.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/fcntl.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_fcntl_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_float.h      Fri Sep 25 
06:06:59 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_float.h      Fri Sep 25 
06:06:57 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/float
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/float
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_float_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_fs.h Fri Sep 25 06:07:01 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_fs.h Fri Sep 25 06:07:00 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/fs
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/fs
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_fs_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_iconv.h      Fri Sep 25 
06:07:04 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_iconv.h      Fri Sep 25 
06:07:02 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/iconv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/iconv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_iconv_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_lib.h        Fri Sep 25 
06:07:07 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_lib.h        Fri Sep 25 
06:07:05 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/lib
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/lib
 by iffe version 2009-05-01 : : */
 #ifndef _def_lib_ast
 #define _def_lib_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_limits.h     Fri Sep 25 
06:07:09 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_limits.h     Fri Sep 25 
06:07:08 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/limits.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/limits.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_limits_ast
 #define _def_limits_ast        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_map.h        Fri Sep 25 
06:07:12 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_map.h        Fri Sep 25 
06:07:10 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/map.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/map.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_map_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
@@ -198,6 +198,8 @@
 #define pathposix      _ast_pathposix
 #undef pathprobe
 #define pathprobe      _ast_pathprobe
+#undef pathprog
+#define pathprog       _ast_pathprog
 #undef pathrepl
 #define pathrepl       _ast_pathrepl
 #undef pathsetlink
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_mmap.h       Fri Sep 25 
06:07:15 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_mmap.h       Fri Sep 25 
06:07:13 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/mmap
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/mmap
 by iffe version 2009-05-01 : : */
 #ifndef _def_mmap_ast
 #define _def_mmap_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -7,6 +7,7 @@
 #define _lib_mmap64    1       /* mmap64 interface and implementation work */
 #define _mmap_anon     1       /* use mmap MAP_ANON to get raw memory */
 #define _mmap_devzero  1       /* use mmap on /dev/zero to get raw memory */
+#define _mmap_worthy   2       /* mmap is good */
 
 /* some systems get it wrong but escape concise detection */
 #ifndef _NO_MMAP
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_mode.h       Fri Sep 25 
06:07:18 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_mode.h       Fri Sep 25 
06:07:16 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/mode.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/mode.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_mode_ast
 #define _def_mode_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- /dev/null   Fri Sep 25 06:07:20 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_namval.h     Fri Sep 25 
06:07:18 2009
@@ -0,0 +1,42 @@
+/***********************************************************************
+*                                                                      *
+*               This software is part of the ast package               *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
+*                      and is licensed under the                       *
+*                  Common Public License, Version 1.0                  *
+*                    by AT&T Intellectual Property                     *
+*                                                                      *
+*                A copy of the License is available at                 *
+*            http://www.opensource.org/licenses/cpl1.0.txt             *
+*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
+*                                                                      *
+*              Information and Software Systems Research               *
+*                            AT&T Research                             *
+*                           Florham Park NJ                            *
+*                                                                      *
+*                 Glenn Fowler <gsf at research.att.com>                  *
+*                  David Korn <dgk at research.att.com>                   *
+*                   Phong Vo <kpv at research.att.com>                    *
+*                                                                      *
+***********************************************************************/
+#pragma prototyped
+/*
+ * Glenn Fowler
+ * AT&T Research
+ *
+ * common name-value struct support
+ */
+
+#ifndef _NAMVAL_H
+#define _NAMVAL_H
+
+typedef struct
+{
+       char*           name;
+       int             value;
+#ifdef _NAMVAL_PRIVATE_
+       _NAMVAL_PRIVATE_
+#endif
+} Namval_t;
+
+#endif
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_ndbm.h       Fri Sep 25 
06:07:23 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_ndbm.h       Fri Sep 25 
06:07:21 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/ndbm
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/ndbm
 by iffe version 2009-05-01 : : */
 #ifndef _def_ndbm_ast
 #define _def_ndbm_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_nl_types.h   Fri Sep 25 
06:07:25 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_nl_types.h   Fri Sep 25 
06:07:24 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/nl_types
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/nl_types
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_nl_types_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_param.h      Fri Sep 25 
06:07:28 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_param.h      Fri Sep 25 
06:07:26 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/param.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/param.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_param_ast
 #define _def_param_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_standards.h  Fri Sep 25 
06:07:31 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_standards.h  Fri Sep 25 
06:07:29 2009
@@ -1,26 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/standards
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/standards
 by iffe version 2009-05-01 : : */
 #ifndef _def_standards_ast
 #define _def_standards_ast     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-/* _ALL_SOURCE & _ISOC99_SOURCE & _POSIX_SOURCE & _POSIX_C_SOURCE & 
_XOPEN_SOURCE & __EXTENSIONS__ works */
-#ifndef _ALL_SOURCE
-#define _ALL_SOURCE    1
-#endif
-#ifndef _ISOC99_SOURCE
-#define _ISOC99_SOURCE 1
-#endif
-#ifndef _POSIX_SOURCE
-#define _POSIX_SOURCE  1
-#endif
-#ifndef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE        21000101L
-#endif
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE  9900
-#endif
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE    1
-#endif
+/* __EXTENSIONS__ works */
 #ifndef __EXTENSIONS__
 #define __EXTENSIONS__ 1
 #endif
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_stdio.h      Fri Sep 25 
06:07:33 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_stdio.h      Fri Sep 25 
06:07:31 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/stdio
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/stdio
 by iffe version 2009-05-01 : : */
                   
 #ifndef _SFSTDIO_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_sys.h        Fri Sep 25 
06:07:36 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_sys.h        Fri Sep 25 
06:07:34 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/sys
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/sys
 by iffe version 2009-05-01 : : */
                   
 #ifndef _AST_SYS_H
 #if !defined(__PROTO__)
@@ -104,7 +104,6 @@
 #include <limits.h>
 #include <fcntl.h>
 #include <locale.h>
-#include <sys/localedef.h>
 #define _hdr_time      1       /* #include <time.h> ok */
 #define _sys_time      1       /* #include <sys/time.h> ok */
 #define _sys_times     1       /* #include <sys/times.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_time.h       Fri Sep 25 
06:07:39 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_time.h       Fri Sep 25 
06:07:37 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/time
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/time
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_time_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_tty.h        Fri Sep 25 
06:07:41 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_tty.h        Fri Sep 25 
06:07:39 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/tty
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/tty
 by iffe version 2009-05-01 : : */
 #ifndef _def_tty_ast
 #define _def_tty_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_vfork.h      Fri Sep 25 
06:07:44 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_vfork.h      Fri Sep 25 
06:07:42 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/vfork
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/vfork
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_vfork_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_wait.h       Fri Sep 25 
06:07:47 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_wait.h       Fri Sep 25 
06:07:45 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/wait
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/wait
 by iffe version 2009-05-01 : : */
 #ifndef _def_wait_ast
 #define _def_wait_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/ast_wchar.h      Fri Sep 25 
06:07:49 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/ast_wchar.h      Fri Sep 25 
06:07:47 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/wchar
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/wchar
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_wchar_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/i386/src/lib/libast/conftab.c        Fri Sep 25 
06:07:52 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/conftab.c        Fri Sep 25 
06:07:50 2009
@@ -10,7 +10,7 @@
 #include "FEATURE/param"
 #include "conftab.h"
 
-/* : : generated by conf from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/comp/conf.tab
 : : */
+/* : : generated by conf from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/comp/conf.tab
 : : */
 
 /*
  * prefix strings -- the first few are indexed by Conf_t.standard
@@ -207,6 +207,7 @@
 { "NL_TEXTMAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, 
-1 },
 { "NO_TRUNC", { 0ULL, 0 }, { 0ULL, 0 }, 
CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, 
_PC_NO_TRUNC },
 { "NPROCESSORS_CONF", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, 
_SC_NPROCESSORS_CONF },
+{ "NPROCESSORS_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, 
_SC_NPROCESSORS_MAX },
 { "NPROCESSORS_ONLN", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, 
_SC_NPROCESSORS_ONLN },
 { "NPROC_CONF", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, 
CONF_POSIX, 1, CONF_nop, -1 },
 { "NPROC_ONLN", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, 
CONF_POSIX, 1, CONF_nop, -1 },
--- old/usr/src/lib/libast/i386/src/lib/libast/conftab.h        Fri Sep 25 
06:07:55 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/conftab.h        Fri Sep 25 
06:07:53 2009
@@ -6,7 +6,7 @@
 #endif
 #include <sys/systeminfo.h>
 
-/* : : generated by conf from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/comp/conf.tab
 : : */
+/* : : generated by conf from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/comp/conf.tab
 : : */
 
 #if !defined(const) && !defined(__STDC__) && !defined(__cplusplus) && 
!defined(c_plusplus)
 #define const
--- old/usr/src/lib/libast/i386/src/lib/libast/lc.h     Fri Sep 25 06:07:57 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/lc.h     Fri Sep 25 06:07:56 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -38,14 +38,15 @@
 
 #define LC_abbreviated         0x00001
 #define LC_checked             0x00002
-#define LC_default             0x00004
-#define LC_defined             0x00008
-#define LC_debug               0x00010
+#define LC_debug               0x00004
+#define LC_default             0x00008
+#define LC_defined             0x00010
 #define LC_local               0x00020
 #define LC_primary             0x00040
 #define LC_qualified           0x00080
 #define LC_undefined           0x00100
-#define LC_verbose             0x00200
+#define LC_utf8                        0x00200
+#define LC_verbose             0x00400
 #define LC_user                        0x10000
 #define LC_language_attribute_max              2
 #define LC_territory_language_max              4
--- old/usr/src/lib/libast/i386/src/lib/libast/preroot.h        Fri Sep 25 
06:08:00 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/preroot.h        Fri Sep 25 
06:07:58 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/preroot.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/preroot.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_preroot_ast
 #define _def_preroot_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/i386/src/lib/libast/sig.h    Fri Sep 25 06:08:03 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/sig.h    Fri Sep 25 06:08:01 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/sig.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/sig.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_sig_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/i386/src/lib/libast/tmx.h    Fri Sep 25 06:08:05 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/tmx.h    Fri Sep 25 06:08:04 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/tmx
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/tmx
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TMX_H
 #if !defined(__PROTO__)
@@ -108,6 +108,7 @@
 #endif
 
 extern __MANGLE__ Time_t               tmxdate __PROTO__((const char*, char**, 
Time_t));
+extern __MANGLE__ Time_t               tmxduration __PROTO__((const char*, 
char**));
 extern __MANGLE__ char*                tmxfmt __PROTO__((char*, size_t, const 
char*, Time_t));
 extern __MANGLE__ Time_t               tmxleap __PROTO__((Time_t));
 extern __MANGLE__ Tm_t*                tmxmake __PROTO__((Time_t));
@@ -114,6 +115,7 @@
 extern __MANGLE__ Time_t               tmxscan __PROTO__((const char*, char**, 
const char*, char**, Time_t, long));
 extern __MANGLE__ int          tmxsleep __PROTO__((Time_t));
 extern __MANGLE__ Time_t               tmxtime __PROTO__((Tm_t*, int));
+extern __MANGLE__ Tm_t*                tmxtm __PROTO__((Tm_t*, Time_t, 
Tm_zone_t*));
 
 extern __MANGLE__ Time_t               tmxgettime __PROTO__((void));
 extern __MANGLE__ int          tmxsettime __PROTO__((Time_t));
--- old/usr/src/lib/libast/i386/src/lib/libast/tv.h     Fri Sep 25 06:08:08 2009
+++ new/usr/src/lib/libast/i386/src/lib/libast/tv.h     Fri Sep 25 06:08:06 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/tv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libast/features/tv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TV_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/mapfile-vers Fri Sep 25 06:08:11 2009
+++ new/usr/src/lib/libast/mapfile-vers Fri Sep 25 06:08:09 2009
@@ -194,6 +194,7 @@
        _ast_pathpath;
        _ast_pathposix;
        _ast_pathprobe;
+       _ast_pathprog;
        _ast_pathrepl;
        _ast_pathsetlink;
        _ast_pathshell;
@@ -462,6 +463,7 @@
        fmtuid;
        fmtversion;
        fs3d;
+       fs3d_mount;
        hashalloc;
        hashdone;
        hashdump;
--- old/usr/src/lib/libast/sparc/include/ast/align.h    Fri Sep 25 06:08:14 2009
+++ new/usr/src/lib/libast/sparc/include/ast/align.h    Fri Sep 25 06:08:12 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/align.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/align.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_align_ast
 #define _def_align_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/include/ast/ast.h      Fri Sep 25 06:08:16 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast.h      Fri Sep 25 06:08:14 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -185,7 +185,7 @@
 #define mbcoll()       (ast.mb_xfrm!=0)
 #define mbwide()       (mbmax()>1)
 
-#define mbchar(p)      
(mbwide()?((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),mbmax()))>0?((p+=ast.tmp_int),ast.tmp_wchar):(p++,ast.tmp_int)):(*(unsigned
 char*)(p++)))
+#define mbchar(p)      
(mbwide()?((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),mbmax()))>0?((p+=ast.tmp_int),ast.tmp_wchar):(p+=ast.mb_sync+1,ast.tmp_int)):(*(unsigned
 char*)(p++)))
 #define mbinit()       
(mbwide()?(*ast.mb_towc)((wchar_t*)0,(char*)0,mbmax()):0)
 #define mbsize(p)      (mbwide()?(*ast.mb_len)((char*)(p),mbmax()):((p),1))
 #define mbconv(s,w)    (ast.mb_conv?(*ast.mb_conv)(s,w):((*(s)=(w)),1))
@@ -309,6 +309,7 @@
 extern __MANGLE__ char*                pathpath __PROTO__((char*, const char*, 
const char*, int));
 extern __MANGLE__ size_t               pathposix __PROTO__((const char*, 
char*, size_t));
 extern __MANGLE__ char*                pathprobe __PROTO__((char*, char*, 
const char*, const char*, const char*, int));
+extern __MANGLE__ size_t               pathprog __PROTO__((const char*, char*, 
size_t));
 extern __MANGLE__ char*                pathrepl __PROTO__((char*, const char*, 
const char*));
 extern __MANGLE__ int          pathsetlink __PROTO__((const char*, const 
char*));
 extern __MANGLE__ char*                pathshell __PROTO__((void));
@@ -329,6 +330,7 @@
 extern __MANGLE__ int          strmode __PROTO__((const char*));
 extern __MANGLE__ int          strnacmp __PROTO__((const char*, const char*, 
size_t));
 extern __MANGLE__ char*                strncopy __PROTO__((char*, const char*, 
size_t));
+extern __MANGLE__ int          strnpcmp __PROTO__((const char*, const char*, 
size_t));
 extern __MANGLE__ double               strntod __PROTO__((const char*, size_t, 
char**));
 extern __MANGLE__ _ast_fltmax_t        strntold __PROTO__((const char*, 
size_t, char**));
 extern __MANGLE__ long         strntol __PROTO__((const char*, size_t, char**, 
int));
@@ -337,7 +339,9 @@
 extern __MANGLE__ unsigned long        strntoul __PROTO__((const char*, 
size_t, char**, int));
 extern __MANGLE__ intmax_t             strntonll __PROTO__((const char*, 
size_t, char**, char*, int));
 extern __MANGLE__ uintmax_t    strntoull __PROTO__((const char*, size_t, 
char**, int));
+extern __MANGLE__ int          strnvcmp __PROTO__((const char*, const char*, 
size_t));
 extern __MANGLE__ int          stropt __PROTO__((const char*, const __V_*, 
int, int(*)(__V_*, const __V_*, int, const char*), __V_*));
+extern __MANGLE__ int          strpcmp __PROTO__((const char*, const char*));
 extern __MANGLE__ int          strperm __PROTO__((const char*, char**, int));
 extern __MANGLE__ __V_*                strpsearch __PROTO__((const __V_*, 
size_t, size_t, const char*, char**));
 extern __MANGLE__ __V_*                strsearch __PROTO__((const __V_*, 
size_t, size_t, Strcmp_f, const char*, __V_*));
@@ -350,6 +354,7 @@
 extern __MANGLE__ intmax_t             strtonll __PROTO__((const char*, 
char**, char*, int));
 extern __MANGLE__ int          struid __PROTO__((const char*));
 extern __MANGLE__ int          struniq __PROTO__((char**, int));
+extern __MANGLE__ int          strvcmp __PROTO__((const char*, const char*));
 
 #undef __MANGLE__
 #define __MANGLE__ __LINKAGE__
--- old/usr/src/lib/libast/sparc/include/ast/ast_botch.h        Fri Sep 25 
06:08:19 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_botch.h        Fri Sep 25 
06:08:17 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/botch.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/botch.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_botch_ast
 #define _def_botch_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/include/ast/ast_ccode.h        Fri Sep 25 
06:08:22 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_ccode.h        Fri Sep 25 
06:08:20 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/ccode
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/ccode
 by iffe version 2009-05-01 : : */
 #ifndef _def_ccode_ast
 #define _def_ccode_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/include/ast/ast_common.h       Fri Sep 25 
06:08:24 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_common.h       Fri Sep 25 
06:08:23 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/common
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/common
 by iffe version 2009-05-01 : : */
 #ifndef _AST_COMMON_H
 #define _AST_COMMON_H  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -176,9 +176,6 @@
 #define _typ_uintmax_t 1       /* uintmax_t is a type */
 
 #ifndef va_listref
-#define va_listref(p) (p)      /* pass va_list to varargs function */
-#define va_listval(p) (p)      /* retrieve va_list from va_arg(ap,va_listarg) 
*/
-#define va_listarg va_list     /* va_arg() va_list type */
 #ifndef        va_start
 #if __STD_C
 #include <stdarg.h>
@@ -186,6 +183,9 @@
 #include <varargs.h>
 #endif
 #endif
+#define va_listref(p) (p)      /* pass va_list to varargs function */
+#define va_listval(p) (p)      /* retrieve va_list from va_arg(ap,va_listarg) 
*/
+#define va_listarg va_list     /* va_arg() va_list type */
 #endif
 #ifndef _AST_STD_H
 #      if __STD_C && _hdr_stddef
--- old/usr/src/lib/libast/sparc/include/ast/ast_dir.h  Fri Sep 25 06:08:27 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_dir.h  Fri Sep 25 06:08:25 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/ast_dirent.h       Fri Sep 25 
06:08:30 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_dirent.h       Fri Sep 25 
06:08:28 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/dirent
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/dirent
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_dirent_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/include/ast/ast_fcntl.h        Fri Sep 25 
06:08:32 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_fcntl.h        Fri Sep 25 
06:08:31 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/fcntl.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/fcntl.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_fcntl_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/sparc/include/ast/ast_float.h        Fri Sep 25 
06:08:35 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_float.h        Fri Sep 25 
06:08:33 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/float
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/float
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_float_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/include/ast/ast_fs.h   Fri Sep 25 06:08:38 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_fs.h   Fri Sep 25 06:08:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/fs
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/fs
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_fs_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/include/ast/ast_iconv.h        Fri Sep 25 
06:08:40 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_iconv.h        Fri Sep 25 
06:08:39 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/iconv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/iconv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_iconv_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/include/ast/ast_lib.h  Fri Sep 25 06:08:43 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_lib.h  Fri Sep 25 06:08:41 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/lib
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/lib
 by iffe version 2009-05-01 : : */
 #ifndef _def_lib_ast
 #define _def_lib_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/include/ast/ast_limits.h       Fri Sep 25 
06:08:46 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_limits.h       Fri Sep 25 
06:08:44 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/limits.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/limits.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_limits_ast
 #define _def_limits_ast        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/include/ast/ast_map.h  Fri Sep 25 06:08:49 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_map.h  Fri Sep 25 06:08:47 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/map.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/map.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_map_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
@@ -219,6 +219,8 @@
 #define pathposix      _ast_pathposix
 #undef pathprobe
 #define pathprobe      _ast_pathprobe
+#undef pathprog
+#define pathprog       _ast_pathprog
 #undef pathrepl
 #define pathrepl       _ast_pathrepl
 #undef pathsetlink
--- old/usr/src/lib/libast/sparc/include/ast/ast_mmap.h Fri Sep 25 06:08:51 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_mmap.h Fri Sep 25 06:08:49 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/mmap
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/mmap
 by iffe version 2009-05-01 : : */
 #ifndef _def_mmap_ast
 #define _def_mmap_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -28,7 +28,7 @@
 #define _lib_mmap64    1       /* mmap64 interface and implementation work */
 #define _mmap_anon     1       /* use mmap MAP_ANON to get raw memory */
 #define _mmap_devzero  1       /* use mmap on /dev/zero to get raw memory */
-#define _mmap_worthy   1       /* mmap is good */
+#define _mmap_worthy   2       /* mmap is good */
 
 /* some systems get it wrong but escape concise detection */
 #ifndef _NO_MMAP
--- old/usr/src/lib/libast/sparc/include/ast/ast_mode.h Fri Sep 25 06:08:54 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_mode.h Fri Sep 25 06:08:52 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/mode.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/mode.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_mode_ast
 #define _def_mode_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/include/ast/ast_namval.h       Fri Sep 25 
06:08:57 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_namval.h       Fri Sep 25 
06:08:55 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/ast_ndbm.h Fri Sep 25 06:08:59 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_ndbm.h Fri Sep 25 06:08:58 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/ndbm
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/ndbm
 by iffe version 2009-05-01 : : */
 #ifndef _def_ndbm_ast
 #define _def_ndbm_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/include/ast/ast_nl_types.h     Fri Sep 25 
06:09:02 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_nl_types.h     Fri Sep 25 
06:09:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/nl_types
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/nl_types
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_nl_types_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/include/ast/ast_param.h        Fri Sep 25 
06:09:05 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_param.h        Fri Sep 25 
06:09:03 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/param.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/param.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_param_ast
 #define _def_param_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/include/ast/ast_standards.h    Fri Sep 25 
06:09:07 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_standards.h    Fri Sep 25 
06:09:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,29 +19,11 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/standards
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/standards
 by iffe version 2009-05-01 : : */
 #ifndef _def_standards_ast
 #define _def_standards_ast     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-/* _ALL_SOURCE & _ISOC99_SOURCE & _POSIX_SOURCE & _POSIX_C_SOURCE & 
_XOPEN_SOURCE & __EXTENSIONS__ works */
-#ifndef _ALL_SOURCE
-#define _ALL_SOURCE    1
-#endif
-#ifndef _ISOC99_SOURCE
-#define _ISOC99_SOURCE 1
-#endif
-#ifndef _POSIX_SOURCE
-#define _POSIX_SOURCE  1
-#endif
-#ifndef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE        21000101L
-#endif
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE  9900
-#endif
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE    1
-#endif
+/* __EXTENSIONS__ works */
 #ifndef __EXTENSIONS__
 #define __EXTENSIONS__ 1
 #endif
--- old/usr/src/lib/libast/sparc/include/ast/ast_std.h  Fri Sep 25 06:09:10 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_std.h  Fri Sep 25 06:09:08 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -117,9 +117,18 @@
 #define __MANGLE__ __LINKAGE__         __EXPORT__
 #endif
 
+#if !_UWIN /* for ast54 compatibility */
+
 #undef getenv
 #define getenv         _ast_getenv
 
+#undef setenviron
+#define setenviron     _ast_setenviron
+
+extern __MANGLE__ char*                getenv __PROTO__((const char*));
+
+#endif
+
 #undef localeconv
 #define localeconv     _ast_localeconv
 
@@ -126,13 +135,9 @@
 #undef setlocale
 #define setlocale      _ast_setlocale
 
-#undef setenviron
-#define setenviron     _ast_setenviron
-
 #undef strerror
 #define strerror       _ast_strerror
 
-extern __MANGLE__ char*                getenv __PROTO__((const char*));
 extern __MANGLE__ struct lconv*        localeconv __PROTO__((void));
 extern __MANGLE__ char*                setenviron __PROTO__((const char*));
 extern __MANGLE__ char*                setlocale __PROTO__((int, const char*));
@@ -248,8 +253,9 @@
        int             (*mb_conv) __PROTO__((char*, wchar_t));
 
        uint32_t        env_serial;
+       uint32_t        mb_sync;
 
-       char            pad[944];
+       char            pad[940];
 
 } _Ast_info_t;
 
--- old/usr/src/lib/libast/sparc/include/ast/ast_stdio.h        Fri Sep 25 
06:09:13 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_stdio.h        Fri Sep 25 
06:09:11 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/stdio
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/stdio
 by iffe version 2009-05-01 : : */
                   
 #ifndef _SFSTDIO_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/include/ast/ast_sys.h  Fri Sep 25 06:09:15 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_sys.h  Fri Sep 25 06:09:14 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/sys
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/sys
 by iffe version 2009-05-01 : : */
                   
 #ifndef _AST_SYS_H
 #if !defined(__PROTO__)
@@ -125,7 +125,6 @@
 #include <limits.h>
 #include <fcntl.h>
 #include <locale.h>
-#include <sys/localedef.h>
 #define _hdr_time      1       /* #include <time.h> ok */
 #define _sys_time      1       /* #include <sys/time.h> ok */
 #define _sys_times     1       /* #include <sys/times.h> ok */
--- old/usr/src/lib/libast/sparc/include/ast/ast_time.h Fri Sep 25 06:09:18 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_time.h Fri Sep 25 06:09:16 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/time
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/time
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_time_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/include/ast/ast_tty.h  Fri Sep 25 06:09:21 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_tty.h  Fri Sep 25 06:09:19 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/tty
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/tty
 by iffe version 2009-05-01 : : */
 #ifndef _def_tty_ast
 #define _def_tty_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/include/ast/ast_version.h      Fri Sep 25 
06:09:24 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_version.h      Fri Sep 25 
06:09:22 2009
@@ -7,4 +7,4 @@
 #if !defined(__LINKAGE__)
 #define __LINKAGE__            /* 2004-08-11 transition */
 #endif
-#define _AST_VERSION   20080910L
+#define _AST_VERSION   20090202L
--- old/usr/src/lib/libast/sparc/include/ast/ast_vfork.h        Fri Sep 25 
06:09:26 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_vfork.h        Fri Sep 25 
06:09:24 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/vfork
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/vfork
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_vfork_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/include/ast/ast_wait.h Fri Sep 25 06:09:29 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_wait.h Fri Sep 25 06:09:27 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/wait
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/wait
 by iffe version 2009-05-01 : : */
 #ifndef _def_wait_ast
 #define _def_wait_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/include/ast/ast_wchar.h        Fri Sep 25 
06:09:32 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_wchar.h        Fri Sep 25 
06:09:30 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/wchar
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/wchar
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_wchar_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/include/ast/ast_windows.h      Fri Sep 25 
06:09:34 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ast_windows.h      Fri Sep 25 
06:09:32 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/bytesex.h  Fri Sep 25 06:09:37 2009
+++ new/usr/src/lib/libast/sparc/include/ast/bytesex.h  Fri Sep 25 06:09:35 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/ccode.h    Fri Sep 25 06:09:40 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ccode.h    Fri Sep 25 06:09:38 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/cdt.h      Fri Sep 25 06:09:42 2009
+++ new/usr/src/lib/libast/sparc/include/ast/cdt.h      Fri Sep 25 06:09:41 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/debug.h    Fri Sep 25 06:09:45 2009
+++ new/usr/src/lib/libast/sparc/include/ast/debug.h    Fri Sep 25 06:09:43 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -55,14 +55,17 @@
 #define DEBUG_ASSERT(p)                ((p) ? 0 : (debug_fatal(__FILE__, 
__LINE__),0))
 #define DEBUG_COUNT(n)         ((n) += 1)
 #define DEBUG_TALLY(c,n,v)     ((c) ? ((n) += (v)) : (n))
+#define DEBUG_INCREASE(n)      ((n) += 1)
+#define DEBUG_DECREASE(n)      ((n) -= 1)
 #define DEBUG_DECLARE(t,v)     t v
 #define DEBUG_SET(n,v)         ((n) = (v))
 #define DEBUG_PRINT(fd,s,v)    do {char 
_b[1024];write(fd,_b,sfsprintf(_b,sizeof(_b),s,v));} while(0)
 #define DEBUG_WRITE(fd,d,n)    write((fd),(d),(n))
 #define DEBUG_TEMP(temp)       (temp) /* debugging stuff that should be 
removed */
-#define DEBUG_RETURN(x)                (debug_fatal(__FILE__, __LINE__), (x))
-#define DEBUG_BREAK            (debug_fatal(__FILE__, __LINE__))
+#define DEBUG_BREAK            break
+#define DEBUG_CONTINUE         continue
 #define DEBUG_GOTO(label)      do { debug_fatal(__FILE__, __LINE__); goto 
label; } while(0)
+#define DEBUG_RETURN(x)                do { debug_fatal(__FILE__, __LINE__); 
return(x); } while(0)
 
 #else
 
@@ -75,17 +78,33 @@
 #define DEBUG_ASSERT(p)
 #define DEBUG_COUNT(n)
 #define DEBUG_TALLY(c,n,v)
+#define DEBUG_INCREASE(n)
+#define DEBUG_DECREASE(n)
 #define DEBUG_DECLARE(t,v)
 #define DEBUG_SET(n,v)
 #define DEBUG_PRINT(fd,s,v)
 #define DEBUG_WRITE(fd,d,n)
-#define DEBUG_KPV(x)
-#define DEBUG_RETURN(x)                return(x)
+#define DEBUG_TEMP(x)
 #define DEBUG_BREAK            break
+#define DEBUG_CONTINUE         continue
 #define DEBUG_GOTO(label)      goto label
+#define DEBUG_RETURN(x)                return(x)
 
 #endif
 
+#ifndef BREAK
+#define BREAK                  DEBUG_BREAK
+#endif
+#ifndef CONTINUE
+#define CONTINUE               DEBUG_CONTINUE
+#endif
+#ifndef GOTO
+#define GOTO(label)            DEBUG_GOTO(label)
+#endif
+#ifndef RETURN
+#define RETURN(x)              DEBUG_RETURN(x)
+#endif
+
 #if _BLD_ast && defined(__EXPORT__)
 #undef __MANGLE__
 #define __MANGLE__ __LINKAGE__         __EXPORT__
--- old/usr/src/lib/libast/sparc/include/ast/dirent.h   Fri Sep 25 06:09:48 2009
+++ new/usr/src/lib/libast/sparc/include/ast/dirent.h   Fri Sep 25 06:09:46 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/dt.h       Fri Sep 25 06:09:50 2009
+++ new/usr/src/lib/libast/sparc/include/ast/dt.h       Fri Sep 25 06:09:49 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/endian.h   Fri Sep 25 06:09:53 2009
+++ new/usr/src/lib/libast/sparc/include/ast/endian.h   Fri Sep 25 06:09:51 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/error.h    Fri Sep 25 06:09:56 2009
+++ new/usr/src/lib/libast/sparc/include/ast/error.h    Fri Sep 25 06:09:54 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/find.h     Fri Sep 25 06:09:58 2009
+++ new/usr/src/lib/libast/sparc/include/ast/find.h     Fri Sep 25 06:09:57 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/fnmatch.h  Fri Sep 25 06:10:01 2009
+++ new/usr/src/lib/libast/sparc/include/ast/fnmatch.h  Fri Sep 25 06:09:59 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/fnv.h      Fri Sep 25 06:10:04 2009
+++ new/usr/src/lib/libast/sparc/include/ast/fnv.h      Fri Sep 25 06:10:02 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/fs3d.h     Fri Sep 25 06:10:06 2009
+++ new/usr/src/lib/libast/sparc/include/ast/fs3d.h     Fri Sep 25 06:10:05 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -104,7 +104,9 @@
 #define FS3D_SIZE(n)   ((n)<<4)
 #define FS3D_SIZEOF(n) ((n)>>4)
 
-extern __MANGLE__ int          mount __PROTO__((const char*, char*, int, 
__V_*));
+#if !_BLD_3d
+#define mount(s,t,f,d) fs3d_mount(s,t,f,d)
+#endif
 
 #if _BLD_ast && defined(__EXPORT__)
 #undef __MANGLE__
@@ -112,6 +114,7 @@
 #endif
 
 extern __MANGLE__ int          fs3d __PROTO__((int));
+extern __MANGLE__ int          fs3d_mount __PROTO__((const char*, char*, int, 
__V_*));
 extern __MANGLE__ char*                pathnext __PROTO__((char*, char*, 
long*));
 
 #undef __MANGLE__
--- old/usr/src/lib/libast/sparc/include/ast/fts.h      Fri Sep 25 06:10:09 2009
+++ new/usr/src/lib/libast/sparc/include/ast/fts.h      Fri Sep 25 06:10:07 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/ftw.h      Fri Sep 25 06:10:12 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ftw.h      Fri Sep 25 06:10:10 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/ftwalk.h   Fri Sep 25 06:10:14 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ftwalk.h   Fri Sep 25 06:10:13 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/glob.h     Fri Sep 25 06:10:17 2009
+++ new/usr/src/lib/libast/sparc/include/ast/glob.h     Fri Sep 25 06:10:15 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/hash.h     Fri Sep 25 06:10:20 2009
+++ new/usr/src/lib/libast/sparc/include/ast/hash.h     Fri Sep 25 06:10:18 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/hashkey.h  Fri Sep 25 06:10:23 2009
+++ new/usr/src/lib/libast/sparc/include/ast/hashkey.h  Fri Sep 25 06:10:21 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/hashpart.h Fri Sep 25 06:10:25 2009
+++ new/usr/src/lib/libast/sparc/include/ast/hashpart.h Fri Sep 25 06:10:23 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/iconv.h    Fri Sep 25 06:10:28 2009
+++ new/usr/src/lib/libast/sparc/include/ast/iconv.h    Fri Sep 25 06:10:26 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/lc.h       Fri Sep 25 06:10:31 2009
+++ new/usr/src/lib/libast/sparc/include/ast/lc.h       Fri Sep 25 06:10:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -38,14 +38,15 @@
 
 #define LC_abbreviated         0x00001
 #define LC_checked             0x00002
-#define LC_default             0x00004
-#define LC_defined             0x00008
-#define LC_debug               0x00010
+#define LC_debug               0x00004
+#define LC_default             0x00008
+#define LC_defined             0x00010
 #define LC_local               0x00020
 #define LC_primary             0x00040
 #define LC_qualified           0x00080
 #define LC_undefined           0x00100
-#define LC_verbose             0x00200
+#define LC_utf8                        0x00200
+#define LC_verbose             0x00400
 #define LC_user                        0x10000
 #define LC_language_attribute_max              2
 #define LC_territory_language_max              4
--- old/usr/src/lib/libast/sparc/include/ast/ls.h       Fri Sep 25 06:10:33 2009
+++ new/usr/src/lib/libast/sparc/include/ast/ls.h       Fri Sep 25 06:10:31 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -76,8 +76,8 @@
 #define LS_USER                (1<<10)         /* first user flag bit          
*/
 
 #define LS_W_BLOCKS    6               /* LS_BLOCKS field width        */
-#define LS_W_INUMBER   7               /* LS_INUMBER field width       */
-#define LS_W_LONG      55              /* LS_LONG width (w/o names)    */
+#define LS_W_INUMBER   9               /* LS_INUMBER field width       */
+#define LS_W_LONG      57              /* LS_LONG width (w/o names)    */
 #define LS_W_LINK      4               /* link text width (w/o names)  */
 #define LS_W_MARK      1               /* LS_MARK field width          */
 #define LS_W_NAME      9               /* group|user name field width  */
--- old/usr/src/lib/libast/sparc/include/ast/magic.h    Fri Sep 25 06:10:36 2009
+++ new/usr/src/lib/libast/sparc/include/ast/magic.h    Fri Sep 25 06:10:34 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/magicid.h  Fri Sep 25 06:10:39 2009
+++ new/usr/src/lib/libast/sparc/include/ast/magicid.h  Fri Sep 25 06:10:37 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/mc.h       Fri Sep 25 06:10:41 2009
+++ new/usr/src/lib/libast/sparc/include/ast/mc.h       Fri Sep 25 06:10:39 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/mime.h     Fri Sep 25 06:10:44 2009
+++ new/usr/src/lib/libast/sparc/include/ast/mime.h     Fri Sep 25 06:10:42 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/mnt.h      Fri Sep 25 06:10:47 2009
+++ new/usr/src/lib/libast/sparc/include/ast/mnt.h      Fri Sep 25 06:10:45 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/modecanon.h        Fri Sep 25 
06:10:49 2009
+++ new/usr/src/lib/libast/sparc/include/ast/modecanon.h        Fri Sep 25 
06:10:48 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/modex.h    Fri Sep 25 06:10:52 2009
+++ new/usr/src/lib/libast/sparc/include/ast/modex.h    Fri Sep 25 06:10:50 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/namval.h   Fri Sep 25 06:10:55 2009
+++ new/usr/src/lib/libast/sparc/include/ast/namval.h   Fri Sep 25 06:10:53 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/nl_types.h Fri Sep 25 06:10:57 2009
+++ new/usr/src/lib/libast/sparc/include/ast/nl_types.h Fri Sep 25 06:10:56 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/option.h   Fri Sep 25 06:11:00 2009
+++ new/usr/src/lib/libast/sparc/include/ast/option.h   Fri Sep 25 06:10:58 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/preroot.h  Fri Sep 25 06:11:03 2009
+++ new/usr/src/lib/libast/sparc/include/ast/preroot.h  Fri Sep 25 06:11:01 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/preroot.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/preroot.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_preroot_ast
 #define _def_preroot_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/include/ast/proc.h     Fri Sep 25 06:11:05 2009
+++ new/usr/src/lib/libast/sparc/include/ast/proc.h     Fri Sep 25 06:11:04 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/re_comp.h  Fri Sep 25 06:11:08 2009
+++ new/usr/src/lib/libast/sparc/include/ast/re_comp.h  Fri Sep 25 06:11:06 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/recfmt.h   Fri Sep 25 06:11:11 2009
+++ new/usr/src/lib/libast/sparc/include/ast/recfmt.h   Fri Sep 25 06:11:09 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/regex.h    Fri Sep 25 06:11:14 2009
+++ new/usr/src/lib/libast/sparc/include/ast/regex.h    Fri Sep 25 06:11:12 2009
@@ -53,6 +53,8 @@
 #define REG_SHELL_ESCAPED 0x00400000   /* \ not special                */
 #define REG_SHELL_PATH 0x00800000      /* explicit / match             */
 
+#define REG_REGEXP     0x40000000      /* <regexp.h> compatibility     */
+
 /* regexec flags */
 
 #define REG_NOTBOL     0x00000040      /* ^ is not a special char      */
--- old/usr/src/lib/libast/sparc/include/ast/regexp.h   Fri Sep 25 06:11:16 2009
+++ new/usr/src/lib/libast/sparc/include/ast/regexp.h   Fri Sep 25 06:11:14 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/sfdisc.h   Fri Sep 25 06:11:19 2009
+++ new/usr/src/lib/libast/sparc/include/ast/sfdisc.h   Fri Sep 25 06:11:17 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/sfio.h     Fri Sep 25 06:11:22 2009
+++ new/usr/src/lib/libast/sparc/include/ast/sfio.h     Fri Sep 25 06:11:20 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/sfio_s.h   Fri Sep 25 06:11:24 2009
+++ new/usr/src/lib/libast/sparc/include/ast/sfio_s.h   Fri Sep 25 06:11:22 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/sfio_t.h   Fri Sep 25 06:11:27 2009
+++ new/usr/src/lib/libast/sparc/include/ast/sfio_t.h   Fri Sep 25 06:11:25 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/shcmd.h    Fri Sep 25 06:11:30 2009
+++ new/usr/src/lib/libast/sparc/include/ast/shcmd.h    Fri Sep 25 06:11:28 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -75,18 +75,19 @@
 #   undef Shell_t
 #   undef Namval_t
 #else 
-#   define sh_run(c, ac, av)   ((c)?(*((Shbltin_t*)(c))->shrun)(ac,av):-1)
-#   define sh_system(c,str)    
((c)?(*((Shbltin_t*)(c))->shtrap)(str,0):system(str))
-#   define sh_exit(c,n)                
((c)?(*((Shbltin_t*)(c))->shexit)(n):exit(n))
-#   define sh_checksig(c)      ((c) && ((Shbltin_t*)(c))->sigset)
+#   define sh_context(c)       ((Shbltin_t*)(c))
+#   define sh_run(c, ac, av)   ((c)?(*sh_context(c)->shrun)(ac,av):-1)
+#   define sh_system(c,str)    
((c)?(*sh_context(c)->shtrap)(str,0):system(str))
+#   define sh_exit(c,n)                
((c)?(*sh_context(c)->shexit)(n):exit(n))
+#   define sh_checksig(c)      ((c) && sh_context(c)->sigset)
 #   if defined(SFIO_VERSION) || defined(_AST_H)
 #      define LIB_INIT(c)
 #   else
-#      define LIB_INIT(c)      ((c) && (((Shbltin_t*)(c))->nosfio = 1))
+#      define LIB_INIT(c)      ((c) && (sh_context(c)->nosfio = 1))
 #   endif
 #   ifndef _CMD_H
 #      define cmdinit(ac,av,c,cat,flg)         do { if((ac)<=0) return(0); \
-           (((Shbltin_t*)(c))->notify = ((flg)&ERROR_NOTIFY)?1:0);} while(0)
+           (sh_context(c)->notify = ((flg)&ERROR_NOTIFY)?1:0);} while(0)
 #   endif
 #endif
 
--- old/usr/src/lib/libast/sparc/include/ast/sig.h      Fri Sep 25 06:11:32 2009
+++ new/usr/src/lib/libast/sparc/include/ast/sig.h      Fri Sep 25 06:11:30 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/sig.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/sig.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_sig_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/sparc/include/ast/stack.h    Fri Sep 25 06:11:35 2009
+++ new/usr/src/lib/libast/sparc/include/ast/stack.h    Fri Sep 25 06:11:33 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/stak.h     Fri Sep 25 06:11:38 2009
+++ new/usr/src/lib/libast/sparc/include/ast/stak.h     Fri Sep 25 06:11:36 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/stdio.h    Fri Sep 25 06:11:40 2009
+++ new/usr/src/lib/libast/sparc/include/ast/stdio.h    Fri Sep 25 06:11:39 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/stk.h      Fri Sep 25 06:11:43 2009
+++ new/usr/src/lib/libast/sparc/include/ast/stk.h      Fri Sep 25 06:11:41 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/swap.h     Fri Sep 25 06:11:46 2009
+++ new/usr/src/lib/libast/sparc/include/ast/swap.h     Fri Sep 25 06:11:44 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/tar.h      Fri Sep 25 06:11:48 2009
+++ new/usr/src/lib/libast/sparc/include/ast/tar.h      Fri Sep 25 06:11:47 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/times.h    Fri Sep 25 06:11:51 2009
+++ new/usr/src/lib/libast/sparc/include/ast/times.h    Fri Sep 25 06:11:49 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/tm.h       Fri Sep 25 06:11:54 2009
+++ new/usr/src/lib/libast/sparc/include/ast/tm.h       Fri Sep 25 06:11:52 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -102,8 +102,9 @@
 #define TM_ERA_YEAR            115
 #define TM_ORDINALS            116
 #define TM_FINAL               126
+#define TM_WORK                        129
 
-#define TM_NFORM               129
+#define TM_NFORM               132
 
 typedef struct                         /* leap second info             */
 {
@@ -123,7 +124,7 @@
 typedef struct                         /* tm library readonly data     */
 {
        char**          format;         /* default TM_* format strings  */
-       char*           lex;            /* format lex type classes      */
+       unsigned char*  lex;            /* format lex type classes      */
        char*           digit;          /* output digits                */
        short*          days;           /* days in month i              */
        short*          sum;            /* days in months before i      */
--- old/usr/src/lib/libast/sparc/include/ast/tmx.h      Fri Sep 25 06:11:57 2009
+++ new/usr/src/lib/libast/sparc/include/ast/tmx.h      Fri Sep 25 06:11:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/tmx
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/tmx
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TMX_H
 #if !defined(__PROTO__)
@@ -129,6 +129,7 @@
 #endif
 
 extern __MANGLE__ Time_t               tmxdate __PROTO__((const char*, char**, 
Time_t));
+extern __MANGLE__ Time_t               tmxduration __PROTO__((const char*, 
char**));
 extern __MANGLE__ char*                tmxfmt __PROTO__((char*, size_t, const 
char*, Time_t));
 extern __MANGLE__ Time_t               tmxleap __PROTO__((Time_t));
 extern __MANGLE__ Tm_t*                tmxmake __PROTO__((Time_t));
@@ -135,6 +136,7 @@
 extern __MANGLE__ Time_t               tmxscan __PROTO__((const char*, char**, 
const char*, char**, Time_t, long));
 extern __MANGLE__ int          tmxsleep __PROTO__((Time_t));
 extern __MANGLE__ Time_t               tmxtime __PROTO__((Tm_t*, int));
+extern __MANGLE__ Tm_t*                tmxtm __PROTO__((Tm_t*, Time_t, 
Tm_zone_t*));
 
 extern __MANGLE__ Time_t               tmxgettime __PROTO__((void));
 extern __MANGLE__ int          tmxsettime __PROTO__((Time_t));
--- old/usr/src/lib/libast/sparc/include/ast/tok.h      Fri Sep 25 06:11:59 2009
+++ new/usr/src/lib/libast/sparc/include/ast/tok.h      Fri Sep 25 06:11:57 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/tv.h       Fri Sep 25 06:12:02 2009
+++ new/usr/src/lib/libast/sparc/include/ast/tv.h       Fri Sep 25 06:12:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/tv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/tv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TV_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/include/ast/usage.h    Fri Sep 25 06:12:05 2009
+++ new/usr/src/lib/libast/sparc/include/ast/usage.h    Fri Sep 25 06:12:03 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/vdb.h      Fri Sep 25 06:12:07 2009
+++ new/usr/src/lib/libast/sparc/include/ast/vdb.h      Fri Sep 25 06:12:06 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/vecargs.h  Fri Sep 25 06:12:10 2009
+++ new/usr/src/lib/libast/sparc/include/ast/vecargs.h  Fri Sep 25 06:12:08 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/vmalloc.h  Fri Sep 25 06:12:13 2009
+++ new/usr/src/lib/libast/sparc/include/ast/vmalloc.h  Fri Sep 25 06:12:11 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/wait.h     Fri Sep 25 06:12:15 2009
+++ new/usr/src/lib/libast/sparc/include/ast/wait.h     Fri Sep 25 06:12:14 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/wchar.h    Fri Sep 25 06:12:18 2009
+++ new/usr/src/lib/libast/sparc/include/ast/wchar.h    Fri Sep 25 06:12:16 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/include/ast/wordexp.h  Fri Sep 25 06:12:21 2009
+++ new/usr/src/lib/libast/sparc/include/ast/wordexp.h  Fri Sep 25 06:12:19 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/align   Fri Sep 25 
06:12:24 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/align   Fri Sep 25 
06:12:22 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/align.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/align.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_align_ast
 #define _def_align_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/botch   Fri Sep 25 
06:12:26 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/botch   Fri Sep 25 
06:12:24 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/botch.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/botch.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_botch_ast
 #define _def_botch_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/ccode   Fri Sep 25 
06:12:29 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/ccode   Fri Sep 25 
06:12:27 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/ccode
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/ccode
 by iffe version 2009-05-01 : : */
 #ifndef _def_ccode_ast
 #define _def_ccode_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/common  Fri Sep 25 
06:12:32 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/common  Fri Sep 25 
06:12:30 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/common
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/common
 by iffe version 2009-05-01 : : */
 #ifndef _AST_COMMON_H
 #define _AST_COMMON_H  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -155,9 +155,6 @@
 #define _typ_uintmax_t 1       /* uintmax_t is a type */
 
 #ifndef va_listref
-#define va_listref(p) (p)      /* pass va_list to varargs function */
-#define va_listval(p) (p)      /* retrieve va_list from va_arg(ap,va_listarg) 
*/
-#define va_listarg va_list     /* va_arg() va_list type */
 #ifndef        va_start
 #if __STD_C
 #include <stdarg.h>
@@ -165,6 +162,9 @@
 #include <varargs.h>
 #endif
 #endif
+#define va_listref(p) (p)      /* pass va_list to varargs function */
+#define va_listval(p) (p)      /* retrieve va_list from va_arg(ap,va_listarg) 
*/
+#define va_listarg va_list     /* va_arg() va_list type */
 #endif
 #ifndef _AST_STD_H
 #      if __STD_C && _hdr_stddef
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/dirent  Fri Sep 25 
06:12:34 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/dirent  Fri Sep 25 
06:12:33 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/dirent
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/dirent
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_dirent_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/eaccess Fri Sep 25 
06:12:37 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/eaccess Fri Sep 25 
06:12:35 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/eaccess
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/eaccess
 by iffe version 2009-05-01 : : */
 #ifndef _def_eaccess_ast
 #define _def_eaccess_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/errno   Fri Sep 25 
06:12:40 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/errno   Fri Sep 25 
06:12:38 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/errno
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/errno
 by iffe version 2009-05-01 : : */
 #ifndef _def_errno_ast
 #define _def_errno_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/fcntl   Fri Sep 25 
06:12:42 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/fcntl   Fri Sep 25 
06:12:40 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/fcntl.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/fcntl.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_fcntl_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/float   Fri Sep 25 
06:12:45 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/float   Fri Sep 25 
06:12:43 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/float
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/float
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_float_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/fs      Fri Sep 25 
06:12:48 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/fs      Fri Sep 25 
06:12:46 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/fs
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/fs
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_fs_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/hack    Fri Sep 25 
06:12:50 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/hack    Fri Sep 25 
06:12:49 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/hack
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/hack
 by iffe version 2009-05-01 : : */
 #ifndef _def_hack_ast
 #define _def_hack_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/iconv   Fri Sep 25 
06:12:53 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/iconv   Fri Sep 25 
06:12:51 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/iconv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/iconv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_iconv_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/isoc99  Fri Sep 25 
06:12:56 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/isoc99  Fri Sep 25 
06:12:54 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/isoc99
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/isoc99
 by iffe version 2009-05-01 : : */
 #ifndef _def_isoc99_ast
 #define _def_isoc99_ast        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/lib     Fri Sep 25 
06:12:58 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/lib     Fri Sep 25 
06:12:57 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/lib
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/lib
 by iffe version 2009-05-01 : : */
 #ifndef _def_lib_ast
 #define _def_lib_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/libpath Fri Sep 25 
06:13:01 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/libpath Fri Sep 25 
06:12:59 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/libpath.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/libpath.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_libpath_ast
 #define _def_libpath_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/limits  Fri Sep 25 
06:13:04 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/limits  Fri Sep 25 
06:13:02 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/limits.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/limits.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_limits_ast
 #define _def_limits_ast        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/map     Fri Sep 25 
06:13:07 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/map     Fri Sep 25 
06:13:05 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/map.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/map.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_map_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
@@ -198,6 +198,8 @@
 #define pathposix      _ast_pathposix
 #undef pathprobe
 #define pathprobe      _ast_pathprobe
+#undef pathprog
+#define pathprog       _ast_pathprog
 #undef pathrepl
 #define pathrepl       _ast_pathrepl
 #undef pathsetlink
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mmap    Fri Sep 25 
06:13:09 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mmap    Fri Sep 25 
06:13:08 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/mmap
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/mmap
 by iffe version 2009-05-01 : : */
 #ifndef _def_mmap_ast
 #define _def_mmap_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -7,7 +7,7 @@
 #define _lib_mmap64    1       /* mmap64 interface and implementation work */
 #define _mmap_anon     1       /* use mmap MAP_ANON to get raw memory */
 #define _mmap_devzero  1       /* use mmap on /dev/zero to get raw memory */
-#define _mmap_worthy   1       /* mmap is good */
+#define _mmap_worthy   2       /* mmap is good */
 
 /* some systems get it wrong but escape concise detection */
 #ifndef _NO_MMAP
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mode    Fri Sep 25 
06:13:12 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mode    Fri Sep 25 
06:13:10 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/mode.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/mode.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_mode_ast
 #define _def_mode_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/ndbm    Fri Sep 25 
06:13:15 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/ndbm    Fri Sep 25 
06:13:13 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/ndbm
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/ndbm
 by iffe version 2009-05-01 : : */
 #ifndef _def_ndbm_ast
 #define _def_ndbm_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/nl_types        Fri Sep 
25 06:13:17 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/nl_types        Fri Sep 
25 06:13:16 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/nl_types
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/nl_types
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_nl_types_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/omitted Fri Sep 25 
06:13:20 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/omitted Fri Sep 25 
06:13:18 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/omitted
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/omitted
 by iffe version 2009-05-01 : : */
 #ifndef _def_omitted_ast
 #define _def_omitted_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/param   Fri Sep 25 
06:13:23 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/param   Fri Sep 25 
06:13:21 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/param.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/param.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_param_ast
 #define _def_param_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/preroot Fri Sep 25 
06:13:26 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/preroot Fri Sep 25 
06:13:24 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/preroot.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/preroot.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_preroot_ast
 #define _def_preroot_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- /dev/null   Fri Sep 25 06:13:28 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/prog    Fri Sep 25 
06:13:26 2009
@@ -0,0 +1,7 @@
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/prog
 by iffe version 2009-05-01 : : */
+#ifndef _def_prog_ast
+#define _def_prog_ast  1
+#define _sys_types     1       /* #include <sys/types.h> ok */
+#define _lib_getexecname       1       /* getexecname() in default lib(s) */
+#define _PROC_PROG     "/proc/self/path/a.out"
+#endif
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sfinit  Fri Sep 25 
06:13:31 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sfinit  Fri Sep 25 
06:13:29 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/sfinit.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/sfinit.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_sfinit_ast
 #define _def_sfinit_ast        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sfio    Fri Sep 25 
06:13:34 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sfio    Fri Sep 25 
06:13:32 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/sfio
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/sfio
 by iffe version 2009-05-01 : : */
 #ifndef _def_sfio_ast
 #define _def_sfio_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sig     Fri Sep 25 
06:13:37 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sig     Fri Sep 25 
06:13:35 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/sig.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/sig.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_sig_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/siglist Fri Sep 25 
06:13:40 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/siglist Fri Sep 25 
06:13:38 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/siglist
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/siglist
 by iffe version 2009-05-01 : : */
 #ifndef _def_siglist_ast
 #define _def_siglist_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -5,6 +5,9 @@
 #define _hdr_string    1       /* #include <string.h> ok */
 #define _hdr_signal    1       /* #include <signal.h> ok */
 #define _lib_strsignal 1       /* strsignal() in default lib(s) */
+#if defined(SIGHUP) && !defined(HAD_SIGHUP)
+0,"HUP",SIGHUP,
+#endif
 #if defined(SIGINT) && !defined(HAD_SIGINT)
 0,"INT",SIGINT,
 #endif
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/signal  Fri Sep 25 
06:13:42 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/signal  Fri Sep 25 
06:13:40 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/signal.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/signal.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_signal_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/standards       Fri Sep 
25 06:13:45 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/standards       Fri Sep 
25 06:13:43 2009
@@ -1,26 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/standards
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/standards
 by iffe version 2009-05-01 : : */
 #ifndef _def_standards_ast
 #define _def_standards_ast     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-/* _ALL_SOURCE & _ISOC99_SOURCE & _POSIX_SOURCE & _POSIX_C_SOURCE & 
_XOPEN_SOURCE & __EXTENSIONS__ works */
-#ifndef _ALL_SOURCE
-#define _ALL_SOURCE    1
-#endif
-#ifndef _ISOC99_SOURCE
-#define _ISOC99_SOURCE 1
-#endif
-#ifndef _POSIX_SOURCE
-#define _POSIX_SOURCE  1
-#endif
-#ifndef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE        21000101L
-#endif
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE  9900
-#endif
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE    1
-#endif
+/* __EXTENSIONS__ works */
 #ifndef __EXTENSIONS__
 #define __EXTENSIONS__ 1
 #endif
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/stdio   Fri Sep 25 
06:13:48 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/stdio   Fri Sep 25 
06:13:46 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/stdio
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/stdio
 by iffe version 2009-05-01 : : */
                   
 #ifndef _SFSTDIO_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sys     Fri Sep 25 
06:13:50 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sys     Fri Sep 25 
06:13:49 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/sys
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/sys
 by iffe version 2009-05-01 : : */
                   
 #ifndef _AST_SYS_H
 #if !defined(__PROTO__)
@@ -104,7 +104,6 @@
 #include <limits.h>
 #include <fcntl.h>
 #include <locale.h>
-#include <sys/localedef.h>
 #define _hdr_time      1       /* #include <time.h> ok */
 #define _sys_time      1       /* #include <sys/time.h> ok */
 #define _sys_times     1       /* #include <sys/times.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/time    Fri Sep 25 
06:13:53 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/time    Fri Sep 25 
06:13:51 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/time
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/time
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_time_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tmlib   Fri Sep 25 
06:13:56 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tmlib   Fri Sep 25 
06:13:54 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/tmlib
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/tmlib
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_tmlib_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tmx     Fri Sep 25 
06:13:59 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tmx     Fri Sep 25 
06:13:57 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/tmx
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/tmx
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TMX_H
 #if !defined(__PROTO__)
@@ -108,6 +108,7 @@
 #endif
 
 extern __MANGLE__ Time_t               tmxdate __PROTO__((const char*, char**, 
Time_t));
+extern __MANGLE__ Time_t               tmxduration __PROTO__((const char*, 
char**));
 extern __MANGLE__ char*                tmxfmt __PROTO__((char*, size_t, const 
char*, Time_t));
 extern __MANGLE__ Time_t               tmxleap __PROTO__((Time_t));
 extern __MANGLE__ Tm_t*                tmxmake __PROTO__((Time_t));
@@ -114,6 +115,7 @@
 extern __MANGLE__ Time_t               tmxscan __PROTO__((const char*, char**, 
const char*, char**, Time_t, long));
 extern __MANGLE__ int          tmxsleep __PROTO__((Time_t));
 extern __MANGLE__ Time_t               tmxtime __PROTO__((Tm_t*, int));
+extern __MANGLE__ Tm_t*                tmxtm __PROTO__((Tm_t*, Time_t, 
Tm_zone_t*));
 
 extern __MANGLE__ Time_t               tmxgettime __PROTO__((void));
 extern __MANGLE__ int          tmxsettime __PROTO__((Time_t));
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tty     Fri Sep 25 
06:14:01 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tty     Fri Sep 25 
06:13:59 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/tty
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/tty
 by iffe version 2009-05-01 : : */
 #ifndef _def_tty_ast
 #define _def_tty_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tv      Fri Sep 25 
06:14:04 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tv      Fri Sep 25 
06:14:02 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/tv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/tv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TV_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tvlib   Fri Sep 25 
06:14:07 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tvlib   Fri Sep 25 
06:14:05 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/tvlib
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/tvlib
 by iffe version 2009-05-01 : : */
 #ifndef _def_tvlib_ast
 #define _def_tvlib_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/uwin    Fri Sep 25 
06:14:09 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/uwin    Fri Sep 25 
06:14:08 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/uwin
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/uwin
 by iffe version 2009-05-01 : : */
 #ifndef _def_uwin_ast
 #define _def_uwin_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/vfork   Fri Sep 25 
06:14:12 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/vfork   Fri Sep 25 
06:14:10 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/vfork
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/vfork
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_vfork_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/vmalloc Fri Sep 25 
06:14:15 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/vmalloc Fri Sep 25 
06:14:13 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/vmalloc
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/vmalloc
 by iffe version 2009-05-01 : : */
 #ifndef _def_vmalloc_ast
 #define _def_vmalloc_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/wait    Fri Sep 25 
06:14:18 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/wait    Fri Sep 25 
06:14:16 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/wait
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/wait
 by iffe version 2009-05-01 : : */
 #ifndef _def_wait_ast
 #define _def_wait_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/wchar   Fri Sep 25 
06:14:20 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/wchar   Fri Sep 25 
06:14:18 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/wchar
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/wchar
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_wchar_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/src/lib/libast/align.h Fri Sep 25 06:14:23 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/align.h Fri Sep 25 06:14:21 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/align.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/align.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_align_ast
 #define _def_align_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_botch.h     Fri Sep 25 
06:14:26 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_botch.h     Fri Sep 25 
06:14:24 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/botch.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/botch.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_botch_ast
 #define _def_botch_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_ccode.h     Fri Sep 25 
06:14:28 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_ccode.h     Fri Sep 25 
06:14:27 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/ccode
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/ccode
 by iffe version 2009-05-01 : : */
 #ifndef _def_ccode_ast
 #define _def_ccode_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_common.h    Fri Sep 25 
06:14:31 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_common.h    Fri Sep 25 
06:14:29 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/common
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/common
 by iffe version 2009-05-01 : : */
 #ifndef _AST_COMMON_H
 #define _AST_COMMON_H  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -155,9 +155,6 @@
 #define _typ_uintmax_t 1       /* uintmax_t is a type */
 
 #ifndef va_listref
-#define va_listref(p) (p)      /* pass va_list to varargs function */
-#define va_listval(p) (p)      /* retrieve va_list from va_arg(ap,va_listarg) 
*/
-#define va_listarg va_list     /* va_arg() va_list type */
 #ifndef        va_start
 #if __STD_C
 #include <stdarg.h>
@@ -165,6 +162,9 @@
 #include <varargs.h>
 #endif
 #endif
+#define va_listref(p) (p)      /* pass va_list to varargs function */
+#define va_listval(p) (p)      /* retrieve va_list from va_arg(ap,va_listarg) 
*/
+#define va_listarg va_list     /* va_arg() va_list type */
 #endif
 #ifndef _AST_STD_H
 #      if __STD_C && _hdr_stddef
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_dirent.h    Fri Sep 25 
06:14:34 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_dirent.h    Fri Sep 25 
06:14:32 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/dirent
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/dirent
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_dirent_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_fcntl.h     Fri Sep 25 
06:14:36 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_fcntl.h     Fri Sep 25 
06:14:35 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/fcntl.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/fcntl.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_fcntl_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_float.h     Fri Sep 25 
06:14:39 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_float.h     Fri Sep 25 
06:14:37 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/float
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/float
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_float_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_fs.h        Fri Sep 25 
06:14:42 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_fs.h        Fri Sep 25 
06:14:40 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/fs
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/fs
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_fs_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_iconv.h     Fri Sep 25 
06:14:45 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_iconv.h     Fri Sep 25 
06:14:43 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/iconv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/iconv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_iconv_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_lib.h       Fri Sep 25 
06:14:47 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_lib.h       Fri Sep 25 
06:14:46 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/lib
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/lib
 by iffe version 2009-05-01 : : */
 #ifndef _def_lib_ast
 #define _def_lib_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_limits.h    Fri Sep 25 
06:14:50 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_limits.h    Fri Sep 25 
06:14:48 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/limits.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/limits.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_limits_ast
 #define _def_limits_ast        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_map.h       Fri Sep 25 
06:14:53 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_map.h       Fri Sep 25 
06:14:51 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/map.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/map.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_map_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
@@ -198,6 +198,8 @@
 #define pathposix      _ast_pathposix
 #undef pathprobe
 #define pathprobe      _ast_pathprobe
+#undef pathprog
+#define pathprog       _ast_pathprog
 #undef pathrepl
 #define pathrepl       _ast_pathrepl
 #undef pathsetlink
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_mmap.h      Fri Sep 25 
06:14:56 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_mmap.h      Fri Sep 25 
06:14:54 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/mmap
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/mmap
 by iffe version 2009-05-01 : : */
 #ifndef _def_mmap_ast
 #define _def_mmap_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -7,7 +7,7 @@
 #define _lib_mmap64    1       /* mmap64 interface and implementation work */
 #define _mmap_anon     1       /* use mmap MAP_ANON to get raw memory */
 #define _mmap_devzero  1       /* use mmap on /dev/zero to get raw memory */
-#define _mmap_worthy   1       /* mmap is good */
+#define _mmap_worthy   2       /* mmap is good */
 
 /* some systems get it wrong but escape concise detection */
 #ifndef _NO_MMAP
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_mode.h      Fri Sep 25 
06:14:58 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_mode.h      Fri Sep 25 
06:14:56 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/mode.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/mode.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_mode_ast
 #define _def_mode_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- /dev/null   Fri Sep 25 06:15:01 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_namval.h    Fri Sep 25 
06:14:59 2009
@@ -0,0 +1,42 @@
+/***********************************************************************
+*                                                                      *
+*               This software is part of the ast package               *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
+*                      and is licensed under the                       *
+*                  Common Public License, Version 1.0                  *
+*                    by AT&T Intellectual Property                     *
+*                                                                      *
+*                A copy of the License is available at                 *
+*            http://www.opensource.org/licenses/cpl1.0.txt             *
+*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
+*                                                                      *
+*              Information and Software Systems Research               *
+*                            AT&T Research                             *
+*                           Florham Park NJ                            *
+*                                                                      *
+*                 Glenn Fowler <gsf at research.att.com>                  *
+*                  David Korn <dgk at research.att.com>                   *
+*                   Phong Vo <kpv at research.att.com>                    *
+*                                                                      *
+***********************************************************************/
+#pragma prototyped
+/*
+ * Glenn Fowler
+ * AT&T Research
+ *
+ * common name-value struct support
+ */
+
+#ifndef _NAMVAL_H
+#define _NAMVAL_H
+
+typedef struct
+{
+       char*           name;
+       int             value;
+#ifdef _NAMVAL_PRIVATE_
+       _NAMVAL_PRIVATE_
+#endif
+} Namval_t;
+
+#endif
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_ndbm.h      Fri Sep 25 
06:15:03 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_ndbm.h      Fri Sep 25 
06:15:02 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/ndbm
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/ndbm
 by iffe version 2009-05-01 : : */
 #ifndef _def_ndbm_ast
 #define _def_ndbm_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_nl_types.h  Fri Sep 25 
06:15:06 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_nl_types.h  Fri Sep 25 
06:15:04 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/nl_types
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/nl_types
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_nl_types_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_param.h     Fri Sep 25 
06:15:09 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_param.h     Fri Sep 25 
06:15:07 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/param.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/param.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_param_ast
 #define _def_param_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_standards.h Fri Sep 25 
06:15:12 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_standards.h Fri Sep 25 
06:15:10 2009
@@ -1,26 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/standards
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/standards
 by iffe version 2009-05-01 : : */
 #ifndef _def_standards_ast
 #define _def_standards_ast     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-/* _ALL_SOURCE & _ISOC99_SOURCE & _POSIX_SOURCE & _POSIX_C_SOURCE & 
_XOPEN_SOURCE & __EXTENSIONS__ works */
-#ifndef _ALL_SOURCE
-#define _ALL_SOURCE    1
-#endif
-#ifndef _ISOC99_SOURCE
-#define _ISOC99_SOURCE 1
-#endif
-#ifndef _POSIX_SOURCE
-#define _POSIX_SOURCE  1
-#endif
-#ifndef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE        21000101L
-#endif
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE  9900
-#endif
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE    1
-#endif
+/* __EXTENSIONS__ works */
 #ifndef __EXTENSIONS__
 #define __EXTENSIONS__ 1
 #endif
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_stdio.h     Fri Sep 25 
06:15:14 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_stdio.h     Fri Sep 25 
06:15:12 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/stdio
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/stdio
 by iffe version 2009-05-01 : : */
                   
 #ifndef _SFSTDIO_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_sys.h       Fri Sep 25 
06:15:17 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_sys.h       Fri Sep 25 
06:15:15 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/sys
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/sys
 by iffe version 2009-05-01 : : */
                   
 #ifndef _AST_SYS_H
 #if !defined(__PROTO__)
@@ -104,7 +104,6 @@
 #include <limits.h>
 #include <fcntl.h>
 #include <locale.h>
-#include <sys/localedef.h>
 #define _hdr_time      1       /* #include <time.h> ok */
 #define _sys_time      1       /* #include <sys/time.h> ok */
 #define _sys_times     1       /* #include <sys/times.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_time.h      Fri Sep 25 
06:15:20 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_time.h      Fri Sep 25 
06:15:18 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/time
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/time
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_time_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_tty.h       Fri Sep 25 
06:15:22 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_tty.h       Fri Sep 25 
06:15:21 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/tty
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/tty
 by iffe version 2009-05-01 : : */
 #ifndef _def_tty_ast
 #define _def_tty_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_vfork.h     Fri Sep 25 
06:15:25 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_vfork.h     Fri Sep 25 
06:15:23 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/vfork
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/vfork
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_vfork_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_wait.h      Fri Sep 25 
06:15:28 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_wait.h      Fri Sep 25 
06:15:26 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/wait
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/wait
 by iffe version 2009-05-01 : : */
 #ifndef _def_wait_ast
 #define _def_wait_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/ast_wchar.h     Fri Sep 25 
06:15:31 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/ast_wchar.h     Fri Sep 25 
06:15:29 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/wchar
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/wchar
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_wchar_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparc/src/lib/libast/conftab.c       Fri Sep 25 
06:15:33 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/conftab.c       Fri Sep 25 
06:15:31 2009
@@ -10,7 +10,7 @@
 #include "FEATURE/param"
 #include "conftab.h"
 
-/* : : generated by conf from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/comp/conf.tab
 : : */
+/* : : generated by conf from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/comp/conf.tab
 : : */
 
 /*
  * prefix strings -- the first few are indexed by Conf_t.standard
@@ -207,6 +207,7 @@
 { "NL_TEXTMAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, 
-1 },
 { "NO_TRUNC", { 0ULL, 0 }, { 0ULL, 0 }, 
CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, 
_PC_NO_TRUNC },
 { "NPROCESSORS_CONF", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, 
_SC_NPROCESSORS_CONF },
+{ "NPROCESSORS_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, 
_SC_NPROCESSORS_MAX },
 { "NPROCESSORS_ONLN", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, 
_SC_NPROCESSORS_ONLN },
 { "NPROC_CONF", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, 
CONF_POSIX, 1, CONF_nop, -1 },
 { "NPROC_ONLN", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, 
CONF_POSIX, 1, CONF_nop, -1 },
--- old/usr/src/lib/libast/sparc/src/lib/libast/conftab.h       Fri Sep 25 
06:15:36 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/conftab.h       Fri Sep 25 
06:15:34 2009
@@ -6,7 +6,7 @@
 #endif
 #include <sys/systeminfo.h>
 
-/* : : generated by conf from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/comp/conf.tab
 : : */
+/* : : generated by conf from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/comp/conf.tab
 : : */
 
 #if !defined(const) && !defined(__STDC__) && !defined(__cplusplus) && 
!defined(c_plusplus)
 #define const
--- old/usr/src/lib/libast/sparc/src/lib/libast/lc.h    Fri Sep 25 06:15:39 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/lc.h    Fri Sep 25 06:15:37 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -38,14 +38,15 @@
 
 #define LC_abbreviated         0x00001
 #define LC_checked             0x00002
-#define LC_default             0x00004
-#define LC_defined             0x00008
-#define LC_debug               0x00010
+#define LC_debug               0x00004
+#define LC_default             0x00008
+#define LC_defined             0x00010
 #define LC_local               0x00020
 #define LC_primary             0x00040
 #define LC_qualified           0x00080
 #define LC_undefined           0x00100
-#define LC_verbose             0x00200
+#define LC_utf8                        0x00200
+#define LC_verbose             0x00400
 #define LC_user                        0x10000
 #define LC_language_attribute_max              2
 #define LC_territory_language_max              4
--- old/usr/src/lib/libast/sparc/src/lib/libast/preroot.h       Fri Sep 25 
06:15:42 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/preroot.h       Fri Sep 25 
06:15:40 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/preroot.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/preroot.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_preroot_ast
 #define _def_preroot_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparc/src/lib/libast/sig.h   Fri Sep 25 06:15:44 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/sig.h   Fri Sep 25 06:15:43 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/sig.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/sig.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_sig_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/sparc/src/lib/libast/tmx.h   Fri Sep 25 06:15:47 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/tmx.h   Fri Sep 25 06:15:45 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/tmx
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/tmx
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TMX_H
 #if !defined(__PROTO__)
@@ -108,6 +108,7 @@
 #endif
 
 extern __MANGLE__ Time_t               tmxdate __PROTO__((const char*, char**, 
Time_t));
+extern __MANGLE__ Time_t               tmxduration __PROTO__((const char*, 
char**));
 extern __MANGLE__ char*                tmxfmt __PROTO__((char*, size_t, const 
char*, Time_t));
 extern __MANGLE__ Time_t               tmxleap __PROTO__((Time_t));
 extern __MANGLE__ Tm_t*                tmxmake __PROTO__((Time_t));
@@ -114,6 +115,7 @@
 extern __MANGLE__ Time_t               tmxscan __PROTO__((const char*, char**, 
const char*, char**, Time_t, long));
 extern __MANGLE__ int          tmxsleep __PROTO__((Time_t));
 extern __MANGLE__ Time_t               tmxtime __PROTO__((Tm_t*, int));
+extern __MANGLE__ Tm_t*                tmxtm __PROTO__((Tm_t*, Time_t, 
Tm_zone_t*));
 
 extern __MANGLE__ Time_t               tmxgettime __PROTO__((void));
 extern __MANGLE__ int          tmxsettime __PROTO__((Time_t));
--- old/usr/src/lib/libast/sparc/src/lib/libast/tv.h    Fri Sep 25 06:15:50 2009
+++ new/usr/src/lib/libast/sparc/src/lib/libast/tv.h    Fri Sep 25 06:15:48 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/tv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libast/features/tv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TV_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/include/ast/align.h  Fri Sep 25 06:15:52 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/align.h  Fri Sep 25 06:15:51 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/align.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/align.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_align_ast
 #define _def_align_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/include/ast/ast.h    Fri Sep 25 06:15:55 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast.h    Fri Sep 25 06:15:53 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -185,7 +185,7 @@
 #define mbcoll()       (ast.mb_xfrm!=0)
 #define mbwide()       (mbmax()>1)
 
-#define mbchar(p)      
(mbwide()?((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),mbmax()))>0?((p+=ast.tmp_int),ast.tmp_wchar):(p++,ast.tmp_int)):(*(unsigned
 char*)(p++)))
+#define mbchar(p)      
(mbwide()?((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),mbmax()))>0?((p+=ast.tmp_int),ast.tmp_wchar):(p+=ast.mb_sync+1,ast.tmp_int)):(*(unsigned
 char*)(p++)))
 #define mbinit()       
(mbwide()?(*ast.mb_towc)((wchar_t*)0,(char*)0,mbmax()):0)
 #define mbsize(p)      (mbwide()?(*ast.mb_len)((char*)(p),mbmax()):((p),1))
 #define mbconv(s,w)    (ast.mb_conv?(*ast.mb_conv)(s,w):((*(s)=(w)),1))
@@ -309,6 +309,7 @@
 extern __MANGLE__ char*                pathpath __PROTO__((char*, const char*, 
const char*, int));
 extern __MANGLE__ size_t               pathposix __PROTO__((const char*, 
char*, size_t));
 extern __MANGLE__ char*                pathprobe __PROTO__((char*, char*, 
const char*, const char*, const char*, int));
+extern __MANGLE__ size_t               pathprog __PROTO__((const char*, char*, 
size_t));
 extern __MANGLE__ char*                pathrepl __PROTO__((char*, const char*, 
const char*));
 extern __MANGLE__ int          pathsetlink __PROTO__((const char*, const 
char*));
 extern __MANGLE__ char*                pathshell __PROTO__((void));
@@ -329,6 +330,7 @@
 extern __MANGLE__ int          strmode __PROTO__((const char*));
 extern __MANGLE__ int          strnacmp __PROTO__((const char*, const char*, 
size_t));
 extern __MANGLE__ char*                strncopy __PROTO__((char*, const char*, 
size_t));
+extern __MANGLE__ int          strnpcmp __PROTO__((const char*, const char*, 
size_t));
 extern __MANGLE__ double               strntod __PROTO__((const char*, size_t, 
char**));
 extern __MANGLE__ _ast_fltmax_t        strntold __PROTO__((const char*, 
size_t, char**));
 extern __MANGLE__ long         strntol __PROTO__((const char*, size_t, char**, 
int));
@@ -337,7 +339,9 @@
 extern __MANGLE__ unsigned long        strntoul __PROTO__((const char*, 
size_t, char**, int));
 extern __MANGLE__ intmax_t             strntonll __PROTO__((const char*, 
size_t, char**, char*, int));
 extern __MANGLE__ uintmax_t    strntoull __PROTO__((const char*, size_t, 
char**, int));
+extern __MANGLE__ int          strnvcmp __PROTO__((const char*, const char*, 
size_t));
 extern __MANGLE__ int          stropt __PROTO__((const char*, const __V_*, 
int, int(*)(__V_*, const __V_*, int, const char*), __V_*));
+extern __MANGLE__ int          strpcmp __PROTO__((const char*, const char*));
 extern __MANGLE__ int          strperm __PROTO__((const char*, char**, int));
 extern __MANGLE__ __V_*                strpsearch __PROTO__((const __V_*, 
size_t, size_t, const char*, char**));
 extern __MANGLE__ __V_*                strsearch __PROTO__((const __V_*, 
size_t, size_t, Strcmp_f, const char*, __V_*));
@@ -350,6 +354,7 @@
 extern __MANGLE__ intmax_t             strtonll __PROTO__((const char*, 
char**, char*, int));
 extern __MANGLE__ int          struid __PROTO__((const char*));
 extern __MANGLE__ int          struniq __PROTO__((char**, int));
+extern __MANGLE__ int          strvcmp __PROTO__((const char*, const char*));
 
 #undef __MANGLE__
 #define __MANGLE__ __LINKAGE__
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_botch.h      Fri Sep 25 
06:15:58 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_botch.h      Fri Sep 25 
06:15:56 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/botch.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/botch.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_botch_ast
 #define _def_botch_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_ccode.h      Fri Sep 25 
06:16:01 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_ccode.h      Fri Sep 25 
06:15:59 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/ccode
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/ccode
 by iffe version 2009-05-01 : : */
 #ifndef _def_ccode_ast
 #define _def_ccode_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_common.h     Fri Sep 25 
06:16:03 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_common.h     Fri Sep 25 
06:16:02 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/common
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/common
 by iffe version 2009-05-01 : : */
 #ifndef _AST_COMMON_H
 #define _AST_COMMON_H  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -177,9 +177,6 @@
 #define _typ_uintmax_t 1       /* uintmax_t is a type */
 
 #ifndef va_listref
-#define va_listref(p) (p)      /* pass va_list to varargs function */
-#define va_listval(p) (p)      /* retrieve va_list from va_arg(ap,va_listarg) 
*/
-#define va_listarg va_list     /* va_arg() va_list type */
 #ifndef        va_start
 #if __STD_C
 #include <stdarg.h>
@@ -187,6 +184,9 @@
 #include <varargs.h>
 #endif
 #endif
+#define va_listref(p) (p)      /* pass va_list to varargs function */
+#define va_listval(p) (p)      /* retrieve va_list from va_arg(ap,va_listarg) 
*/
+#define va_listarg va_list     /* va_arg() va_list type */
 #endif
 #ifndef _AST_STD_H
 #      if __STD_C && _hdr_stddef
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_dir.h        Fri Sep 25 
06:16:06 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_dir.h        Fri Sep 25 
06:16:04 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_dirent.h     Fri Sep 25 
06:16:09 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_dirent.h     Fri Sep 25 
06:16:07 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/dirent
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/dirent
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_dirent_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_fcntl.h      Fri Sep 25 
06:16:12 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_fcntl.h      Fri Sep 25 
06:16:10 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/fcntl.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/fcntl.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_fcntl_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_float.h      Fri Sep 25 
06:16:14 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_float.h      Fri Sep 25 
06:16:13 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/float
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/float
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_float_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_fs.h Fri Sep 25 06:16:17 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_fs.h Fri Sep 25 06:16:15 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/fs
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/fs
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_fs_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_iconv.h      Fri Sep 25 
06:16:20 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_iconv.h      Fri Sep 25 
06:16:18 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/iconv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/iconv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_iconv_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_lib.h        Fri Sep 25 
06:16:22 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_lib.h        Fri Sep 25 
06:16:21 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/lib
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/lib
 by iffe version 2009-05-01 : : */
 #ifndef _def_lib_ast
 #define _def_lib_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_limits.h     Fri Sep 25 
06:16:25 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_limits.h     Fri Sep 25 
06:16:23 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/limits.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/limits.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_limits_ast
 #define _def_limits_ast        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_map.h        Fri Sep 25 
06:16:28 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_map.h        Fri Sep 25 
06:16:26 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/map.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/map.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_map_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
@@ -219,6 +219,8 @@
 #define pathposix      _ast_pathposix
 #undef pathprobe
 #define pathprobe      _ast_pathprobe
+#undef pathprog
+#define pathprog       _ast_pathprog
 #undef pathrepl
 #define pathrepl       _ast_pathrepl
 #undef pathsetlink
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_mmap.h       Fri Sep 25 
06:16:31 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_mmap.h       Fri Sep 25 
06:16:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/mmap
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/mmap
 by iffe version 2009-05-01 : : */
 #ifndef _def_mmap_ast
 #define _def_mmap_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -28,6 +28,7 @@
 #define _lib_mmap64    1       /* mmap64 interface and implementation work */
 #define _mmap_anon     1       /* use mmap MAP_ANON to get raw memory */
 #define _mmap_devzero  1       /* use mmap on /dev/zero to get raw memory */
+#define _mmap_worthy   2       /* mmap is good */
 
 /* some systems get it wrong but escape concise detection */
 #ifndef _NO_MMAP
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_mode.h       Fri Sep 25 
06:16:34 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_mode.h       Fri Sep 25 
06:16:32 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/mode.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/mode.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_mode_ast
 #define _def_mode_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_namval.h     Fri Sep 25 
06:16:36 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_namval.h     Fri Sep 25 
06:16:34 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_ndbm.h       Fri Sep 25 
06:16:39 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_ndbm.h       Fri Sep 25 
06:16:37 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/ndbm
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/ndbm
 by iffe version 2009-05-01 : : */
 #ifndef _def_ndbm_ast
 #define _def_ndbm_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_nl_types.h   Fri Sep 25 
06:16:42 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_nl_types.h   Fri Sep 25 
06:16:40 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/nl_types
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/nl_types
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_nl_types_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_param.h      Fri Sep 25 
06:16:45 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_param.h      Fri Sep 25 
06:16:43 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/param.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/param.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_param_ast
 #define _def_param_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_standards.h  Fri Sep 25 
06:16:47 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_standards.h  Fri Sep 25 
06:16:45 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,29 +19,11 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/standards
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/standards
 by iffe version 2009-05-01 : : */
 #ifndef _def_standards_ast
 #define _def_standards_ast     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-/* _ALL_SOURCE & _ISOC99_SOURCE & _POSIX_SOURCE & _POSIX_C_SOURCE & 
_XOPEN_SOURCE & __EXTENSIONS__ works */
-#ifndef _ALL_SOURCE
-#define _ALL_SOURCE    1
-#endif
-#ifndef _ISOC99_SOURCE
-#define _ISOC99_SOURCE 1
-#endif
-#ifndef _POSIX_SOURCE
-#define _POSIX_SOURCE  1
-#endif
-#ifndef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE        21000101L
-#endif
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE  9900
-#endif
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE    1
-#endif
+/* __EXTENSIONS__ works */
 #ifndef __EXTENSIONS__
 #define __EXTENSIONS__ 1
 #endif
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_std.h        Fri Sep 25 
06:16:50 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_std.h        Fri Sep 25 
06:16:48 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -117,9 +117,18 @@
 #define __MANGLE__ __LINKAGE__         __EXPORT__
 #endif
 
+#if !_UWIN /* for ast54 compatibility */
+
 #undef getenv
 #define getenv         _ast_getenv
 
+#undef setenviron
+#define setenviron     _ast_setenviron
+
+extern __MANGLE__ char*                getenv __PROTO__((const char*));
+
+#endif
+
 #undef localeconv
 #define localeconv     _ast_localeconv
 
@@ -126,13 +135,9 @@
 #undef setlocale
 #define setlocale      _ast_setlocale
 
-#undef setenviron
-#define setenviron     _ast_setenviron
-
 #undef strerror
 #define strerror       _ast_strerror
 
-extern __MANGLE__ char*                getenv __PROTO__((const char*));
 extern __MANGLE__ struct lconv*        localeconv __PROTO__((void));
 extern __MANGLE__ char*                setenviron __PROTO__((const char*));
 extern __MANGLE__ char*                setlocale __PROTO__((int, const char*));
@@ -248,8 +253,9 @@
        int             (*mb_conv) __PROTO__((char*, wchar_t));
 
        uint32_t        env_serial;
+       uint32_t        mb_sync;
 
-       char            pad[944];
+       char            pad[940];
 
 } _Ast_info_t;
 
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_stdio.h      Fri Sep 25 
06:16:53 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_stdio.h      Fri Sep 25 
06:16:51 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/stdio
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/stdio
 by iffe version 2009-05-01 : : */
                   
 #ifndef _SFSTDIO_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_sys.h        Fri Sep 25 
06:16:56 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_sys.h        Fri Sep 25 
06:16:54 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/sys
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/sys
 by iffe version 2009-05-01 : : */
                   
 #ifndef _AST_SYS_H
 #if !defined(__PROTO__)
@@ -125,7 +125,6 @@
 #include <limits.h>
 #include <fcntl.h>
 #include <locale.h>
-#include <sys/localedef.h>
 #define _hdr_time      1       /* #include <time.h> ok */
 #define _sys_time      1       /* #include <sys/time.h> ok */
 #define _sys_times     1       /* #include <sys/times.h> ok */
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_time.h       Fri Sep 25 
06:16:58 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_time.h       Fri Sep 25 
06:16:57 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/time
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/time
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_time_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_tty.h        Fri Sep 25 
06:17:01 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_tty.h        Fri Sep 25 
06:16:59 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/tty
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/tty
 by iffe version 2009-05-01 : : */
 #ifndef _def_tty_ast
 #define _def_tty_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_version.h    Fri Sep 25 
06:17:04 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_version.h    Fri Sep 25 
06:17:02 2009
@@ -7,4 +7,4 @@
 #if !defined(__LINKAGE__)
 #define __LINKAGE__            /* 2004-08-11 transition */
 #endif
-#define _AST_VERSION   20080910L
+#define _AST_VERSION   20090202L
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_vfork.h      Fri Sep 25 
06:17:07 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_vfork.h      Fri Sep 25 
06:17:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/vfork
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/vfork
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_vfork_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_wait.h       Fri Sep 25 
06:17:09 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_wait.h       Fri Sep 25 
06:17:07 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/wait
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/wait
 by iffe version 2009-05-01 : : */
 #ifndef _def_wait_ast
 #define _def_wait_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_wchar.h      Fri Sep 25 
06:17:12 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_wchar.h      Fri Sep 25 
06:17:10 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/wchar
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/wchar
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_wchar_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/include/ast/ast_windows.h    Fri Sep 25 
06:17:15 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ast_windows.h    Fri Sep 25 
06:17:13 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/bytesex.h        Fri Sep 25 
06:17:18 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/bytesex.h        Fri Sep 25 
06:17:16 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/ccode.h  Fri Sep 25 06:17:20 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ccode.h  Fri Sep 25 06:17:18 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/cdt.h    Fri Sep 25 06:17:23 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/cdt.h    Fri Sep 25 06:17:21 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/debug.h  Fri Sep 25 06:17:26 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/debug.h  Fri Sep 25 06:17:24 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -55,14 +55,17 @@
 #define DEBUG_ASSERT(p)                ((p) ? 0 : (debug_fatal(__FILE__, 
__LINE__),0))
 #define DEBUG_COUNT(n)         ((n) += 1)
 #define DEBUG_TALLY(c,n,v)     ((c) ? ((n) += (v)) : (n))
+#define DEBUG_INCREASE(n)      ((n) += 1)
+#define DEBUG_DECREASE(n)      ((n) -= 1)
 #define DEBUG_DECLARE(t,v)     t v
 #define DEBUG_SET(n,v)         ((n) = (v))
 #define DEBUG_PRINT(fd,s,v)    do {char 
_b[1024];write(fd,_b,sfsprintf(_b,sizeof(_b),s,v));} while(0)
 #define DEBUG_WRITE(fd,d,n)    write((fd),(d),(n))
 #define DEBUG_TEMP(temp)       (temp) /* debugging stuff that should be 
removed */
-#define DEBUG_RETURN(x)                (debug_fatal(__FILE__, __LINE__), (x))
-#define DEBUG_BREAK            (debug_fatal(__FILE__, __LINE__))
+#define DEBUG_BREAK            break
+#define DEBUG_CONTINUE         continue
 #define DEBUG_GOTO(label)      do { debug_fatal(__FILE__, __LINE__); goto 
label; } while(0)
+#define DEBUG_RETURN(x)                do { debug_fatal(__FILE__, __LINE__); 
return(x); } while(0)
 
 #else
 
@@ -75,17 +78,33 @@
 #define DEBUG_ASSERT(p)
 #define DEBUG_COUNT(n)
 #define DEBUG_TALLY(c,n,v)
+#define DEBUG_INCREASE(n)
+#define DEBUG_DECREASE(n)
 #define DEBUG_DECLARE(t,v)
 #define DEBUG_SET(n,v)
 #define DEBUG_PRINT(fd,s,v)
 #define DEBUG_WRITE(fd,d,n)
-#define DEBUG_KPV(x)
-#define DEBUG_RETURN(x)                return(x)
+#define DEBUG_TEMP(x)
 #define DEBUG_BREAK            break
+#define DEBUG_CONTINUE         continue
 #define DEBUG_GOTO(label)      goto label
+#define DEBUG_RETURN(x)                return(x)
 
 #endif
 
+#ifndef BREAK
+#define BREAK                  DEBUG_BREAK
+#endif
+#ifndef CONTINUE
+#define CONTINUE               DEBUG_CONTINUE
+#endif
+#ifndef GOTO
+#define GOTO(label)            DEBUG_GOTO(label)
+#endif
+#ifndef RETURN
+#define RETURN(x)              DEBUG_RETURN(x)
+#endif
+
 #if _BLD_ast && defined(__EXPORT__)
 #undef __MANGLE__
 #define __MANGLE__ __LINKAGE__         __EXPORT__
--- old/usr/src/lib/libast/sparcv9/include/ast/dirent.h Fri Sep 25 06:17:29 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/dirent.h Fri Sep 25 06:17:27 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/dt.h     Fri Sep 25 06:17:31 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/dt.h     Fri Sep 25 06:17:29 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/endian.h Fri Sep 25 06:17:34 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/endian.h Fri Sep 25 06:17:32 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/error.h  Fri Sep 25 06:17:37 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/error.h  Fri Sep 25 06:17:35 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/find.h   Fri Sep 25 06:17:39 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/find.h   Fri Sep 25 06:17:38 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/fnmatch.h        Fri Sep 25 
06:17:42 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/fnmatch.h        Fri Sep 25 
06:17:40 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/fnv.h    Fri Sep 25 06:17:45 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/fnv.h    Fri Sep 25 06:17:43 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/fs3d.h   Fri Sep 25 06:17:48 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/fs3d.h   Fri Sep 25 06:17:46 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -104,7 +104,9 @@
 #define FS3D_SIZE(n)   ((n)<<4)
 #define FS3D_SIZEOF(n) ((n)>>4)
 
-extern __MANGLE__ int          mount __PROTO__((const char*, char*, int, 
__V_*));
+#if !_BLD_3d
+#define mount(s,t,f,d) fs3d_mount(s,t,f,d)
+#endif
 
 #if _BLD_ast && defined(__EXPORT__)
 #undef __MANGLE__
@@ -112,6 +114,7 @@
 #endif
 
 extern __MANGLE__ int          fs3d __PROTO__((int));
+extern __MANGLE__ int          fs3d_mount __PROTO__((const char*, char*, int, 
__V_*));
 extern __MANGLE__ char*                pathnext __PROTO__((char*, char*, 
long*));
 
 #undef __MANGLE__
--- old/usr/src/lib/libast/sparcv9/include/ast/fts.h    Fri Sep 25 06:17:50 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/fts.h    Fri Sep 25 06:17:49 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/ftw.h    Fri Sep 25 06:17:53 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ftw.h    Fri Sep 25 06:17:51 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/ftwalk.h Fri Sep 25 06:17:56 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ftwalk.h Fri Sep 25 06:17:54 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/glob.h   Fri Sep 25 06:17:59 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/glob.h   Fri Sep 25 06:17:57 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/hash.h   Fri Sep 25 06:18:02 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/hash.h   Fri Sep 25 06:18:00 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/hashkey.h        Fri Sep 25 
06:18:04 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/hashkey.h        Fri Sep 25 
06:18:02 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/hashpart.h       Fri Sep 25 
06:18:07 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/hashpart.h       Fri Sep 25 
06:18:05 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/iconv.h  Fri Sep 25 06:18:10 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/iconv.h  Fri Sep 25 06:18:08 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/lc.h     Fri Sep 25 06:18:12 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/lc.h     Fri Sep 25 06:18:11 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -38,14 +38,15 @@
 
 #define LC_abbreviated         0x00001
 #define LC_checked             0x00002
-#define LC_default             0x00004
-#define LC_defined             0x00008
-#define LC_debug               0x00010
+#define LC_debug               0x00004
+#define LC_default             0x00008
+#define LC_defined             0x00010
 #define LC_local               0x00020
 #define LC_primary             0x00040
 #define LC_qualified           0x00080
 #define LC_undefined           0x00100
-#define LC_verbose             0x00200
+#define LC_utf8                        0x00200
+#define LC_verbose             0x00400
 #define LC_user                        0x10000
 #define LC_language_attribute_max              2
 #define LC_territory_language_max              4
--- old/usr/src/lib/libast/sparcv9/include/ast/ls.h     Fri Sep 25 06:18:15 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/ls.h     Fri Sep 25 06:18:13 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -76,8 +76,8 @@
 #define LS_USER                (1<<10)         /* first user flag bit          
*/
 
 #define LS_W_BLOCKS    6               /* LS_BLOCKS field width        */
-#define LS_W_INUMBER   7               /* LS_INUMBER field width       */
-#define LS_W_LONG      55              /* LS_LONG width (w/o names)    */
+#define LS_W_INUMBER   9               /* LS_INUMBER field width       */
+#define LS_W_LONG      57              /* LS_LONG width (w/o names)    */
 #define LS_W_LINK      4               /* link text width (w/o names)  */
 #define LS_W_MARK      1               /* LS_MARK field width          */
 #define LS_W_NAME      9               /* group|user name field width  */
--- old/usr/src/lib/libast/sparcv9/include/ast/magic.h  Fri Sep 25 06:18:18 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/magic.h  Fri Sep 25 06:18:16 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/magicid.h        Fri Sep 25 
06:18:21 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/magicid.h        Fri Sep 25 
06:18:19 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/mc.h     Fri Sep 25 06:18:23 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/mc.h     Fri Sep 25 06:18:22 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/mime.h   Fri Sep 25 06:18:26 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/mime.h   Fri Sep 25 06:18:24 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/mnt.h    Fri Sep 25 06:18:29 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/mnt.h    Fri Sep 25 06:18:27 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/modecanon.h      Fri Sep 25 
06:18:32 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/modecanon.h      Fri Sep 25 
06:18:30 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/modex.h  Fri Sep 25 06:18:34 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/modex.h  Fri Sep 25 06:18:33 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/namval.h Fri Sep 25 06:18:37 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/namval.h Fri Sep 25 06:18:35 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/nl_types.h       Fri Sep 25 
06:18:40 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/nl_types.h       Fri Sep 25 
06:18:38 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/option.h Fri Sep 25 06:18:43 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/option.h Fri Sep 25 06:18:41 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/preroot.h        Fri Sep 25 
06:18:45 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/preroot.h        Fri Sep 25 
06:18:43 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -19,7 +19,7 @@
 *                   Phong Vo <kpv at research.att.com>                    *
 *                                                                      *
 ***********************************************************************/
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/preroot.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/preroot.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_preroot_ast
 #define _def_preroot_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/include/ast/proc.h   Fri Sep 25 06:18:48 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/proc.h   Fri Sep 25 06:18:46 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/re_comp.h        Fri Sep 25 
06:18:51 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/re_comp.h        Fri Sep 25 
06:18:49 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/recfmt.h Fri Sep 25 06:18:54 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/recfmt.h Fri Sep 25 06:18:52 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/regex.h  Fri Sep 25 06:18:56 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/regex.h  Fri Sep 25 06:18:55 2009
@@ -53,6 +53,8 @@
 #define REG_SHELL_ESCAPED 0x00400000   /* \ not special                */
 #define REG_SHELL_PATH 0x00800000      /* explicit / match             */
 
+#define REG_REGEXP     0x40000000      /* <regexp.h> compatibility     */
+
 /* regexec flags */
 
 #define REG_NOTBOL     0x00000040      /* ^ is not a special char      */
--- old/usr/src/lib/libast/sparcv9/include/ast/regexp.h Fri Sep 25 06:18:59 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/regexp.h Fri Sep 25 06:18:57 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/sfdisc.h Fri Sep 25 06:19:02 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/sfdisc.h Fri Sep 25 06:19:00 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/sfio.h   Fri Sep 25 06:19:05 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/sfio.h   Fri Sep 25 06:19:03 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/sfio_s.h Fri Sep 25 06:19:07 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/sfio_s.h Fri Sep 25 06:19:06 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/sfio_t.h Fri Sep 25 06:19:10 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/sfio_t.h Fri Sep 25 06:19:08 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/shcmd.h  Fri Sep 25 06:19:13 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/shcmd.h  Fri Sep 25 06:19:11 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -75,18 +75,19 @@
 #   undef Shell_t
 #   undef Namval_t
 #else 
-#   define sh_run(c, ac, av)   ((c)?(*((Shbltin_t*)(c))->shrun)(ac,av):-1)
-#   define sh_system(c,str)    
((c)?(*((Shbltin_t*)(c))->shtrap)(str,0):system(str))
-#   define sh_exit(c,n)                
((c)?(*((Shbltin_t*)(c))->shexit)(n):exit(n))
-#   define sh_checksig(c)      ((c) && ((Shbltin_t*)(c))->sigset)
+#   define sh_context(c)       ((Shbltin_t*)(c))
+#   define sh_run(c, ac, av)   ((c)?(*sh_context(c)->shrun)(ac,av):-1)
+#   define sh_system(c,str)    
((c)?(*sh_context(c)->shtrap)(str,0):system(str))
+#   define sh_exit(c,n)                
((c)?(*sh_context(c)->shexit)(n):exit(n))
+#   define sh_checksig(c)      ((c) && sh_context(c)->sigset)
 #   if defined(SFIO_VERSION) || defined(_AST_H)
 #      define LIB_INIT(c)
 #   else
-#      define LIB_INIT(c)      ((c) && (((Shbltin_t*)(c))->nosfio = 1))
+#      define LIB_INIT(c)      ((c) && (sh_context(c)->nosfio = 1))
 #   endif
 #   ifndef _CMD_H
 #      define cmdinit(ac,av,c,cat,flg)         do { if((ac)<=0) return(0); \
-           (((Shbltin_t*)(c))->notify = ((flg)&ERROR_NOTIFY)?1:0);} while(0)
+           (sh_context(c)->notify = ((flg)&ERROR_NOTIFY)?1:0);} while(0)
 #   endif
 #endif
 
--- old/usr/src/lib/libast/sparcv9/include/ast/sig.h    Fri Sep 25 06:19:16 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/sig.h    Fri Sep 25 06:19:14 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/sig.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/sig.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_sig_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/sparcv9/include/ast/stack.h  Fri Sep 25 06:19:18 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/stack.h  Fri Sep 25 06:19:17 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/stak.h   Fri Sep 25 06:19:21 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/stak.h   Fri Sep 25 06:19:19 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/stdio.h  Fri Sep 25 06:19:24 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/stdio.h  Fri Sep 25 06:19:22 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/stk.h    Fri Sep 25 06:19:27 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/stk.h    Fri Sep 25 06:19:25 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/swap.h   Fri Sep 25 06:19:29 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/swap.h   Fri Sep 25 06:19:28 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/tar.h    Fri Sep 25 06:19:32 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/tar.h    Fri Sep 25 06:19:30 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/times.h  Fri Sep 25 06:19:35 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/times.h  Fri Sep 25 06:19:33 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/tm.h     Fri Sep 25 06:19:38 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/tm.h     Fri Sep 25 06:19:36 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -102,8 +102,9 @@
 #define TM_ERA_YEAR            115
 #define TM_ORDINALS            116
 #define TM_FINAL               126
+#define TM_WORK                        129
 
-#define TM_NFORM               129
+#define TM_NFORM               132
 
 typedef struct                         /* leap second info             */
 {
@@ -123,7 +124,7 @@
 typedef struct                         /* tm library readonly data     */
 {
        char**          format;         /* default TM_* format strings  */
-       char*           lex;            /* format lex type classes      */
+       unsigned char*  lex;            /* format lex type classes      */
        char*           digit;          /* output digits                */
        short*          days;           /* days in month i              */
        short*          sum;            /* days in months before i      */
--- old/usr/src/lib/libast/sparcv9/include/ast/tmx.h    Fri Sep 25 06:19:41 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/tmx.h    Fri Sep 25 06:19:39 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/tmx
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/tmx
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TMX_H
 #if !defined(__PROTO__)
@@ -129,6 +129,7 @@
 #endif
 
 extern __MANGLE__ Time_t               tmxdate __PROTO__((const char*, char**, 
Time_t));
+extern __MANGLE__ Time_t               tmxduration __PROTO__((const char*, 
char**));
 extern __MANGLE__ char*                tmxfmt __PROTO__((char*, size_t, const 
char*, Time_t));
 extern __MANGLE__ Time_t               tmxleap __PROTO__((Time_t));
 extern __MANGLE__ Tm_t*                tmxmake __PROTO__((Time_t));
@@ -135,6 +136,7 @@
 extern __MANGLE__ Time_t               tmxscan __PROTO__((const char*, char**, 
const char*, char**, Time_t, long));
 extern __MANGLE__ int          tmxsleep __PROTO__((Time_t));
 extern __MANGLE__ Time_t               tmxtime __PROTO__((Tm_t*, int));
+extern __MANGLE__ Tm_t*                tmxtm __PROTO__((Tm_t*, Time_t, 
Tm_zone_t*));
 
 extern __MANGLE__ Time_t               tmxgettime __PROTO__((void));
 extern __MANGLE__ int          tmxsettime __PROTO__((Time_t));
--- old/usr/src/lib/libast/sparcv9/include/ast/tok.h    Fri Sep 25 06:19:43 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/tok.h    Fri Sep 25 06:19:42 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/tv.h     Fri Sep 25 06:19:46 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/tv.h     Fri Sep 25 06:19:44 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 ***********************************************************************/
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/tv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/tv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TV_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/include/ast/usage.h  Fri Sep 25 06:19:49 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/usage.h  Fri Sep 25 06:19:47 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/vdb.h    Fri Sep 25 06:19:52 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/vdb.h    Fri Sep 25 06:19:50 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/vecargs.h        Fri Sep 25 
06:19:54 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/vecargs.h        Fri Sep 25 
06:19:53 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/vmalloc.h        Fri Sep 25 
06:19:57 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/vmalloc.h        Fri Sep 25 
06:19:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/wait.h   Fri Sep 25 06:20:00 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/wait.h   Fri Sep 25 06:19:58 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/wchar.h  Fri Sep 25 06:20:03 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/wchar.h  Fri Sep 25 06:20:01 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/include/ast/wordexp.h        Fri Sep 25 
06:20:05 2009
+++ new/usr/src/lib/libast/sparcv9/include/ast/wordexp.h        Fri Sep 25 
06:20:04 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/align Fri Sep 25 
06:20:08 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/align Fri Sep 25 
06:20:06 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/align.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/align.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_align_ast
 #define _def_align_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/botch Fri Sep 25 
06:20:11 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/botch Fri Sep 25 
06:20:09 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/botch.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/botch.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_botch_ast
 #define _def_botch_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/ccode Fri Sep 25 
06:20:14 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/ccode Fri Sep 25 
06:20:12 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/ccode
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/ccode
 by iffe version 2009-05-01 : : */
 #ifndef _def_ccode_ast
 #define _def_ccode_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/common        Fri Sep 
25 06:20:16 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/common        Fri Sep 
25 06:20:15 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/common
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/common
 by iffe version 2009-05-01 : : */
 #ifndef _AST_COMMON_H
 #define _AST_COMMON_H  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -156,9 +156,6 @@
 #define _typ_uintmax_t 1       /* uintmax_t is a type */
 
 #ifndef va_listref
-#define va_listref(p) (p)      /* pass va_list to varargs function */
-#define va_listval(p) (p)      /* retrieve va_list from va_arg(ap,va_listarg) 
*/
-#define va_listarg va_list     /* va_arg() va_list type */
 #ifndef        va_start
 #if __STD_C
 #include <stdarg.h>
@@ -166,6 +163,9 @@
 #include <varargs.h>
 #endif
 #endif
+#define va_listref(p) (p)      /* pass va_list to varargs function */
+#define va_listval(p) (p)      /* retrieve va_list from va_arg(ap,va_listarg) 
*/
+#define va_listarg va_list     /* va_arg() va_list type */
 #endif
 #ifndef _AST_STD_H
 #      if __STD_C && _hdr_stddef
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/dirent        Fri Sep 
25 06:20:19 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/dirent        Fri Sep 
25 06:20:17 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/dirent
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/dirent
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_dirent_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/eaccess       Fri Sep 
25 06:20:22 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/eaccess       Fri Sep 
25 06:20:20 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/eaccess
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/eaccess
 by iffe version 2009-05-01 : : */
 #ifndef _def_eaccess_ast
 #define _def_eaccess_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/errno Fri Sep 25 
06:20:25 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/errno Fri Sep 25 
06:20:23 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/errno
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/errno
 by iffe version 2009-05-01 : : */
 #ifndef _def_errno_ast
 #define _def_errno_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/fcntl Fri Sep 25 
06:20:27 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/fcntl Fri Sep 25 
06:20:26 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/fcntl.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/fcntl.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_fcntl_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/float Fri Sep 25 
06:20:30 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/float Fri Sep 25 
06:20:28 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/float
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/float
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_float_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/fs    Fri Sep 25 
06:20:33 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/fs    Fri Sep 25 
06:20:31 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/fs
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/fs
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_fs_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/hack  Fri Sep 25 
06:20:36 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/hack  Fri Sep 25 
06:20:34 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/hack
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/hack
 by iffe version 2009-05-01 : : */
 #ifndef _def_hack_ast
 #define _def_hack_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/iconv Fri Sep 25 
06:20:38 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/iconv Fri Sep 25 
06:20:37 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/iconv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/iconv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_iconv_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/isoc99        Fri Sep 
25 06:20:41 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/isoc99        Fri Sep 
25 06:20:39 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/isoc99
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/isoc99
 by iffe version 2009-05-01 : : */
 #ifndef _def_isoc99_ast
 #define _def_isoc99_ast        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib   Fri Sep 25 
06:20:44 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib   Fri Sep 25 
06:20:42 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/lib
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/lib
 by iffe version 2009-05-01 : : */
 #ifndef _def_lib_ast
 #define _def_lib_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/libpath       Fri Sep 
25 06:20:47 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/libpath       Fri Sep 
25 06:20:45 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/libpath.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/libpath.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_libpath_ast
 #define _def_libpath_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/limits        Fri Sep 
25 06:20:50 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/limits        Fri Sep 
25 06:20:48 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/limits.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/limits.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_limits_ast
 #define _def_limits_ast        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/map   Fri Sep 25 
06:20:52 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/map   Fri Sep 25 
06:20:50 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/map.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/map.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_map_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
@@ -198,6 +198,8 @@
 #define pathposix      _ast_pathposix
 #undef pathprobe
 #define pathprobe      _ast_pathprobe
+#undef pathprog
+#define pathprog       _ast_pathprog
 #undef pathrepl
 #define pathrepl       _ast_pathrepl
 #undef pathsetlink
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mmap  Fri Sep 25 
06:20:55 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mmap  Fri Sep 25 
06:20:53 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/mmap
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/mmap
 by iffe version 2009-05-01 : : */
 #ifndef _def_mmap_ast
 #define _def_mmap_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -7,6 +7,7 @@
 #define _lib_mmap64    1       /* mmap64 interface and implementation work */
 #define _mmap_anon     1       /* use mmap MAP_ANON to get raw memory */
 #define _mmap_devzero  1       /* use mmap on /dev/zero to get raw memory */
+#define _mmap_worthy   2       /* mmap is good */
 
 /* some systems get it wrong but escape concise detection */
 #ifndef _NO_MMAP
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mode  Fri Sep 25 
06:20:58 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mode  Fri Sep 25 
06:20:56 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/mode.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/mode.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_mode_ast
 #define _def_mode_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/ndbm  Fri Sep 25 
06:21:01 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/ndbm  Fri Sep 25 
06:20:59 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/ndbm
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/ndbm
 by iffe version 2009-05-01 : : */
 #ifndef _def_ndbm_ast
 #define _def_ndbm_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/nl_types      Fri Sep 
25 06:21:03 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/nl_types      Fri Sep 
25 06:21:02 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/nl_types
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/nl_types
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_nl_types_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/omitted       Fri Sep 
25 06:21:06 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/omitted       Fri Sep 
25 06:21:04 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/omitted
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/omitted
 by iffe version 2009-05-01 : : */
 #ifndef _def_omitted_ast
 #define _def_omitted_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/param Fri Sep 25 
06:21:09 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/param Fri Sep 25 
06:21:07 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/param.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/param.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_param_ast
 #define _def_param_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/preroot       Fri Sep 
25 06:21:12 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/preroot       Fri Sep 
25 06:21:10 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/preroot.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/preroot.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_preroot_ast
 #define _def_preroot_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- /dev/null   Fri Sep 25 06:21:14 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/prog  Fri Sep 25 
06:21:12 2009
@@ -0,0 +1,7 @@
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/prog
 by iffe version 2009-05-01 : : */
+#ifndef _def_prog_ast
+#define _def_prog_ast  1
+#define _sys_types     1       /* #include <sys/types.h> ok */
+#define _lib_getexecname       1       /* getexecname() in default lib(s) */
+#define _PROC_PROG     "/proc/self/path/a.out"
+#endif
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sfinit        Fri Sep 
25 06:21:17 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sfinit        Fri Sep 
25 06:21:15 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/sfinit.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/sfinit.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_sfinit_ast
 #define _def_sfinit_ast        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sfio  Fri Sep 25 
06:21:20 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sfio  Fri Sep 25 
06:21:18 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/sfio
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/sfio
 by iffe version 2009-05-01 : : */
 #ifndef _def_sfio_ast
 #define _def_sfio_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sig   Fri Sep 25 
06:21:23 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sig   Fri Sep 25 
06:21:21 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/sig.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/sig.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_sig_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/siglist       Fri Sep 
25 06:21:26 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/siglist       Fri Sep 
25 06:21:24 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/siglist
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/siglist
 by iffe version 2009-05-01 : : */
 #ifndef _def_siglist_ast
 #define _def_siglist_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -5,6 +5,9 @@
 #define _hdr_string    1       /* #include <string.h> ok */
 #define _hdr_signal    1       /* #include <signal.h> ok */
 #define _lib_strsignal 1       /* strsignal() in default lib(s) */
+#if defined(SIGHUP) && !defined(HAD_SIGHUP)
+0,"HUP",SIGHUP,
+#endif
 #if defined(SIGINT) && !defined(HAD_SIGINT)
 0,"INT",SIGINT,
 #endif
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/signal        Fri Sep 
25 06:21:29 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/signal        Fri Sep 
25 06:21:27 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/signal.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/signal.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_signal_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/standards     Fri Sep 
25 06:21:31 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/standards     Fri Sep 
25 06:21:30 2009
@@ -1,26 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/standards
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/standards
 by iffe version 2009-05-01 : : */
 #ifndef _def_standards_ast
 #define _def_standards_ast     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-/* _ALL_SOURCE & _ISOC99_SOURCE & _POSIX_SOURCE & _POSIX_C_SOURCE & 
_XOPEN_SOURCE & __EXTENSIONS__ works */
-#ifndef _ALL_SOURCE
-#define _ALL_SOURCE    1
-#endif
-#ifndef _ISOC99_SOURCE
-#define _ISOC99_SOURCE 1
-#endif
-#ifndef _POSIX_SOURCE
-#define _POSIX_SOURCE  1
-#endif
-#ifndef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE        21000101L
-#endif
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE  9900
-#endif
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE    1
-#endif
+/* __EXTENSIONS__ works */
 #ifndef __EXTENSIONS__
 #define __EXTENSIONS__ 1
 #endif
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/stdio Fri Sep 25 
06:21:34 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/stdio Fri Sep 25 
06:21:32 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/stdio
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/stdio
 by iffe version 2009-05-01 : : */
                   
 #ifndef _SFSTDIO_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sys   Fri Sep 25 
06:21:37 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sys   Fri Sep 25 
06:21:35 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/sys
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/sys
 by iffe version 2009-05-01 : : */
                   
 #ifndef _AST_SYS_H
 #if !defined(__PROTO__)
@@ -104,7 +104,6 @@
 #include <limits.h>
 #include <fcntl.h>
 #include <locale.h>
-#include <sys/localedef.h>
 #define _hdr_time      1       /* #include <time.h> ok */
 #define _sys_time      1       /* #include <sys/time.h> ok */
 #define _sys_times     1       /* #include <sys/times.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/time  Fri Sep 25 
06:21:40 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/time  Fri Sep 25 
06:21:38 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/time
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/time
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_time_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tmlib Fri Sep 25 
06:21:42 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tmlib Fri Sep 25 
06:21:41 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/tmlib
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/tmlib
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_tmlib_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tmx   Fri Sep 25 
06:21:45 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tmx   Fri Sep 25 
06:21:43 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/tmx
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/tmx
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TMX_H
 #if !defined(__PROTO__)
@@ -108,6 +108,7 @@
 #endif
 
 extern __MANGLE__ Time_t               tmxdate __PROTO__((const char*, char**, 
Time_t));
+extern __MANGLE__ Time_t               tmxduration __PROTO__((const char*, 
char**));
 extern __MANGLE__ char*                tmxfmt __PROTO__((char*, size_t, const 
char*, Time_t));
 extern __MANGLE__ Time_t               tmxleap __PROTO__((Time_t));
 extern __MANGLE__ Tm_t*                tmxmake __PROTO__((Time_t));
@@ -114,6 +115,7 @@
 extern __MANGLE__ Time_t               tmxscan __PROTO__((const char*, char**, 
const char*, char**, Time_t, long));
 extern __MANGLE__ int          tmxsleep __PROTO__((Time_t));
 extern __MANGLE__ Time_t               tmxtime __PROTO__((Tm_t*, int));
+extern __MANGLE__ Tm_t*                tmxtm __PROTO__((Tm_t*, Time_t, 
Tm_zone_t*));
 
 extern __MANGLE__ Time_t               tmxgettime __PROTO__((void));
 extern __MANGLE__ int          tmxsettime __PROTO__((Time_t));
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tty   Fri Sep 25 
06:21:48 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tty   Fri Sep 25 
06:21:46 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/tty
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/tty
 by iffe version 2009-05-01 : : */
 #ifndef _def_tty_ast
 #define _def_tty_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tv    Fri Sep 25 
06:21:51 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tv    Fri Sep 25 
06:21:49 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/tv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/tv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TV_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tvlib Fri Sep 25 
06:21:53 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tvlib Fri Sep 25 
06:21:52 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/tvlib
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/tvlib
 by iffe version 2009-05-01 : : */
 #ifndef _def_tvlib_ast
 #define _def_tvlib_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/uwin  Fri Sep 25 
06:21:56 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/uwin  Fri Sep 25 
06:21:54 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/uwin
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/uwin
 by iffe version 2009-05-01 : : */
 #ifndef _def_uwin_ast
 #define _def_uwin_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/vfork Fri Sep 25 
06:21:59 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/vfork Fri Sep 25 
06:21:57 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/vfork
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/vfork
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_vfork_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/vmalloc       Fri Sep 
25 06:22:02 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/vmalloc       Fri Sep 
25 06:22:00 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/vmalloc
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/vmalloc
 by iffe version 2009-05-01 : : */
 #ifndef _def_vmalloc_ast
 #define _def_vmalloc_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/wait  Fri Sep 25 
06:22:04 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/wait  Fri Sep 25 
06:22:03 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/wait
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/wait
 by iffe version 2009-05-01 : : */
 #ifndef _def_wait_ast
 #define _def_wait_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/wchar Fri Sep 25 
06:22:07 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/wchar Fri Sep 25 
06:22:05 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/wchar
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/wchar
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_wchar_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/align.h       Fri Sep 25 
06:22:10 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/align.h       Fri Sep 25 
06:22:08 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/align.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/align.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_align_ast
 #define _def_align_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_botch.h   Fri Sep 25 
06:22:13 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_botch.h   Fri Sep 25 
06:22:11 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/botch.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/botch.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_botch_ast
 #define _def_botch_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_ccode.h   Fri Sep 25 
06:22:16 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_ccode.h   Fri Sep 25 
06:22:14 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/ccode
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/ccode
 by iffe version 2009-05-01 : : */
 #ifndef _def_ccode_ast
 #define _def_ccode_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_common.h  Fri Sep 25 
06:22:18 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_common.h  Fri Sep 25 
06:22:17 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/common
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/common
 by iffe version 2009-05-01 : : */
 #ifndef _AST_COMMON_H
 #define _AST_COMMON_H  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -156,9 +156,6 @@
 #define _typ_uintmax_t 1       /* uintmax_t is a type */
 
 #ifndef va_listref
-#define va_listref(p) (p)      /* pass va_list to varargs function */
-#define va_listval(p) (p)      /* retrieve va_list from va_arg(ap,va_listarg) 
*/
-#define va_listarg va_list     /* va_arg() va_list type */
 #ifndef        va_start
 #if __STD_C
 #include <stdarg.h>
@@ -166,6 +163,9 @@
 #include <varargs.h>
 #endif
 #endif
+#define va_listref(p) (p)      /* pass va_list to varargs function */
+#define va_listval(p) (p)      /* retrieve va_list from va_arg(ap,va_listarg) 
*/
+#define va_listarg va_list     /* va_arg() va_list type */
 #endif
 #ifndef _AST_STD_H
 #      if __STD_C && _hdr_stddef
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_dirent.h  Fri Sep 25 
06:22:21 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_dirent.h  Fri Sep 25 
06:22:19 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/dirent
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/dirent
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_dirent_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_fcntl.h   Fri Sep 25 
06:22:24 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_fcntl.h   Fri Sep 25 
06:22:22 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/fcntl.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/fcntl.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_fcntl_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_float.h   Fri Sep 25 
06:22:27 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_float.h   Fri Sep 25 
06:22:25 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/float
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/float
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_float_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_fs.h      Fri Sep 25 
06:22:30 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_fs.h      Fri Sep 25 
06:22:28 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/fs
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/fs
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_fs_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_iconv.h   Fri Sep 25 
06:22:32 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_iconv.h   Fri Sep 25 
06:22:31 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/iconv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/iconv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_iconv_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_lib.h     Fri Sep 25 
06:22:35 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_lib.h     Fri Sep 25 
06:22:33 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/lib
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/lib
 by iffe version 2009-05-01 : : */
 #ifndef _def_lib_ast
 #define _def_lib_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_limits.h  Fri Sep 25 
06:22:38 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_limits.h  Fri Sep 25 
06:22:36 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/limits.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/limits.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_limits_ast
 #define _def_limits_ast        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_map.h     Fri Sep 25 
06:22:41 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_map.h     Fri Sep 25 
06:22:39 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/map.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/map.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_map_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
@@ -198,6 +198,8 @@
 #define pathposix      _ast_pathposix
 #undef pathprobe
 #define pathprobe      _ast_pathprobe
+#undef pathprog
+#define pathprog       _ast_pathprog
 #undef pathrepl
 #define pathrepl       _ast_pathrepl
 #undef pathsetlink
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_mmap.h    Fri Sep 25 
06:22:44 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_mmap.h    Fri Sep 25 
06:22:42 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/mmap
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/mmap
 by iffe version 2009-05-01 : : */
 #ifndef _def_mmap_ast
 #define _def_mmap_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
@@ -7,6 +7,7 @@
 #define _lib_mmap64    1       /* mmap64 interface and implementation work */
 #define _mmap_anon     1       /* use mmap MAP_ANON to get raw memory */
 #define _mmap_devzero  1       /* use mmap on /dev/zero to get raw memory */
+#define _mmap_worthy   2       /* mmap is good */
 
 /* some systems get it wrong but escape concise detection */
 #ifndef _NO_MMAP
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_mode.h    Fri Sep 25 
06:22:46 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_mode.h    Fri Sep 25 
06:22:45 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/mode.c
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/mode.c
 by iffe version 2009-05-01 : : */
 #ifndef _def_mode_ast
 #define _def_mode_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- /dev/null   Fri Sep 25 06:22:49 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_namval.h  Fri Sep 25 
06:22:47 2009
@@ -0,0 +1,42 @@
+/***********************************************************************
+*                                                                      *
+*               This software is part of the ast package               *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
+*                      and is licensed under the                       *
+*                  Common Public License, Version 1.0                  *
+*                    by AT&T Intellectual Property                     *
+*                                                                      *
+*                A copy of the License is available at                 *
+*            http://www.opensource.org/licenses/cpl1.0.txt             *
+*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
+*                                                                      *
+*              Information and Software Systems Research               *
+*                            AT&T Research                             *
+*                           Florham Park NJ                            *
+*                                                                      *
+*                 Glenn Fowler <gsf at research.att.com>                  *
+*                  David Korn <dgk at research.att.com>                   *
+*                   Phong Vo <kpv at research.att.com>                    *
+*                                                                      *
+***********************************************************************/
+#pragma prototyped
+/*
+ * Glenn Fowler
+ * AT&T Research
+ *
+ * common name-value struct support
+ */
+
+#ifndef _NAMVAL_H
+#define _NAMVAL_H
+
+typedef struct
+{
+       char*           name;
+       int             value;
+#ifdef _NAMVAL_PRIVATE_
+       _NAMVAL_PRIVATE_
+#endif
+} Namval_t;
+
+#endif
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_ndbm.h    Fri Sep 25 
06:22:52 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_ndbm.h    Fri Sep 25 
06:22:50 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/ndbm
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/ndbm
 by iffe version 2009-05-01 : : */
 #ifndef _def_ndbm_ast
 #define _def_ndbm_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_nl_types.h        Fri Sep 
25 06:22:55 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_nl_types.h        Fri Sep 
25 06:22:53 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/nl_types
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/nl_types
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_nl_types_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_param.h   Fri Sep 25 
06:22:57 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_param.h   Fri Sep 25 
06:22:56 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/param.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/param.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_param_ast
 #define _def_param_ast 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_standards.h       Fri Sep 
25 06:23:00 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_standards.h       Fri Sep 
25 06:22:58 2009
@@ -1,26 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/standards
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/standards
 by iffe version 2009-05-01 : : */
 #ifndef _def_standards_ast
 #define _def_standards_ast     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-/* _ALL_SOURCE & _ISOC99_SOURCE & _POSIX_SOURCE & _POSIX_C_SOURCE & 
_XOPEN_SOURCE & __EXTENSIONS__ works */
-#ifndef _ALL_SOURCE
-#define _ALL_SOURCE    1
-#endif
-#ifndef _ISOC99_SOURCE
-#define _ISOC99_SOURCE 1
-#endif
-#ifndef _POSIX_SOURCE
-#define _POSIX_SOURCE  1
-#endif
-#ifndef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE        21000101L
-#endif
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE  9900
-#endif
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE    1
-#endif
+/* __EXTENSIONS__ works */
 #ifndef __EXTENSIONS__
 #define __EXTENSIONS__ 1
 #endif
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_stdio.h   Fri Sep 25 
06:23:03 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_stdio.h   Fri Sep 25 
06:23:01 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/stdio
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/stdio
 by iffe version 2009-05-01 : : */
                   
 #ifndef _SFSTDIO_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_sys.h     Fri Sep 25 
06:23:06 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_sys.h     Fri Sep 25 
06:23:04 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/sys
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/sys
 by iffe version 2009-05-01 : : */
                   
 #ifndef _AST_SYS_H
 #if !defined(__PROTO__)
@@ -104,7 +104,6 @@
 #include <limits.h>
 #include <fcntl.h>
 #include <locale.h>
-#include <sys/localedef.h>
 #define _hdr_time      1       /* #include <time.h> ok */
 #define _sys_time      1       /* #include <sys/time.h> ok */
 #define _sys_times     1       /* #include <sys/times.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_time.h    Fri Sep 25 
06:23:09 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_time.h    Fri Sep 25 
06:23:07 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/time
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/time
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_time_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_tty.h     Fri Sep 25 
06:23:12 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_tty.h     Fri Sep 25 
06:23:10 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/tty
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/tty
 by iffe version 2009-05-01 : : */
 #ifndef _def_tty_ast
 #define _def_tty_ast   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_vfork.h   Fri Sep 25 
06:23:14 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_vfork.h   Fri Sep 25 
06:23:13 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/vfork
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/vfork
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_vfork_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_wait.h    Fri Sep 25 
06:23:17 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_wait.h    Fri Sep 25 
06:23:15 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/wait
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/wait
 by iffe version 2009-05-01 : : */
 #ifndef _def_wait_ast
 #define _def_wait_ast  1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/ast_wchar.h   Fri Sep 25 
06:23:20 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/ast_wchar.h   Fri Sep 25 
06:23:18 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/wchar
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/wchar
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_wchar_ast
 #if !defined(__PROTO__)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/conftab.c     Fri Sep 25 
06:23:23 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/conftab.c     Fri Sep 25 
06:23:21 2009
@@ -10,7 +10,7 @@
 #include "FEATURE/param"
 #include "conftab.h"
 
-/* : : generated by conf from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/comp/conf.tab
 : : */
+/* : : generated by conf from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/comp/conf.tab
 : : */
 
 /*
  * prefix strings -- the first few are indexed by Conf_t.standard
@@ -207,6 +207,7 @@
 { "NL_TEXTMAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, 
-1 },
 { "NO_TRUNC", { 0UL, 0 }, { 0UL, 0 }, 
CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, 
_PC_NO_TRUNC },
 { "NPROCESSORS_CONF", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, 
_SC_NPROCESSORS_CONF },
+{ "NPROCESSORS_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, 
_SC_NPROCESSORS_MAX },
 { "NPROCESSORS_ONLN", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, 
_SC_NPROCESSORS_ONLN },
 { "NPROC_CONF", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, 
CONF_POSIX, 1, CONF_nop, -1 },
 { "NPROC_ONLN", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, 
CONF_POSIX, 1, CONF_nop, -1 },
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/conftab.h     Fri Sep 25 
06:23:26 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/conftab.h     Fri Sep 25 
06:23:24 2009
@@ -6,7 +6,7 @@
 #endif
 #include <sys/systeminfo.h>
 
-/* : : generated by conf from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/comp/conf.tab
 : : */
+/* : : generated by conf from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/comp/conf.tab
 : : */
 
 #if !defined(const) && !defined(__STDC__) && !defined(__cplusplus) && 
!defined(c_plusplus)
 #define const
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/lc.h  Fri Sep 25 06:23:29 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/lc.h  Fri Sep 25 06:23:27 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1985-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1985-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -38,14 +38,15 @@
 
 #define LC_abbreviated         0x00001
 #define LC_checked             0x00002
-#define LC_default             0x00004
-#define LC_defined             0x00008
-#define LC_debug               0x00010
+#define LC_debug               0x00004
+#define LC_default             0x00008
+#define LC_defined             0x00010
 #define LC_local               0x00020
 #define LC_primary             0x00040
 #define LC_qualified           0x00080
 #define LC_undefined           0x00100
-#define LC_verbose             0x00200
+#define LC_utf8                        0x00200
+#define LC_verbose             0x00400
 #define LC_user                        0x10000
 #define LC_language_attribute_max              2
 #define LC_territory_language_max              4
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/preroot.h     Fri Sep 25 
06:23:31 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/preroot.h     Fri Sep 25 
06:23:30 2009
@@ -1,4 +1,4 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/preroot.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/preroot.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_preroot_ast
 #define _def_preroot_ast       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/sig.h Fri Sep 25 06:23:34 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/sig.h Fri Sep 25 06:23:32 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/sig.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/sig.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_sig_ast
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/tmx.h Fri Sep 25 06:23:37 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/tmx.h Fri Sep 25 06:23:35 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/tmx
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/tmx
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TMX_H
 #if !defined(__PROTO__)
@@ -108,6 +108,7 @@
 #endif
 
 extern __MANGLE__ Time_t               tmxdate __PROTO__((const char*, char**, 
Time_t));
+extern __MANGLE__ Time_t               tmxduration __PROTO__((const char*, 
char**));
 extern __MANGLE__ char*                tmxfmt __PROTO__((char*, size_t, const 
char*, Time_t));
 extern __MANGLE__ Time_t               tmxleap __PROTO__((Time_t));
 extern __MANGLE__ Tm_t*                tmxmake __PROTO__((Time_t));
@@ -114,6 +115,7 @@
 extern __MANGLE__ Time_t               tmxscan __PROTO__((const char*, char**, 
const char*, char**, Time_t, long));
 extern __MANGLE__ int          tmxsleep __PROTO__((Time_t));
 extern __MANGLE__ Time_t               tmxtime __PROTO__((Tm_t*, int));
+extern __MANGLE__ Tm_t*                tmxtm __PROTO__((Tm_t*, Time_t, 
Tm_zone_t*));
 
 extern __MANGLE__ Time_t               tmxgettime __PROTO__((void));
 extern __MANGLE__ int          tmxsettime __PROTO__((Time_t));
--- old/usr/src/lib/libast/sparcv9/src/lib/libast/tv.h  Fri Sep 25 06:23:40 2009
+++ new/usr/src/lib/libast/sparcv9/src/lib/libast/tv.h  Fri Sep 25 06:23:38 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/tv
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libast/features/tv
 by iffe version 2009-05-01 : : */
                   
 #ifndef _TV_H
 #if !defined(__PROTO__)
--- old/usr/src/lib/libcmd/Makefile.com Fri Sep 25 06:23:43 2009
+++ new/usr/src/lib/libcmd/Makefile.com Fri Sep 25 06:23:41 2009
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -44,6 +44,7 @@
        date.o \
        dirname.o \
        expr.o \
+       grep.o \
        fds.o \
        fmt.o \
        fold.o \
@@ -56,6 +57,7 @@
        md5sum.o \
        mkdir.o \
        mkfifo.o \
+       mktemp.o \
        mv.o \
        paste.o \
        pathchk.o \
@@ -119,7 +121,7 @@
        '-DUSAGE_LICENSE=\
                "[-author?Glenn Fowler <gsf at research.att.com>]"\
                "[-author?David Korn <dgk at research.att.com>]"\
-               "[-copyright?Copyright (c) 1992-2008 AT&T Intellectual 
Property]"\
+               "[-copyright?Copyright (c) 1992-2009 AT&T Intellectual 
Property]"\
                "[-license?http://www.opensource.org/licenses/cpl1.0.txt]"\
                "[--catalog?libcmd]"'
 
--- old/usr/src/lib/libcmd/amd64/include/ast/cmd.h      Fri Sep 25 06:23:45 2009
+++ new/usr/src/lib/libcmd/amd64/include/ast/cmd.h      Fri Sep 25 06:23:43 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -44,6 +44,8 @@
 
 #define cmdinit                        _cmd_init
 
+#define ERROR_CALLBACK         ERROR_SET
+
 #if _BLD_cmd && defined(__EXPORT__)
 #undef __MANGLE__
 #define __MANGLE__ __LINKAGE__         __EXPORT__
@@ -96,7 +98,7 @@
                error_info.catalog = (char*)catalog;
        opt_info.index = 0;
        if (context)
-               error_info.flags |= flags;
+               error_info.flags |= flags & ~(ERROR_CALLBACK|ERROR_NOTIFY);
        return 0;
 }
 
--- old/usr/src/lib/libcmd/amd64/include/ast/cmdext.h   Fri Sep 25 06:23:48 2009
+++ new/usr/src/lib/libcmd/amd64/include/ast/cmdext.h   Fri Sep 25 06:23:46 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -39,11 +39,14 @@
 extern __MANGLE__ int  b_cut __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_date __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_dirname __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_egrep __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_expr __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_fds __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_fgrep __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_fmt __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_fold __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_getconf __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_grep __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_head __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_id __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_join __PROTO__((int, char**, __V_*));
@@ -52,11 +55,13 @@
 extern __MANGLE__ int  b_md5sum __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_mkdir __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_mkfifo __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_mktemp __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_mv __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_paste __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_pathchk __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_pids __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_rev __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_readlink __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_rm __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_rmdir __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_stty __PROTO__((int, char**, __V_*));
@@ -68,3 +73,4 @@
 extern __MANGLE__ int  b_uname __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_uniq __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_wc __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_xgrep __PROTO__((int, char**, __V_*));
--- old/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/ids     Fri Sep 25 
06:23:51 2009
+++ new/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/ids     Fri Sep 25 
06:23:49 2009
@@ -1,8 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libcmd/features/ids
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libcmd/features/ids
 by iffe version 2009-05-01 : : */
 #ifndef _def_ids_cmd
 #define _def_ids_cmd   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _lib_endgrent  1       /* endgrent() in default lib(s) */
 #define _lib_getgrent  1       /* getgrent() in default lib(s) */
--- old/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/sockets Fri Sep 25 
06:23:54 2009
+++ new/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/sockets Fri Sep 25 
06:23:52 2009
@@ -1,8 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libcmd/features/sockets
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libcmd/features/sockets
 by iffe version 2009-05-01 : : */
 #ifndef _def_sockets_cmd
 #define _def_sockets_cmd       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _sys_socket    1       /* #include <sys/socket.h> ok */
 #define _hdr_arpa_inet 1       /* #include <arpa/inet.h> ok */
--- old/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/symlink Fri Sep 25 
06:23:57 2009
+++ new/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/symlink Fri Sep 25 
06:23:55 2009
@@ -1,8 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libcmd/features/symlink
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libcmd/features/symlink
 by iffe version 2009-05-01 : : */
 #ifndef _def_symlink_cmd
 #define _def_symlink_cmd       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _lib_lchown    1       /* lchown implemented */
 #endif
--- old/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/utsname Fri Sep 25 
06:23:59 2009
+++ new/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/utsname Fri Sep 25 
06:23:58 2009
@@ -1,8 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libcmd/features/utsname
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libcmd/features/utsname
 by iffe version 2009-05-01 : : */
 #ifndef _def_utsname_cmd
 #define _def_utsname_cmd       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _lib_getdomainname     1       /* getdomainname() in default lib(s) */
 #define _lib_gethostid 1       /* gethostid() in default lib(s) */
--- old/usr/src/lib/libcmd/common/RELEASE       Fri Sep 25 06:24:02 2009
+++ new/usr/src/lib/libcmd/common/RELEASE       Fri Sep 25 06:24:00 2009
@@ -1,3 +1,34 @@
+09-09-09 fds.c: add --unit=fd
+09-08-25 tail.c: initialize Tail_t.fifo=0 !!
+09-08-15 tail.c: fix fifo logic
+09-08-11 wc.c: add setlocale(LC_CTYPE,"C") cleanup, add utf8 optimzations
+09-08-10 uniq.c: replace -c 1..9999 sfsprintf() with inline conversion
+09-08-01 join.c: fix empty field null pointer deref
+09-07-23 pathchk.c: add -P,--path and -a,--all
+09-07-02 chgrp.c,chmod.c,cksum.c: fts_flags() default only if not --recursive
+09-06-19 cmd.h,cmdinit.c: add ERROR_CALLBACK for ERROR_NOTIFY main() callback
+09-06-19 mktemp.c: --unsafe now checks and prints path but does create
+09-06-19 tee.c: add ERROR_CALLBACK for tee_cleanup() sfio discipline pop
+09-06-18 rm.c: handle interrupts during interactive query
+09-06-18 cp.c: handle interrupts during interactive query
+09-05-25 tail.c: fix old style option logic to handle --invalid-long-option
+09-05-24 tail.c: -r == +1r
+09-05-01 mktemp.c: handle foo/prefix, add -p dir and -u
+09-03-31 cat.c: handle --no* options
+09-03-15 tail.c: fix --timeout termination logic
+09-03-03 tee.c: clean up sfio disciplines on error
+09-03-03 cat.c: fix -v|-e|-n|-B interaction bugs
+09-02-14 tail.c: fix VSC failures
+09-02-14 join.c: fix VSC failure
+09-02-02 uniq.c: document -number == -fnumber, +number == -snumber
+09-02-02 tail.c: fix usage[] for negative offsets, add sun -b
+09-02-02 mktemp.c: add
+09-02-02 features/utsname: UWIN _UNAME_os_DEFAULT => UWIN
+09-01-31 dirname.c: add experimental { -f -r -x } for pathpath(3)
+09-01-05 cmp.c: fix EOF diagnostic to conform to posix
+09-01-03 mkfifo.c: fix --mode=mode logic
+08-12-07 date.c: add %[_][EO]K for [space pad] [full|long] iso docs
+08-11-10 stty.c: check for -t grouping so -tostop != -t -ostop
 08-10-15 rm.c: handle 'rm -f x x' => exit 0
 08-09-08 stty.c: #ifdef guard TAB[012] -- freebsd: damn the posix, full speed 
ahead
 08-06-17 shcmd.h: move to libast
@@ -169,7 +200,7 @@
 00-10-31 mkdir: handle races by checking EEXIST
 00-09-20 cp: copy argv to stack before modifying in place
 00-05-18 add setlocale(LC_ALL,"")
-00-04-30 join: drop wierd opt_info.argv reference
+00-04-30 join: drop weird opt_info.argv reference
 00-03-17 expr: add == operator -- duh
         cp,ln,mv: delay pathcanon() on destination to verify `cp a b/.'
         getconf: use astgetconf for proper message control
--- old/usr/src/lib/libcmd/common/basename.c    Fri Sep 25 06:24:05 2009
+++ new/usr/src/lib/libcmd/common/basename.c    Fri Sep 25 06:24:03 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libcmd/common/cat.c Fri Sep 25 06:24:08 2009
+++ new/usr/src/lib/libcmd/common/cat.c Fri Sep 25 06:24:06 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -31,7 +31,7 @@
 #include <fcntl.h>
 
 static const char usage[] =
-"[-?\n@(#)$Id: cat (AT&T Research) 2007-07-17 $\n]"
+"[-?\n@(#)$Id: cat (AT&T Research) 2009-03-31 $\n]"
 USAGE_LICENSE
 "[+NAME?cat - concatenate files]"
 "[+DESCRIPTION?\bcat\b copies each \afile\a in sequence to the standard"
@@ -62,6 +62,7 @@
 "[D:dos-output?Output files are opened in \atext\amode which inserts carriage"
 "      returns in front of new-lines on some systems.]"
 "[E:show-ends?Causes a \b$\b to be inserted before each new-line.]"
+"[R:regress?Regression test defaults: \b-v\b buffer size 4.]"
 "[S:silent?\bcat\b is silent about non-existent files.]"
 "[T:show-blank?Causes tabs to be copied as \b^I\b and formfeeds as \b^L\b.]"
 
@@ -87,146 +88,306 @@
 #define d_FLAG         (1<<9)
 
 /* character types */
-#define T_ENDBUF       1
-#define T_CONTROL      2
-#define T_NEWLINE      3
-#define T_EIGHTBIT     4
-#define T_CNTL8BIT     5
+#define T_ERROR                1
+#define T_EOF          2
+#define T_ENDBUF       3
+#define T_NEWLINE      4
+#define T_CONTROL      5
+#define T_EIGHTBIT     6
+#define T_CNTL8BIT     7
 
 #define printof(c)     ((c)^0100)
 
+typedef void* (*Reserve_f)(Sfio_t*, ssize_t, int);
+
+#ifndef sfvalue
+#define sfvalue(f)     ((f)->_val)
+#endif
+
+static void*
+regress(Sfio_t* sp, ssize_t n, int f)
+{
+       void*   r;
+
+       if (!(r = sfreserve(sp, 4, f)))
+               r = sfreserve(sp, n, f);
+       else if (sfvalue(sp) > 4)
+               sfvalue(sp) = 4;
+       return r;
+}
+
 /*
  * called for any special output processing
  */
 
 static int
-vcat(register char* states, Sfio_t *fdin, Sfio_t *fdout, int flags)
+vcat(register char* states, Sfio_t* ip, Sfio_t* op, Reserve_f reserve, int 
flags)
 {
        register unsigned char* cp;
-       register unsigned char* cpold;
+       register unsigned char* pp;
+       unsigned char*          cur;
+       unsigned char*          end;
+       unsigned char*          buf;
+       unsigned char*          nxt;
        register int            n;
-       register int            m;
-       register int            line = 1;
-       register unsigned char* endbuff;
-       unsigned char*          inbuff;
-       int                     printdefer = (flags&(B_FLAG|N_FLAG));
-       int                     lastchar;
-       int                     lastline;
+       register int            line;
+       register int            raw;
+       int                     last;
+       int                     c;
+       int                     m;
+       int                     any;
+       int                     header;
 
        unsigned char           meta[4];
+       unsigned char           tmp[32];
 
        meta[0] = 'M';
        meta[1] = '-';
+       last = -1;
+       *(cp = buf = end = tmp) = 0;
+       any = 0;
+       header = flags & (B_FLAG|N_FLAG);
+       line = 1;
+       states[0] = T_ENDBUF;
+       raw = !mbwide();
        for (;;)
        {
-               /* read in a buffer full */
-               if (!(inbuff = (unsigned char*)sfreserve(fdin, SF_UNBOUND, 0)))
-                       return sfvalue(fdin) ? -1 : 0;
-               if ((n = sfvalue(fdin)) <= 0)
-                       return n;
-               cp = inbuff;
-               lastchar = *(endbuff = cp + --n);
-               *endbuff = 0;
-               if (printdefer)
+               cur = cp;
+               if (raw)
+                       while (!(n = states[*cp++]));
+               else
+                       for (;;)
+                       {
+                               while (!(n = states[*cp++]));
+                               if (n < T_CONTROL)
+                                       break;
+                               if ((m = mbsize(pp = cp - 1)) > 1)
+                                       cp += m - 1;
+                               else
+                               {
+                                       if (m <= 0)
+                                       {
+                                               if (cur == pp)
+                                               {
+                                                       if (last > 0)
+                                                       {
+                                                               *end = last;
+                                                               last = -1;
+                                                               c = end - pp + 
1;
+                                                               if ((m = 
mbsize(pp)) == c)
+                                                               {
+                                                                       any = 1;
+                                                                       if 
(header)
+                                                                       {
+                                                                               
header = 0;
+                                                                               
sfprintf(op, "%6d\t", line);
+                                                                       }
+                                                                       
sfwrite(op, cur, m);
+                                                                       *(cp = 
cur = end) = 0;
+                                                               }
+                                                               else
+                                                               {
+                                                                       
memcpy(tmp, pp, c);
+                                                                       if 
(!(nxt = (unsigned char*)(*reserve)(ip, SF_UNBOUND, 0)))
+                                                                       {
+                                                                               
states[0] = sfvalue(ip) ? T_ERROR : T_EOF;
+                                                                               
*(cp = end = tmp + sizeof(tmp) - 1) = 0;
+                                                                               
last = -1;
+                                                                       }
+                                                                       else if 
((n = sfvalue(ip)) <= 0)
+                                                                       {
+                                                                               
states[0] = n ? T_ERROR : T_EOF;
+                                                                               
*(cp = end = tmp + sizeof(tmp) - 1) = 0;
+                                                                               
last = -1;
+                                                                       }
+                                                                       else
+                                                                       {
+                                                                               
cp = buf = nxt;
+                                                                               
end = buf + n - 1;
+                                                                               
last = *end;
+                                                                               
*end = 0;
+                                                                       }
+ mb:
+                                                                       if ((n 
= end - cp + 1) >= (sizeof(tmp) - c))
+                                                                               
n = sizeof(tmp) - c - 1;
+                                                                       
memcpy(tmp + c, cp, n);
+                                                                       if ((m 
= mbsize(tmp)) >= c)
+                                                                       {
+                                                                               
any = 1;
+                                                                               
if (header)
+                                                                               
{
+                                                                               
        header = 0;
+                                                                               
        sfprintf(op, "%6d\t", line);
+                                                                               
}
+                                                                               
sfwrite(op, tmp, m);
+                                                                               
cur = cp += m - c;
+                                                                       }
+                                                               }
+                                                               continue;
+                                                       }
+                                               }
+                                               else
+                                               {
+                                                       cp = pp + 1;
+                                                       n = 0;
+                                               }
+                                       }
+                                       break;
+                               }
+                       }
+               c = *--cp;
+               if ((m = cp - cur) || n >= T_CONTROL)
                {
-                       if (states[*cp]!=T_NEWLINE || !(flags&B_FLAG))
-                               sfprintf(fdout,"%6d\t",line);
-                       printdefer = 0;
+ flush:
+                       any = 1;
+                       if (header)
+                       {
+                               header = 0;
+                               sfprintf(op, "%6d\t", line);
+                       }
+                       if (m)
+                               sfwrite(op, cur, m);
                }
-               while (endbuff)
+ special:
+               switch (n)
                {
-                       cpold = cp;
-                       /* skip over printable characters */
-                       if (mbwide())
-                               while ((n = (m = mbsize(cp)) < 2 ? 
states[*cp++] : (cp += m, states['a'])) == 0);
+               case T_ERROR:
+                       if (cp != end)
+                       {
+                               n = T_CONTROL;
+                               goto flush;
+                       }
+                       return -1;
+               case T_EOF:
+                       if (cp != end)
+                       {
+                               n = T_CONTROL;
+                               goto flush;
+                       }
+                       return 0;
+               case T_ENDBUF:
+                       if (cp != end)
+                       {
+                               n = T_CONTROL;
+                               goto flush;
+                       }
+                       c = last;
+                       if (!(nxt = (unsigned char*)(*reserve)(ip, SF_UNBOUND, 
0)))
+                       {
+                               *(cp = end = tmp) = 0;
+                               states[0] = sfvalue(ip) ? T_ERROR : T_EOF;
+                               last = -1;
+                       }
+                       else if ((m = sfvalue(ip)) <= 0)
+                       {
+                               *(cp = end = tmp) = 0;
+                               states[0] = m ? T_ERROR : T_EOF;
+                               last = -1;
+                       }
                        else
-                               while ((n = states[*cp++]) == 0);
-                       if (n==T_ENDBUF)
                        {
-                               if (cp>endbuff)
+                               buf = nxt;
+                               end = buf + m - 1;
+                               last = *end;
+                               *end = 0;
+                               cp = buf;
+                       }
+                       if (c >= 0)
+                       {
+                               if (!(n = states[c]))
                                {
-                                       if (!(n = states[lastchar]))
-                                       {
-                                               *endbuff = lastchar;
-                                               cp++;
-                                       }
-                                       else
-                                       {
-                                               if (--cp > cpold)
-                                                       
sfwrite(fdout,(char*)cpold,cp-cpold);
-                                               if (endbuff==inbuff)
-                                                       *++endbuff = 0;
-                                               cp = cpold = endbuff;
-                                               cp[-1] = lastchar;
-                                               if (n==T_ENDBUF)
-                                                       n = T_CONTROL;
-                                               
-                                       }
-                                       endbuff = 0;
+                                       *(cur = tmp) = c;
+                                       m = 1;
+                                       goto flush;
                                }
-                               else n = T_CONTROL;
+                               if (raw || n < T_CONTROL)
+                               {
+                                       cp--;
+                                       goto special;
+                               }
+                               tmp[0] = c;
+                               c = 1;
+                               goto mb;
                        }
-                       if (--cp>cpold)
-                               sfwrite(fdout,(char*)cpold,cp-cpold);
-                       switch(n)
+                       break;
+               case T_CONTROL:
+                       do
                        {
-                               case T_CNTL8BIT:
-                                       meta[2] = '^';
-                                       do
+                               sfputc(op, '^');
+                               sfputc(op, printof(c));
+                       } while (states[c = *++cp] == T_CONTROL);
+                       break;
+               case T_CNTL8BIT:
+                       meta[2] = '^';
+                       do
+                       {
+                               n = c & ~0200;
+                               meta[3] = printof(n);
+                               sfwrite(op, (char*)meta, 4);
+                       } while (states[c = *++cp] == T_CNTL8BIT && raw);
+                       break;
+               case T_EIGHTBIT:
+                       do
+                       {
+                               meta[2] = c & ~0200;
+                               sfwrite(op, (char*)meta, 3);
+                       } while (states[c = *++cp] == T_EIGHTBIT && raw);
+                       break;
+               case T_NEWLINE:
+                       if (header && !(flags & B_FLAG))
+                               sfprintf(op, "%6d\t", line);
+                       if (flags & E_FLAG)
+                               sfputc(op, '$');
+                       sfputc(op, '\n');
+                       if (!header || !(flags & B_FLAG))
+                               line++;
+                       header = !(flags & S_FLAG);
+                       for (;;)
+                       {
+                               if ((n = states[*++cp]) == T_ENDBUF)
+                               {
+                                       if (cp != end || last != '\n')
+                                               break;
+                                       if (!(nxt = (unsigned 
char*)(*reserve)(ip, SF_UNBOUND, 0)))
                                        {
-                                               n = (*cp++)&~0200;
-                                               meta[3] = printof(n);
-                                               sfwrite(fdout,(char*)meta,4);
+                                               states[0] = sfvalue(ip) ? 
T_ERROR : T_EOF;
+                                               cp = end = tmp;
+                                               *cp-- = 0;
+                                               last = -1;
                                        }
-                                       while ((n=states[*cp])==T_CNTL8BIT);
-                                       break;
-                               case T_EIGHTBIT:
-                                       do
+                                       else if ((n = sfvalue(ip)) <= 0)
                                        {
-                                               meta[2] = (*cp++)&~0200;
-                                               sfwrite(fdout,(char*)meta,3);
+                                               states[0] = n ? T_ERROR : T_EOF;
+                                               cp = end = tmp;
+                                               *cp-- = 0;
+                                               last = -1;
                                        }
-                                       while ((n=states[*cp])==T_EIGHTBIT);
-                                       break;
-                               case T_CONTROL:
-                                       do
+                                       else
                                        {
-                                               n = *cp++;
-                                               sfputc(fdout,'^');
-                                               sfputc(fdout,printof(n));
+                                               buf = nxt;
+                                               end = buf + n - 1;
+                                               last = *end;
+                                               *end = 0;
+                                               cp = buf - 1;
                                        }
-                                       while ((n=states[*cp])==T_CONTROL);
+                               }
+                               else if (n != T_NEWLINE)
                                        break;
-                               case T_NEWLINE:
-                                       lastline = line;
-                                       if (flags&S_FLAG)
-                                       {
-                                               while (states[*++cp]==T_NEWLINE)
-                                                       line++;
-                                               cp--;
-                                       }
-                                       do
-                                       {
-                                               cp++;
-                                               if (flags&E_FLAG)
-                                                       sfputc(fdout,'$');
-                                               sfputc(fdout,'\n');
-                                               if(line > lastline)
-                                               {
-                                                       if (flags&E_FLAG)
-                                                               
sfputc(fdout,'$');
-                                                       sfputc(fdout,'\n');
-                                               }
-                                               if (!(flags&(N_FLAG|B_FLAG)))
-                                                       continue;
-                                               line++;
-                                               if (cp < endbuff)
-                                                       
sfprintf(fdout,"%6d\t",line);
-                                               else printdefer = 1;
-                                       }
-                                       while (states[*cp]==T_NEWLINE);
-                                       break;
+                               if (!(flags & S_FLAG) || any || header)
+                               {
+                                       any = 0;
+                                       header = 0;
+                                       if ((flags & (B_FLAG|N_FLAG)) == N_FLAG)
+                                               sfprintf(op, "%6d\t", line);
+                                       if (flags & E_FLAG)
+                                               sfputc(op, '$');
+                                       sfputc(op, '\n');
+                               }
+                               if (!(flags & B_FLAG))
+                                       line++;
                        }
+                       header = flags & (B_FLAG|N_FLAG);
+                       break;
                }
        }
 }
@@ -239,60 +400,65 @@
        register char*          cp;
        register Sfio_t*        fp;
        char*                   mode;
+       Reserve_f               reserve = sfreserve;
        int                     att;
-       int                     dovcat=0;
+       int                     dovcat = 0;
        char                    states[UCHAR_MAX+1];
 
-       NoP(argc);
        cmdinit(argc, argv, context, ERROR_CATALOG, 0);
+       setlocale(LC_ALL, "");
        att = !strcmp(astconf("UNIVERSE", NiL, NiL), "att");
        mode = "r";
        for (;;)
        {
+               n = 0;
                switch (optget(argv, usage))
                {
                case 'A':
-                       flags |= T_FLAG|E_FLAG|V_FLAG;
-                       continue;
+                       n = T_FLAG|E_FLAG|V_FLAG;
+                       break;
                case 'B':
-                       flags |= S_FLAG;
-                       continue;
+                       n = S_FLAG;
+                       break;
                case 'b':
-                       flags |= B_FLAG;
+                       n = B_FLAG;
+                       break;
+               case 'd':
+                       mode = opt_info.num ? "rt" : "r";
                        continue;
+               case 'D':
+                       n = d_FLAG;
+                       break;
                case 'E':
-                       flags |= E_FLAG;
-                       continue;
+                       n = E_FLAG;
+                       break;
                case 'e':
-                       flags |= E_FLAG|V_FLAG;
-                       continue;
+                       n = E_FLAG|V_FLAG;
+                       break;
                case 'n':
-                       flags |= N_FLAG;
+                       n = N_FLAG;
+                       break;
+               case 'R':
+                       reserve = opt_info.num ? regress : sfreserve;
                        continue;
                case 's':
-                       flags |= att ? F_FLAG : S_FLAG;
-                       continue;
+                       n = att ? F_FLAG : S_FLAG;
+                       break;
                case 'S':
-                       flags |= F_FLAG;
-                       continue;
+                       n = F_FLAG;
+                       break;
                case 'T':
-                       flags |= T_FLAG;
-                       continue;
+                       n = T_FLAG;
+                       break;
                case 't':
-                       flags |= T_FLAG|V_FLAG;
-                       continue;
+                       n = T_FLAG|V_FLAG;
+                       break;
                case 'u':
-                       flags |= U_FLAG;
-                       continue;
+                       n = U_FLAG;
+                       break;
                case 'v':
-                       flags |= V_FLAG;
-                       continue;
-               case 'd':
-                       mode = "rt";
-                       continue;
-               case 'D':
-                       flags |= d_FLAG;
-                       continue;
+                       n = V_FLAG;
+                       break;
                case ':':
                        error(2, "%s", opt_info.arg);
                        break;
@@ -300,7 +466,12 @@
                        error(ERROR_usage(2), "%s", opt_info.arg);
                        break;
                }
-               break;
+               if (!n)
+                       break;
+               if (opt_info.num)
+                       flags |= n;
+               else
+                       flags &= ~n;
        }
        argv += opt_info.index;
        if (error_info.errors)
@@ -340,8 +511,6 @@
                states['\n'] = T_NEWLINE;
                dovcat = 1;
        }
-       if (flags&B_FLAG)
-               flags |= S_FLAG;
        if (flags&d_FLAG)
                sfopen(sfstdout, NiL, "wt");
        if (cp = *argv)
@@ -348,7 +517,7 @@
                argv++;
        do
        {
-               if (!cp || streq(cp,"-"))
+               if (!cp || streq(cp, "-"))
                {
                        fp = sfstdin;
                        if (flags&D_FLAG)
@@ -364,7 +533,7 @@
                if (flags&U_FLAG)
                        sfsetbuf(fp, (void*)fp, -1);
                if (dovcat)
-                       n = vcat(states, fp, sfstdout, flags);
+                       n = vcat(states, fp, sfstdout, reserve, flags);
                else if (sfmove(fp, sfstdout, SF_UNBOUND, -1) >= 0 && sfeof(fp))
                        n = 0;
                else
--- old/usr/src/lib/libcmd/common/chgrp.c       Fri Sep 25 06:24:11 2009
+++ new/usr/src/lib/libcmd/common/chgrp.c       Fri Sep 25 06:24:09 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -28,7 +28,7 @@
  */
 
 static const char usage_1[] =
-"[-?@(#)$Id: chgrp (AT&T Research) 2008-03-28 $\n]"
+"[-?@(#)$Id: chgrp (AT&T Research) 2009-07-02 $\n]"
 USAGE_LICENSE
 ;
 
@@ -221,6 +221,7 @@
        register FTSENT*ent;
        register int    i;
        Dt_t*           map = 0;
+       int             logical = 1;
        int             flags;
        int             uid;
        int             gid;
@@ -297,16 +298,20 @@
                        continue;
                case 'H':
                        flags |= FTS_META|FTS_PHYSICAL;
+                       logical = 0;
                        continue;
                case 'L':
                        flags &= ~(FTS_META|FTS_PHYSICAL);
+                       logical = 0;
                        continue;
                case 'P':
                        flags &= ~FTS_META;
                        flags |= FTS_PHYSICAL;
+                       logical = 0;
                        continue;
                case 'R':
                        flags &= ~FTS_TOP;
+                       logical = 0;
                        continue;
                case 'X':
                        options |= OPT_TEST;
@@ -325,6 +330,8 @@
        if (error_info.errors || argc < 2)
                error(ERROR_usage(2), "%s", optusage(NiL));
        s = *argv;
+       if (logical)
+               flags &= ~(FTS_META|FTS_PHYSICAL);
        if (map)
        {
                if (streq(s, "-"))
--- old/usr/src/lib/libcmd/common/chmod.c       Fri Sep 25 06:24:14 2009
+++ new/usr/src/lib/libcmd/common/chmod.c       Fri Sep 25 06:24:12 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -28,7 +28,7 @@
  */
 
 static const char usage[] =
-"[-?\n@(#)$Id: chmod (AT&T Research) 2007-09-10 $\n]"
+"[-?\n@(#)$Id: chmod (AT&T Research) 2009-07-02 $\n]"
 USAGE_LICENSE
 "[+NAME?chmod - change the access permissions of files]"
 "[+DESCRIPTION?\bchmod\b changes the permission of each file "
@@ -158,6 +158,7 @@
        register FTSENT*ent;
        char*           last;
        int             (*chmodf)(const char*, mode_t);
+       int             logical = 1;
        int             notify = 0;
        int             ignore = 0;
        int             show = 0;
@@ -206,16 +207,20 @@
                        continue;
                case 'H':
                        flags |= FTS_META|FTS_PHYSICAL;
+                       logical = 0;
                        continue;
                case 'L':
                        flags &= ~(FTS_META|FTS_PHYSICAL);
+                       logical = 0;
                        continue;
                case 'P':
                        flags &= ~FTS_META;
                        flags |= FTS_PHYSICAL;
+                       logical = 0;
                        continue;
                case 'R':
                        flags &= ~FTS_TOP;
+                       logical = 0;
                        continue;
                case '?':
                        error(ERROR_usage(2), "%s", opt_info.arg);
@@ -226,6 +231,8 @@
        argv += opt_info.index;
        if (error_info.errors || !*argv || !amode && !*(argv + 1))
                error(ERROR_usage(2), "%s", optusage(NiL));
+       if (logical)
+               flags &= ~(FTS_META|FTS_PHYSICAL);
        if (ignore)
                ignore = umask(0);
        if (amode)
--- old/usr/src/lib/libcmd/common/chown.c       Fri Sep 25 06:24:16 2009
+++ new/usr/src/lib/libcmd/common/chown.c       Fri Sep 25 06:24:15 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libcmd/common/cksum.c       Fri Sep 25 06:24:19 2009
+++ new/usr/src/lib/libcmd/common/cksum.c       Fri Sep 25 06:24:17 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -27,7 +27,7 @@
  */
 
 static const char usage[] =
-"[-?\n@(#)$Id: sum (AT&T Research) 2007-11-27 $\n]"
+"[-?\n@(#)$Id: sum (AT&T Research) 2009-07-02 $\n]"
 USAGE_LICENSE
 "[+NAME?cksum,md5sum,sum - print file checksum and block count]"
 "[+DESCRIPTION?\bsum\b lists the checksum, and for most methods the block"
@@ -447,6 +447,7 @@
        Sfio_t*         sp;
        FTS*            fts;
        FTSENT*         ent;
+       int             logical;
        Optdisc_t       optdisc;
        State_t         state;
 
@@ -456,6 +457,7 @@
        flags = fts_flags() | FTS_TOP | FTS_NOPOSTORDER | FTS_NOSEEDOTDIR;
        state.flags = SUM_SIZE;
        state.warn = 1;
+       logical = 1;
        method = 0;
        optinit(&optdisc, optinfo);
        for (;;)
@@ -493,6 +495,7 @@
                        flags &= ~FTS_TOP;
                        state.recursive = 1;
                        state.sort = order;
+                       logical = 0;
                        continue;
                case 's':
                        method = "sys5";
@@ -511,13 +514,16 @@
                        continue;
                case 'H':
                        flags |= FTS_META|FTS_PHYSICAL;
+                       logical = 0;
                        continue;
                case 'L':
                        flags &= ~(FTS_META|FTS_PHYSICAL);
+                       logical = 0;
                        continue;
                case 'P':
                        flags &= ~FTS_META;
                        flags |= FTS_PHYSICAL;
+                       logical = 0;
                        continue;
                case 'T':
                        state.text = 1;
@@ -548,6 +554,8 @@
         * do it
         */
 
+       if (logical)
+               flags &= ~(FTS_META|FTS_PHYSICAL);
        if (state.permissions)
        {
                state.uid = geteuid();
--- old/usr/src/lib/libcmd/common/cmd.h Fri Sep 25 06:24:22 2009
+++ new/usr/src/lib/libcmd/common/cmd.h Fri Sep 25 06:24:20 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -35,6 +35,8 @@
 
 #define cmdinit                        _cmd_init
 
+#define ERROR_CALLBACK         ERROR_SET
+
 #if _BLD_cmd && defined(__EXPORT__)
 #define extern         __EXPORT__
 #endif
@@ -86,7 +88,7 @@
                error_info.catalog = (char*)catalog;
        opt_info.index = 0;
        if (context)
-               error_info.flags |= flags;
+               error_info.flags |= flags & ~(ERROR_CALLBACK|ERROR_NOTIFY);
        return 0;
 }
 
--- old/usr/src/lib/libcmd/common/cmdinit.c     Fri Sep 25 06:24:25 2009
+++ new/usr/src/lib/libcmd/common/cmdinit.c     Fri Sep 25 06:24:23 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -24,6 +24,7 @@
  */
 
 #include <cmd.h>
+#include <shcmd.h>
 
 int
 _cmd_init(int argc, char** argv, void* context, const char* catalog, int flags)
@@ -30,8 +31,22 @@
 {
        register char*  cp;
 
-       if (argc < 0)
+       if (argc <= 0)
                return -1;
+       if (context)
+       {
+               if (flags & ERROR_CALLBACK)
+               {
+                       flags &= ~ERROR_CALLBACK;
+                       flags |= ERROR_NOTIFY;
+               }
+               else if (flags & ERROR_NOTIFY)
+               {
+                       ((Shbltin_t*)(context))->notify = 1;
+                       flags &= ~ERROR_NOTIFY;
+               }
+               error_info.flags |= flags;
+       }
        if (cp = strrchr(argv[0], '/'))
                cp++;
        else
@@ -40,8 +55,6 @@
        if (!error_info.catalog)
                error_info.catalog = catalog;
        opt_info.index = 0;
-       if (context)
-               error_info.flags |= flags;
        return 0;
 }
 
--- old/usr/src/lib/libcmd/common/cmp.c Fri Sep 25 06:24:28 2009
+++ new/usr/src/lib/libcmd/common/cmp.c Fri Sep 25 06:24:26 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -28,7 +28,7 @@
  */
 
 static const char usage[] =
-"[-?\n@(#)$Id: cmp (AT&T Research) 2004-12-01 $\n]"
+"[-?\n@(#)$Id: cmp (AT&T Research) 2009-01-05 $\n]"
 USAGE_LICENSE
 "[+NAME?cmp - compare two files]"
 "[+DESCRIPTION?\bcmp\b compares two files \afile1\a and \afile2\a.  "
@@ -119,7 +119,7 @@
                                {
                                        ret = 1;
                                        if (!(flags & CMP_SILENT))
-                                               error(ERROR_exit(1), "%s: EOF", 
file1);
+                                               error(ERROR_exit(1), "EOF on 
%s", file1);
                                }
                                return(ret);
                        }
@@ -130,7 +130,7 @@
                        if (!(p2 = (unsigned char*)sfreserve(f2, SF_UNBOUND, 
0)) || (c2 = sfvalue(f2)) <= 0)
                        {
                                if (!(flags & CMP_SILENT))
-                                       error(ERROR_exit(1), "%s: EOF", file2);
+                                       error(ERROR_exit(1), "EOF on %s", 
file2);
                                return(1);
                        }
                        e2 = p2 + c2;
@@ -263,7 +263,7 @@
        if (o1 && sfseek(f1, o1, SEEK_SET) != o1)
        {
                if (!(flags & CMP_SILENT))
-                       error(ERROR_exit(0), "%s: EOF", file1);
+                       error(ERROR_exit(0), "EOF on %s", file1);
                n = 1;
                goto done;
        }
@@ -270,7 +270,7 @@
        if (o2 && sfseek(f2, o2, SEEK_SET) != o2)
        {
                if (!(flags & CMP_SILENT))
-                       error(ERROR_exit(0), "%s: EOF", file2);
+                       error(ERROR_exit(0), "EOF on %s", file2);
                n = 1;
                goto done;
        }
@@ -280,7 +280,8 @@
                error(ERROR_system(0), "%s: cannot stat", file1);
        else if (s1.st_ino == s2.st_ino && s1.st_dev == s2.st_dev && o1 == o2)
                n = 0;
-       else n = ((flags & CMP_SILENT) && S_ISREG(s1.st_mode) && 
S_ISREG(s2.st_mode) && (s1.st_size - o1) != (s2.st_size - o2)) ? 1 : cmp(file1, 
f1, file2, f2, flags);
+       else
+               n = ((flags & CMP_SILENT) && S_ISREG(s1.st_mode) && 
S_ISREG(s2.st_mode) && (s1.st_size - o1) != (s2.st_size - o2)) ? 1 : cmp(file1, 
f1, file2, f2, flags);
  done:
        if (f1 && f1 != sfstdin) sfclose(f1);
        if (f2 && f2 != sfstdin) sfclose(f2);
--- old/usr/src/lib/libcmd/common/comm.c        Fri Sep 25 06:24:31 2009
+++ new/usr/src/lib/libcmd/common/comm.c        Fri Sep 25 06:24:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libcmd/common/cp.c  Fri Sep 25 06:24:33 2009
+++ new/usr/src/lib/libcmd/common/cp.c  Fri Sep 25 06:24:32 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -27,7 +27,7 @@
  */
 
 static const char usage_head[] =
-"[-?@(#)$Id: cp (AT&T Research) 2007-12-13 $\n]"
+"[-?@(#)$Id: cp (AT&T Research) 2009-06-18 $\n]"
 USAGE_LICENSE
 ;
 
@@ -142,6 +142,7 @@
 
 typedef struct State_s                 /* program state                */
 {
+       void*           context;        /* builtin context              */
        int             backup;         /* BAK_* type                   */
        int             directory;      /* destination is directory     */
        int             flags;          /* FTS_* flags                  */
@@ -438,7 +439,7 @@
                                        /* ok */;
                                else if (state->interactive)
                                {
-                                       if (astquery(-1, "%s %s? ", 
state->opname, state->path))
+                                       if (astquery(-1, "%s %s? ", 
state->opname, state->path) < 0 || sh_checksig(state->context))
                                                return 0;
                                }
                                else if (state->op == LN)
@@ -459,7 +460,7 @@
                                    fmtmode(st.st_mode & 
(S_IRWXU|S_IRWXG|S_IRWXO), 0) + 1;
                                if (state->interactive)
                                {
-                                       if (astquery(-1, "override protection 
%s for %s? ", protection, state->path))
+                                       if (astquery(-1, "override protection 
%s for %s? ", protection, state->path) < 0 || sh_checksig(state->context))
                                                return 0;
                                        rm = 1;
                                }
@@ -659,7 +660,7 @@
        char**          v;
        char*           backup_type;
        FTS*            fts;
-       FTSENT* ent;
+       FTSENT*         ent;
        const char*     usage;
        int             path_resolve;
        int             standard;
@@ -677,6 +678,7 @@
        }
        else
                memset(state, 0, offsetof(State_t, INITSTATE));
+       state->context = context;
        state->presiz = -1;
        backup_type = 0;
        state->flags = FTS_NOCHDIR|FTS_NOSEEDOTDIR;
--- old/usr/src/lib/libcmd/common/cut.c Fri Sep 25 06:24:36 2009
+++ new/usr/src/lib/libcmd/common/cut.c Fri Sep 25 06:24:35 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libcmd/common/date.c        Fri Sep 25 06:24:39 2009
+++ new/usr/src/lib/libcmd/common/date.c        Fri Sep 25 06:24:37 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -27,7 +27,7 @@
  */
 
 static const char usage[] =
-"[-?\n@(#)$Id: date (AT&T Research) 2007-05-21 $\n]"
+"[-?\n@(#)$Id: date (AT&T Research) 2009-03-03 $\n]"
 USAGE_LICENSE
 "[+NAME?date - set/list/convert dates]"
 "[+DESCRIPTION?\bdate\b sets the current date and time (with appropriate"
@@ -106,7 +106,7 @@
 "              [+j?1-offset Julian date]"
 "              [+J?0-offset Julian date]"
 "              [+k?\bdate\b(1) style date]"
-"              [+K?all numeric date; equivalent to \b%Y-%m-%d+%H:%M:%S\b]"
+"              [+K?all numeric date; equivalent to \b%Y-%m-%d+%H:%M:%S\b; 
\b%_[EO]]K\b for space separator, %OK adds \b.%N\b, \b%EK\b adds \b%.N%z\b, 
\b%_EK\b adds \b.%N %z\b]"
 "              [+l?\bls\b(1) \b-l\b date; equivalent to \b%Q/%g/%G/\b]"
 "              [+L?locale default date format]"
 "              [+m?month number]"
@@ -212,7 +212,7 @@
        char*           s;
        char**          argv;
        char*           args[5];
-       char            buf[128];
+       char            buf[1024];
 
        if (!adjust && !network)
                return tmxsettime(now);
@@ -276,7 +276,7 @@
        Time_t          ts;
        Time_t          te;
        Time_t          e;
-       char            buf[128];
+       char            buf[1024];
        Fmt_t*          fmts;
        Fmt_t           fmt;
        struct stat     st;
--- old/usr/src/lib/libcmd/common/dirname.c     Fri Sep 25 06:24:42 2009
+++ new/usr/src/lib/libcmd/common/dirname.c     Fri Sep 25 06:24:40 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -29,7 +29,7 @@
  */
 
 static const char usage[] =
-"[-?\n@(#)$Id: dirname (AT&T Research) 2000-03-07 $\n]"
+"[-?\n@(#)$Id: dirname (AT&T Research) 2009-01-31 $\n]"
 USAGE_LICENSE
 "[+NAME?dirname - return directory portion of file name]"
 "[+DESCRIPTION?\bdirname\b treats \astring\a as a file name and returns "
@@ -48,14 +48,17 @@
        "as \b/\b characters as described above.  Otherwise, all "
        "trailing slashes are removed and the output will be this string "
        "unless this string is empty.  If empty the output will be \b.\b.]" 
+"[f:file?Print the \b$PATH\b relative regular file path for \astring\a.]"
+"[r:relative?Print the \b$PATH\b relative readable file path for \astring\a.]"
+"[x:executable?Print the \b$PATH\b relative executable file path for 
\astring\a.]"
 "\n"
-"\n string\n"
+"\nstring\n"
 "\n"
 "[+EXIT STATUS?]{"
         "[+0?Successful Completion.]"
         "[+>0?An error occurred.]"
 "}"
-"[+SEE ALSO?\bbasename\b(1), \bgetconf\b(1), \bdirname\b(3)]"
+"[+SEE ALSO?\bbasename\b(1), \bgetconf\b(1), \bdirname\b(3), \bpathname\b(3)]"
 ;
 
 #include <cmd.h>
@@ -96,10 +99,22 @@
 b_dirname(int argc,register char *argv[], void* context)
 {
        register int n;
+       int mode = 0;
+       char buf[PATH_MAX];
 
        cmdinit(argc, argv, context, ERROR_CATALOG, 0);
        while (n = optget(argv, usage)) switch (n)
        {
+       case 'f':
+               mode |= PATH_REGULAR;
+               break;
+       case 'r':
+               mode &= ~PATH_REGULAR;
+               mode |= PATH_READ;
+               break;
+       case 'x':
+               mode |= PATH_EXECUTE;
+               break;
        case ':':
                error(2, "%s", opt_info.arg);
                break;
@@ -111,6 +126,11 @@
        argc -= opt_info.index;
        if(error_info.errors || argc != 1)
                error(ERROR_usage(2),"%s", optusage(NiL));
-       l_dirname(sfstdout,argv[0]);
+       if(!mode)
+               l_dirname(sfstdout,argv[0]);
+       else if(pathpath(buf, argv[0], "", mode))
+               sfputr(sfstdout, buf, '\n');
+       else
+               error(1|ERROR_WARNING, "%s: relative path not found", argv[0]);
        return(0);
 }
--- old/usr/src/lib/libcmd/common/expr.c        Fri Sep 25 06:24:45 2009
+++ new/usr/src/lib/libcmd/common/expr.c        Fri Sep 25 06:24:43 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libcmd/common/fds.c Fri Sep 25 06:24:48 2009
+++ new/usr/src/lib/libcmd/common/fds.c Fri Sep 25 06:24:46 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -21,7 +21,7 @@
 #pragma prototyped
 
 static const char usage[] =
-"[-?\n@(#)$Id: fds (AT&T Research) 2008-08-26 $\n]"
+"[-?\n@(#)$Id: fds (AT&T Research) 2009-09-09 $\n]"
 USAGE_LICENSE
 "[+NAME?fds - list open file descriptor status]"
 "[+DESCRIPTION?\bfds\b lists the status for each open file descriptor. "
@@ -29,6 +29,7 @@
     "calling shell, otherwise it lists the file descriptors passed across "
     "\bexec\b(2).]"
 "[l:long?List file descriptor details.]"
+"[u:unit?Write output to \afd\a.]#[fd]"
 "[+SEE ALSO?\blogname\b(1), \bwho\b(1), \bgetgroups\b(2), \bgetsockname\b(2), 
\bgetsockopts\b(2)]"
 ;
 
@@ -164,6 +165,8 @@
        int                     flags;
        int                     details;
        int                     open_max;
+       int                     unit;
+       Sfio_t*                 sp;
        struct stat             st;
 #ifdef S_IFSOCK
        struct sockaddr_in      addr;
@@ -175,13 +178,16 @@
        int                     type;
        int                     port;
        int                     prot;
-       char                    nam[256];
        char                    num[64];
        char                    fam[64];
+#ifdef INET6_ADDRSTRLEN
+       char                    nam[256];
 #endif
+#endif
 
        cmdinit(argc, argv, context, ERROR_CATALOG, 0);
        details = 0;
+       unit = 1;
        for (;;)
        {
                switch (optget(argv, usage))
@@ -189,6 +195,9 @@
                case 'l':
                        details = opt_info.num;
                        continue;
+               case 'u':
+                       unit = opt_info.num;
+                       continue;
                case '?':
                        error(ERROR_USAGE|4, "%s", opt_info.arg);
                        continue;
@@ -203,6 +212,10 @@
                error(ERROR_USAGE|4, "%s", optusage(NiL));
        if ((open_max = getconf("OPEN_MAX")) <= 0)
                open_max = OPEN_MAX;
+       if (unit == 1)
+               sp = sfstdout;
+       else if (fstat(unit, &st) || !(sp = sfnew(NiL, NiL, SF_UNBOUND, unit, 
SF_WRITE)))
+               error(ERROR_SYSTEM|3, "%d: cannot write to file descriptor");
        for (i = 0; i <= open_max; i++)
        {
                if (fstat(i, &st))
@@ -212,7 +225,7 @@
                }
                if (!details)
                {
-                       sfprintf(sfstdout, "%d\n", i);
+                       sfprintf(sp, "%d\n", i);
                        continue;
                }
                if ((flags = fcntl(i, F_GETFL, (char*)0)) == -1)
@@ -236,7 +249,7 @@
                x = (fcntl(i, F_GETFD, (char*)0) > 0) ? "x" : "-";
                if (isatty(i) && (s = ttyname(i)))
                {
-                       sfprintf(sfstdout, "%02d %s%s %s %s\n", i, m, x, 
fmtmode(st.st_mode, 0), s);
+                       sfprintf(sp, "%02d %s%s %s %s\n", i, m, x, 
fmtmode(st.st_mode, 0), s);
                        continue;
                }
 #ifdef S_IFSOCK
@@ -330,13 +343,18 @@
                                a = a == fam ? "0" : fam + 1;
                        }
                        if (port)
-                               sfprintf(sfstdout, "%02d %s%s %s 
/dev/%s/%s/%d\n", i, m, x, fmtmode(st.st_mode, 0), s, a, port);
+                               sfprintf(sp, "%02d %s%s %s /dev/%s/%s/%d\n", i, 
m, x, fmtmode(st.st_mode, 0), s, a, port);
                        else
-                               sfprintf(sfstdout, "%02d %s%s %s /dev/%s/%s\n", 
i, m, x, fmtmode(st.st_mode, 0), s, a);
+                               sfprintf(sp, "%02d %s%s %s /dev/%s/%s\n", i, m, 
x, fmtmode(st.st_mode, 0), s, a);
                        continue;
                }
 #endif
-               sfprintf(sfstdout, "%02d %s%s %s /dev/inode/%u/%u\n", i, m, x, 
fmtmode(st.st_mode, 0), st.st_dev, st.st_ino);
+               sfprintf(sp, "%02d %s%s %s /dev/inode/%u/%u\n", i, m, x, 
fmtmode(st.st_mode, 0), st.st_dev, st.st_ino);
        }
+       if (sp != sfstdout)
+       {
+               sfsetfd(sp, -1);
+               sfclose(sp);
+       }
        return 0;
 }
--- old/usr/src/lib/libcmd/common/features/utsname      Fri Sep 25 06:24:51 2009
+++ new/usr/src/lib/libcmd/common/features/utsname      Fri Sep 25 06:24:49 2009
@@ -6,6 +6,9 @@
 tst    cross{
        u=`/bin/uname -o 2>/dev/null`
        case $u in
+       UWIN-*) u=UWIN ;;
+       esac
+       case $u in
        '')     ;;
        *)      echo "#define _UNAME_os_DEFAULT     \"$u\"  /* default os name 
*/" ;;
        esac
--- old/usr/src/lib/libcmd/common/fmt.c Fri Sep 25 06:24:54 2009
+++ new/usr/src/lib/libcmd/common/fmt.c Fri Sep 25 06:24:52 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libcmd/common/fold.c        Fri Sep 25 06:24:56 2009
+++ new/usr/src/lib/libcmd/common/fold.c        Fri Sep 25 06:24:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libcmd/common/getconf.c     Fri Sep 25 06:24:59 2009
+++ new/usr/src/lib/libcmd/common/getconf.c     Fri Sep 25 06:24:57 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- /dev/null   Fri Sep 25 06:25:02 2009
+++ new/usr/src/lib/libcmd/common/grep.c        Fri Sep 25 06:25:00 2009
@@ -0,0 +1,876 @@
+/***********************************************************************
+*                                                                      *
+*               This software is part of the ast package               *
+*           Copyright (c) 1995-2009 AT&T Knowledge Ventures            *
+*                      and is licensed under the                       *
+*                  Common Public License, Version 1.0                  *
+*                      by AT&T Knowledge Ventures                      *
+*                                                                      *
+*                A copy of the License is available at                 *
+*            http://www.opensource.org/licenses/cpl1.0.txt             *
+*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
+*                                                                      *
+*              Information and Software Systems Research               *
+*                            AT&T Research                             *
+*                           Florham Park NJ                            *
+*                                                                      *
+*                 Glenn Fowler <gsf at research.att.com>                  *
+*                                                                      *
+***********************************************************************/
+#pragma prototyped
+
+static const char usage[] =
+"[-?\n@(#)$Id: grep (AT&T Research) 2006-06-14 $\n]"
+USAGE_LICENSE
+"[+NAME?grep - search lines in files for matching patterns]"
+"[+DESCRIPTION?The \bgrep\b commands search the named input files"
+"      for lines containing a match for the given \apatterns\a."
+"      Matching lines are printed by default. The standard input is searched"
+"      if no files are given or when the file \b-\b is specified.]"
+"[+?There are six variants of \bgrep\b, each one using a different form of"
+"      \apattern\a, controlled either by option or the command path"
+"      base name. Details of each variant may be found in \bregex\b(3).]"
+"      {"
+"      [+grep?The default basic regular expressions (no alternations.)]"
+"      [+egrep?Extended regular expressions (alternations, one or more.)]"
+"      [+pgrep?\bperl\b(1) regular expressions (lenient extended.)]"
+"      [+xgrep?Augmented regular expressions (conjunction, negation.)]"
+"      [+fgrep?Fixed string expressions.]"
+"      [+agrep?Approximate regular expressions (not implemented.)]"
+"      }"
+"[G:basic-regexp?\bgrep\b mode (default): basic regular expression 
\apatterns\a.]"
+"[E:extended-regexp?\begrep\b mode: extended regular expression \apatterns\a.]"
+"[X:augmented-regexp?\bxgrep\b mode: augmented regular expression 
\apatterns\a.]"
+"[P:perl-regexp?\bpgrep\b mode: \bperl\b(1) regular expression \apatterns\a.]"
+"[F:fixed-string?\bfgrep\b mode: fixed string \apatterns\a.]"
+"[A:approximate-regexp?\bagrep\b mode: approximate regular expression 
\apatterns\a (not implemented.)]"
+
+"[C:context?Set the matched line context \abefore\a and \aafter\a count."
+"      By default only matched lines are printed.]:?"
+"              [before[,after]]:=2,2]"
+"[c:count?Only print a matching line count for each file.]"
+"[e:expression|pattern|regexp?Specify a matching \apattern\a. More than one"
+"      \apattern\a implies alternation. If this option is specified"
+"      then the command line \apattern\a must be omitted.]:"
+"              [pattern]"
+"[f:file?Each line in \apattern-file\a is a \apattern\a, placed into a single"
+"      alternating expression.]:"
+"              [pattern-file]"
+"[H:filename|with-filename?Prefix each matched line with the containing file 
name.]"
+"[h:no-filename?Suppress containing file name prefix for each matched line.]"
+"[i:ignore-case?Ignore case when matching.]"
+"[l:files-with-matches?Only print file names with at least one match.]"
+"[L:files-without-matches?Only print file names with no matches.]"
+"[b:highlight?Highlight matches using the ansi terminal bold sequence.]"
+"[v:invert-match|revert-match?Invert the \apattern\a match sense.]"
+"[m:label?All patterns must be of the form \alabel\a:\apattern\a. Match and"
+"      count output will be prefixed by the corresponding \alabel\a:.]"
+"[O:lenient?Enable lenient \apattern\a interpretation. This is the default.]"
+"[x:line-match|line-regexp?Force \apatterns\a to match complete lines.]"
+"[n:number|line-number?Prefix each matched line with its line number.]"
+"[N:name?Set the standard input file name prefix to"
+"      \aname\a.]:[name:=empty]"
+"[q:quiet|silent?Do not print matching lines.]"
+"[S:strict?Enable strict \apattern\a interpretation with diagnostics.]"
+"[s:suppress|no-messages?Suppress error and warning messages.]"
+"[t:total?Only print a single matching line count for all files.]"
+"[T:test?Enable implementation specific tests.]:"
+"              [test]"
+"[w:word-match|word-regexp?Force \apatterns\a to match complete words.]"
+"[a?Ignored for GNU compatibility.]"
+"\n"
+"\n[ pattern ] [ file ... ]\n"
+"\n"
+"[+DIAGNOSTICS?Exit status 0 if matches were found, 1 if no matches were 
found,"
+"      where \b-v\b invertes the exit status. Exit status 2 for other"
+"      errors that are accompanied by a message on the standard error.]"
+"[+SEE ALSO?\bed\b(1), \bsed\b(1), \bperl\b(1), \bregex\b(3)]"
+"[+CAVEATS?Some expressions of necessity require exponential space"
+"      and/or time.]"
+"[+BUGS?Some expressions may use sub-optimal algorithms. For example,"
+"      don't use this implementation to compute primes.]"
+;
+
+#include <ast.h>
+#include <ctype.h>
+#include <ccode.h>
+#include <error.h>
+#include <regex.h>
+
+#ifndef EISDIR
+#define EISDIR         (-1)
+#endif
+
+/*
+ * snarfed from Doug McElroy's C++ version
+ *
+ * this grep is based on the Posix re package.
+ * unfortunately it has to have a nonstandard interface.
+ * 1. fgrep does not have usual operators. REG_LITERAL
+ * caters for this.
+ * 2. grep allows null expressions, hence REG_NULL.
+ * 3. it may be possible to combine the multiple 
+ * patterns of grep into single patterns.  important
+ * special cases are handled by regcomb().
+ * 4. anchoring by -x has to be done separately from
+ * compilation (remember that fgrep has no ^ or $ operator),
+ * hence REG_LEFT|REG_RIGHT.  (An honest, but slow alternative:
+ * run regexec with REG_NOSUB off and nmatch=1 and check
+ * whether the match is full length)
+ */
+
+typedef struct Item_s                  /* list item - sue me for waste */
+{
+       struct Item_s*  next;           /* next in list                 */
+       regex_t         re;             /* compiled re                  */
+       Sfulong_t       hits;           /* labeled pattern matches      */
+       Sfulong_t       total;          /* total hits                   */
+       char            string[1];      /* string value                 */
+} Item_t;
+
+typedef struct List_s                  /* generic list                 */
+{
+       Item_t*         head;           /* list head                    */
+       Item_t*         tail;           /* list tail                    */
+} List_t;
+
+typedef struct State_s                 /* program state                */
+{
+       struct
+       {
+       char*           base;           /* sfsetbuf buffer              */
+       size_t          size;           /* sfsetbuf size                */
+       int             noshare;        /* turn off SF_SHARE            */
+       }               buffer;
+
+       List_t          file;           /* pattern file list            */
+       List_t          pattern;        /* pattern list                 */
+       List_t          re;             /* re list                      */
+
+       regmatch_t      posvec[1];      /* match position vector        */
+       regmatch_t*     pos;            /* match position pointer       */
+       int             posnum;         /* number of match positions    */
+
+       int             any;            /* if any pattern hit           */
+       int             list;           /* list files with hits         */
+       int             notfound;       /* some input file not found    */
+       int             options;        /* regex options                */
+
+       Sfulong_t       hits;           /* total matched pattern count  */
+
+       unsigned char   byline;         /* multiple pattern line by line*/
+       unsigned char   count;          /* count number of hits         */
+       unsigned char   label;          /* all patterns labeled         */
+       unsigned char   match;          /* match sense                  */
+       unsigned char   query;          /* return status but no output  */
+       unsigned char   number;         /* line numbers                 */
+       unsigned char   prefix;         /* print file prefix            */
+       unsigned char   suppress;       /* no unopenable file messages  */
+       unsigned char   words;          /* word matches only            */
+} State_s;
+
+static void
+addre(State_s *state, List_t* p, char* s)
+{
+       int     c;
+       char*   b;
+       Item_t* x;
+       Sfio_t* t;
+
+       b = s;
+       if (state->label)
+       {
+               if (!(s = strchr(s, ':')))
+                       error(3, "%s: label:pattern expected", b);
+               c = s - b;
+               s++;
+       }
+       else
+               c = 0;
+       if (!(x = newof(0, Item_t, 1, c)))
+               error(ERROR_SYSTEM|3, "out of space (pattern `%s')", b);
+       if (c)
+               memcpy(x->string, b, c);
+       if (state->words)
+       {
+               if (!(t = sfstropen()))
+                       error(ERROR_SYSTEM|3, "out of space (word pattern 
`%s')", s);
+               if (!(state->options & REG_AUGMENTED))
+                       sfputc(t, '\\');
+               sfputc(t, '<');
+               sfputr(t, s, -1);
+               if (!(state->options & REG_AUGMENTED))
+                       sfputc(t, '\\');
+               sfputc(t, '>');
+               if (!(s = sfstruse(t)))
+                       error(ERROR_SYSTEM|3, "out of space");
+       }
+       else
+               t = 0;
+       if (c = regcomp(&x->re, s, state->options|REG_MULTIPLE))
+               regfatal(&x->re, 3, c);
+       if (t)
+               sfstrclose(t);
+       if (!p->head)
+       {
+               p->head = p->tail = x;
+               if (state->number || !regrecord(&x->re))
+                       state->byline = 1;
+       }
+       else if (state->label || regcomb(&p->tail->re, &x->re))
+       {
+               p->tail = p->tail->next = x;
+               if (!state->byline && (state->number || !state->label || 
!regrecord(&x->re)))
+                       state->byline = 1;
+       }
+       else
+               free(x);
+}
+
+static void
+addstring(State_s *state, List_t* p, char* s)
+{
+       Item_t* x;
+
+       if (!(x = newof(0, Item_t, 1, strlen(s))))
+               error(ERROR_SYSTEM|3, "out of space (string `%s')", s);
+       strcpy(x->string, s);
+       if (p->head)
+               p->tail->next = x;
+       else
+               p->head = x;
+       p->tail = x;
+}
+
+static void
+compile(State_s *state)
+{
+       int     line;
+       size_t  n;
+       char*   s;
+       char*   t;
+       char*   file;
+       Item_t* x;
+       Sfio_t* f;
+
+       for (x = state->pattern.head; x; x = x->next)
+               addre(state, &state->re, x->string);
+       for (x = state->file.head; x; x = x->next)
+       {
+               s = x->string;
+               if (!(f = sfopen(NiL, s, "r")))
+                       error(ERROR_SYSTEM|4, "%s: cannot open", s);
+               else
+               {
+                       file = error_info.file;
+                       error_info.file = s;
+                       line = error_info.line;
+                       error_info.line = 0;
+                       while (s = (char*)sfreserve(f, SF_UNBOUND, SF_LOCKR))
+                       {
+                               if (!(n = sfvalue(f)))
+                                       break;
+                               if (s[n - 1] != '\n')
+                               {
+                                       for (t = s + n; t > s && *--t != '\n'; 
t--);
+                                       if (t == s)
+                                       {
+                                               sfread(f, s, 0);
+                                               break;
+                                       }
+                                       n = t - s + 1;
+                               }
+                               s[n - 1] = 0;
+                               addre(state, &state->re, s);
+                               s[n - 1] = '\n';
+                               sfread(f, s, n);
+                       }
+                       while ((s = sfgetr(f, '\n', 1)) || (s = sfgetr(f, '\n', 
-1)))
+                       {
+                               error_info.line++;
+                               addre(state, &state->re, s);
+                       }
+                       error_info.file = file;
+                       error_info.line = line;
+                       sfclose(f);
+               }
+       }
+       if (!state->re.head)
+               error(3, "no pattern");
+}
+
+static void
+highlight(Sfio_t* sp, const char* s, int n, int so, int eo)
+{
+       static const char       bold[] =        {CC_esc,'[','1','m'};
+       static const char       normal[] =      {CC_esc,'[','0','m'};
+
+       sfwrite(sp, s, so);
+       sfwrite(sp, bold, sizeof(bold));
+       sfwrite(sp, s + so, eo - so);
+       sfwrite(sp, normal, sizeof(normal));
+       sfwrite(sp, s + eo, n - eo);
+}
+
+typedef struct
+{
+    State_s *state;
+    Item_t  *item;
+} record_handle;
+
+static int
+record(void* handle, const char* s, size_t len)
+{
+       record_handle   *r_x = (record_handle *)handle;
+       State_s         *state = r_x->state;
+       Item_t          *item  = r_x->item;
+
+       item->hits++;
+       if (state->query || state->list)
+               return -1;
+       if (!state->count)
+       {
+               if (state->prefix)
+                       sfprintf(sfstdout, "%s:", error_info.file);
+               if (state->label)
+                       sfprintf(sfstdout, "%s:", item->string);
+               if (state->pos)
+                       highlight(sfstdout, s, len + 1, state->pos[0].rm_so, 
state->pos[0].rm_eo);
+               else
+                       sfwrite(sfstdout, s, len + 1);
+       }
+       return 0;
+}
+
+static void
+execute(State_s *state, Sfio_t* input, char* name)
+{
+       register char*  s;
+       char*           file;
+       Item_t*         x;
+       size_t          len;
+       int             result;
+       int             line;
+
+       Sfulong_t       hits = 0;
+       
+       if (state->buffer.noshare)
+               sfset(input, SF_SHARE, 0);
+       if (state->buffer.size)
+               sfsetbuf(input, state->buffer.base, state->buffer.size);
+       if (!name)
+               name = "/dev/stdin";
+       file = error_info.file;
+       error_info.file = name;
+       line = error_info.line;
+       error_info.line = 0;
+       if (state->byline)
+       {
+               for (;;)
+               {
+                       error_info.line++;
+                       if (s = sfgetr(input, '\n', 0))
+                               len = sfvalue(input) - 1;
+                       else if (s = sfgetr(input, '\n', -1))
+                       {
+                               len = sfvalue(input);
+                               s[len] = '\n';
+#if _you_like_the_noise
+                               error(1, "newline appended");
+#endif
+                       }
+                       else
+                       {
+                               if (sferror(input) && errno != EISDIR)
+                                       error(ERROR_SYSTEM|2, "read error");
+                               break;
+                       }
+                       x = state->re.head;
+                       do
+                       {
+                               if (!(result = regnexec(&x->re, s, len, 
state->posnum, state->pos, 0)))
+                               {
+                                       if (!state->label)
+                                               break;
+                                       x->hits++;
+                                       if (state->query || state->list)
+                                               goto done;
+                                       if (!state->count)
+                                       {
+                                               if (state->prefix)
+                                                       sfprintf(sfstdout, 
"%s:", name);
+                                               if (state->number)
+                                                       sfprintf(sfstdout, 
"%d:", error_info.line);
+                                               sfprintf(sfstdout, "%s:", 
x->string);
+                                               if (state->pos)
+                                                       highlight(sfstdout, s, 
len + 1, state->pos[0].rm_so, state->pos[0].rm_eo);
+                                               else
+                                                       sfwrite(sfstdout, s, 
len + 1);
+                                       }
+                               }
+                               else if (result != REG_NOMATCH)
+                                       regfatal(&x->re, 3, result);
+                       } while (x = x->next);
+                       if (!state->label && (x != 0) == state->match)
+                       {
+                               hits++;
+                               if (state->query || state->list)
+                                       break;
+                               if (!state->count)
+                               {
+                                       if (state->prefix)
+                                               sfprintf(sfstdout, "%s:", name);
+                                       if (state->number)
+                                               sfprintf(sfstdout, "%d:", 
error_info.line);
+                                       if (state->pos)
+                                               highlight(sfstdout, s, len + 1, 
state->pos[0].rm_so, state->pos[0].rm_eo);
+                                       else
+                                               sfwrite(sfstdout, s, len + 1);
+                               }
+                       }
+               }
+       }
+       else
+       {
+               register char*  e;
+               register char*  t;
+               char*           r;
+
+               static char*    span = 0;
+               static size_t   spansize = 0;
+
+               s = e = 0;
+               for (;;)
+               {
+                       if (s < e)
+                       {
+                               t = span;
+                               for (;;)
+                               {
+                                       len = 2 * (e - s) + t - span + 1;
+                                       len = roundof(len, SF_BUFSIZE);
+                                       if (spansize < len)
+                                       {
+                                               spansize = len;
+                                               len = t - span;
+                                               if (!(span = newof(span, char, 
spansize, 0)))
+                                                       error(ERROR_SYSTEM|3, 
"%s: line longer than %lu characters", name, len + e - s);
+                                               t = span + len;
+                                       }
+                                       len = e - s;
+                                       memcpy(t, s, len);
+                                       t += len;
+                                       if (!(s = sfreserve(input, SF_UNBOUND, 
0)) || (len = sfvalue(input)) <= 0)
+                                       {
+                                               if ((sfvalue(input) || 
sferror(input)) && errno != EISDIR)
+                                                       error(ERROR_SYSTEM|2, 
"%s: read error", name);
+                                               break;
+                                       }
+                                       else if (!(e = memchr(s, '\n', len)))
+                                               e = s + len;
+                                       else
+                                       {
+                                               r = s + len;
+                                               len = (e - s) + t - span;
+                                               len = roundof(len, SF_BUFSIZE);
+                                               if (spansize < len)
+                                               {
+                                                       spansize = len;
+                                                       len = t - span;
+                                                       if (!(span = 
newof(span, char, spansize, 0)))
+                                                               
error(ERROR_SYSTEM|3, "%s: line longer than %lu characters", name, len + e - s);
+                                                       t = span + len;
+                                               }
+                                               len = e - s;
+                                               memcpy(t, s, len);
+                                               t += len;
+                                               s += len + 1;
+                                               e = r;
+                                               break;
+                                       }
+                               }
+                               *t = '\n';
+                               x = state->re.head;
+                               do
+                               {
+                                       record_handle r_x = { state, x };
+                                       if ((result = regrexec(&x->re, span, t 
- span, state->posnum, state->pos, state->options, '\n', (void*)&r_x, record)) 
< 0)
+                                               goto done;
+                                       if (result && result != REG_NOMATCH)
+                                               regfatal(&x->re, 3, result);
+                               } while (x = x->next);
+                               if (!s)
+                                       break;
+                       }
+                       else
+                       {
+                               if (!(s = sfreserve(input, SF_UNBOUND, 0)))
+                               {
+                                       if ((sfvalue(input) || sferror(input)) 
&& errno != EISDIR)
+                                               error(ERROR_SYSTEM|2, "%s: read 
error", name);
+                                       break;
+                               }
+                               if ((len = sfvalue(input)) <= 0)
+                                       break;
+                               e = s + len;
+                       }
+                       t = e;
+                       while (t > s)
+                               if (*--t == '\n')
+                               {
+                                       x = state->re.head;
+                                       do
+                                       {
+                                               record_handle r_x = { state, x 
};
+                                               if ((result = regrexec(&x->re, 
s, t - s, state->posnum, state->pos, state->options, '\n', (void*)&r_x, 
record)) < 0)
+                                                       goto done;
+                                               if (result && result != 
REG_NOMATCH)
+                                                       regfatal(&x->re, 3, 
result);
+                                       } while (x = x->next);
+                                       s = t + 1;
+                                       break;
+                               }
+               }
+       }
+ done:
+       error_info.file = file;
+       error_info.line = line;
+       if (state->byline && !state->label)
+       {
+               if (hits && state->list >= 0)
+                       state->any = 1;
+               if (!state->query)
+               {
+                       if (!state->list)
+                       {
+                               if (state->count)
+                               {
+                                       if (state->count & 2)
+                                               state->hits += hits;
+                                       else
+                                       {
+                                               if (state->prefix)
+                                                       sfprintf(sfstdout, 
"%s:", name);
+                                               sfprintf(sfstdout, "%I*u\n", 
sizeof(hits), hits);
+                                       }
+                               }
+                       }
+                       else if ((hits != 0) == (state->list > 0))
+                       {
+                               if (state->list < 0)
+                                       state->any = 1;
+                               sfprintf(sfstdout, "%s\n", name);
+                       }
+               }
+       }
+       else
+       {
+               x = state->re.head;
+               do
+               {
+                       if (x->hits && state->list >= 0)
+                       {
+                               state->any = 1;
+                               if (state->query)
+                                       break;
+                       }
+                       if (!state->query)
+                       {
+                               if (!state->list)
+                               {
+                                       if (state->count)
+                                       {
+                                               if (state->count & 2)
+                                               {
+                                                       x->total += x->hits;
+                                                       state->hits += x->hits;
+                                               }
+                                               else
+                                               {
+                                                       if (state->prefix)
+                                                               
sfprintf(sfstdout, "%s:", name);
+                                                       if (state->label)
+                                                               
sfprintf(sfstdout, "%s:", x->string);
+                                                       sfprintf(sfstdout, 
"%I*u\n", sizeof(x->hits), x->hits);
+                                               }
+                                       }
+                               }
+                               else if ((x->hits != 0) == (state->list > 0))
+                               {
+                                       if (state->list < 0)
+                                               state->any = 1;
+                                       if (state->label)
+                                               sfprintf(sfstdout, "%s:%s\n", 
name, x->string);
+                                       else
+                                               sfprintf(sfstdout, "%s\n", 
name);
+                               }
+                       }
+                       x->hits = 0;
+               } while (x = x->next);
+       }
+}
+
+
+static
+int grep_main(int argc, char** argv, void *context)
+{
+       int     c;
+       char*   s;
+       char*   h;
+       Sfio_t* f;
+       State_s state;
+       memset(&state, 0, sizeof(state));
+
+       NoP(argc);
+       state.match = 1;
+       state.options = REG_FIRST|REG_NOSUB|REG_NULL;
+       h = 0;
+       if (strcmp(astconf("CONFORMANCE", NiL, NiL), "standard"))
+               state.options |= REG_LENIENT;
+       if (s = strrchr(argv[0], '/'))
+               s++;
+       else
+               s = argv[0];
+       switch (*s)
+       {
+       case 'e':
+       case 'E':
+               s = "egrep";
+               state.options |= REG_EXTENDED;
+               break;
+       case 'f':
+       case 'F':
+               s = "fgrep";
+               state.options |= REG_LITERAL;
+               break;
+       case 'p':
+       case 'P':
+               s = "pgrep";
+               state.options |= REG_EXTENDED|REG_LENIENT;
+               break;
+       case 'x':
+       case 'X':
+               s = "xgrep";
+               state.options |= REG_AUGMENTED;
+               break;
+       default:
+               s = "grep";
+               break;
+       }
+       error_info.id = s;
+       while (c = optget(argv, usage))
+               switch (c)
+               {
+               case 'E':
+                       state.options |= REG_EXTENDED;
+                       break;
+               case 'F':
+                       state.options |= REG_LITERAL;
+                       break;
+               case 'G':
+                       state.options &= ~(REG_AUGMENTED|REG_EXTENDED);
+                       break;
+               case 'H':
+                       state.prefix = opt_info.num;
+                       break;
+               case 'L':
+                       state.list = -opt_info.num;
+                       break;
+               case 'N':
+                       h = opt_info.arg;
+                       break;
+               case 'O':
+                       state.options |= REG_LENIENT;
+                       break;
+               case 'P':
+                       state.options |= REG_EXTENDED|REG_LENIENT;
+                       break;
+               case 'S':
+                       state.options &= ~REG_LENIENT;
+                       break;
+               case 'T':
+                       s = opt_info.arg;
+                       switch (*s)
+                       {
+                       case 'b':
+                       case 'm':
+                               c = *s++;
+                               state.buffer.size = strton(s, &s, NiL, 1);
+                               if (c == 'b' && !(state.buffer.base = newof(0, 
char, state.buffer.size, 0)))
+                                       error(ERROR_SYSTEM|3, "out of space 
[test buffer]");
+                               if (*s)
+                                       error(3, "%s: invalid characters after 
test", s);
+                               break;
+                       case 'f':
+                               state.options |= REG_FIRST;
+                               break;
+                       case 'l':
+                               state.options |= REG_LEFT;
+                               break;
+                       case 'n':
+                               state.buffer.noshare = 1;
+                               break;
+                       case 'r':
+                               state.options |= REG_RIGHT;
+                               break;
+                       default:
+                               error(3, "%s: unknown test", s);
+                               break;
+                       }
+                       break;
+               case 'X':
+                       state.options |= REG_AUGMENTED;
+                       break;
+               case 'a':
+                       break;
+               case 'b':
+                       state.options &= ~(REG_FIRST|REG_NOSUB);
+                       break;
+               case 'c':
+                       state.count |= 1;
+                       break;
+               case 'e':
+                       addstring(&state, &state.pattern, opt_info.arg);
+                       break;
+               case 'f':
+                       addstring(&state, &state.file, opt_info.arg);
+                       break;
+               case 'h':
+                       state.prefix = 2;
+                       break;
+               case 'i':
+                       state.options |= REG_ICASE;
+                       break;
+               case 'l':
+                       state.list = opt_info.num;
+                       break;
+               case 'm':
+                       state.label = 1;
+                       break;
+               case 'n':
+                       state.number = 1;
+                       break;
+               case 'q':
+                       state.query = 1;
+                       break;
+               case 's':
+                       state.suppress = opt_info.num;
+                       break;
+               case 't':
+                       state.count |= 2;
+                       break;
+               case 'v':
+                       if (state.match = !opt_info.num)
+                               state.options &= ~REG_INVERT;
+                       else
+                               state.options |= REG_INVERT;
+                       break;
+               case 'w':
+                       state.words = 1;
+                       break;
+               case 'x':
+                       state.options |= REG_LEFT|REG_RIGHT;
+                       break;
+               case '?':
+                       error(ERROR_USAGE|4, "%s", opt_info.arg);
+                       break;
+               case ':':
+                       error(2, "%s", opt_info.arg);
+                       break;
+               default:
+                       error(3, "%s: not implemented", opt_info.name);
+                       break;
+               }
+       argv += opt_info.index;
+       if ((state.options & REG_LITERAL) && (state.options & 
(REG_AUGMENTED|REG_EXTENDED)))
+               error(3, "-F and -A or -P or -X are incompatible");
+       if ((state.options & REG_LITERAL) && state.words)
+               error(ERROR_SYSTEM|3, "-F and -w are incompatible");
+       if (!state.file.head && !state.pattern.head)
+       {
+               if (!argv[0])
+                       error(3, "no pattern");
+               addstring(&state, &state.pattern, *argv++);
+       }
+       if (!(state.options & (REG_FIRST|REG_NOSUB)))
+       {
+               if (state.count || state.list || state.query || (state.options 
& REG_INVERT))
+                       state.options |= REG_FIRST|REG_NOSUB;
+               else
+               {
+                       state.pos = state.posvec;
+                       state.posnum = elementsof(state.posvec);
+               }
+       }
+       compile(&state);
+       if (!argv[0])
+       {
+               state.prefix = h ? 1 : 0;
+               execute(&state, sfstdin, h);
+       }
+       else
+       {
+               if (state.prefix > 1)
+                       state.prefix = 0;
+               else if (argv[1])
+                       state.prefix = 1;
+               while (s = *argv++)
+               {
+                       if (f = sfopen(NiL, s, "r"))
+                       {
+                               execute(&state, f, s);
+                               sfclose(f);
+                               if (state.query && state.any)
+                                       break;
+                       }
+                       else
+                       {
+                               state.notfound = 1;
+                               if (!state.suppress)
+                                       error(ERROR_SYSTEM|2, "%s: cannot 
open", s);
+                       }
+               }
+       }
+       if ((state.count & 2) && !state.query && !state.list)
+       {
+               if (state.label)
+               {
+                       Item_t*         x;
+
+                       x = state.re.head;
+                       do
+                       {
+                               sfprintf(sfstdout, "%s:%I*u\n", x->string, 
sizeof(x->total), x->total);
+                       } while (x = x->next);
+               }
+               else
+                       sfprintf(sfstdout, "%I*u\n", sizeof(state.hits), 
state.hits);
+       }
+       return (state.notfound && !state.query) ? 2 : !state.any;
+}
+
+
+int b_egrep(int argc, char** argv, void *context)
+{
+       return grep_main(argc, argv, context);
+}
+
+int b_grep(int argc, char** argv, void *context)
+{
+       return grep_main(argc, argv, context);
+}
+
+int b_fgrep(int argc, char** argv, void *context)
+{
+       return grep_main(argc, argv, context);
+}
+
+int b_pgrep(int argc, char** argv, void *context)
+{
+       return grep_main(argc, argv, context);
+}
+
+int b_xgrep(int argc, char** argv, void *context)
+{
+       return grep_main(argc, argv, context);
+}
--- old/usr/src/lib/libcmd/common/head.c        Fri Sep 25 06:25:05 2009
+++ new/usr/src/lib/libcmd/common/head.c        Fri Sep 25 06:25:03 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libcmd/common/id.c  Fri Sep 25 06:25:08 2009
+++ new/usr/src/lib/libcmd/common/id.c  Fri Sep 25 06:25:06 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libcmd/common/join.c        Fri Sep 25 06:25:10 2009
+++ new/usr/src/lib/libcmd/common/join.c        Fri Sep 25 06:25:09 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -28,7 +28,7 @@
  */
 
 static const char usage[] =
-"[-?\n@(#)$Id: join (AT&T Research) 2006-10-31 $\n]"
+"[-?\n@(#)$Id: join (AT&T Research) 2009-08-01 $\n]"
 USAGE_LICENSE
 "[+NAME?join - relational database operator]"
 "[+DESCRIPTION?\bjoin\b performs an \aequality join\a on the files \afile1\a "
@@ -351,7 +351,7 @@
                cp = 0;
        if ((n=jp->delim)<=0)
        {
-               if (fp->spaces)
+               if (cp && fp->spaces)
                {
                        /*eliminate leading spaces */
                        while (jp->state[*(unsigned char*)cp++]==S_SPACE);
@@ -365,7 +365,7 @@
                size = cpmax-cp;
        else
                size = 0;
-       if (size==0)
+       if (size<=1)
        {
                if (!jp->nullfield)
                        sfputc(iop,n);
--- old/usr/src/lib/libcmd/common/ln.c  Fri Sep 25 06:25:13 2009
+++ new/usr/src/lib/libcmd/common/ln.c  Fri Sep 25 06:25:12 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libcmd/common/logname.c     Fri Sep 25 06:25:16 2009
+++ new/usr/src/lib/libcmd/common/logname.c     Fri Sep 25 06:25:14 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libcmd/common/md5sum.c      Fri Sep 25 06:25:19 2009
+++ new/usr/src/lib/libcmd/common/md5sum.c      Fri Sep 25 06:25:17 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libcmd/common/mkdir.c       Fri Sep 25 06:25:22 2009
+++ new/usr/src/lib/libcmd/common/mkdir.c       Fri Sep 25 06:25:20 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -73,23 +73,29 @@
        struct stat     st;
 
        cmdinit(argc, argv, context, ERROR_CATALOG, 0);
-       while (n = optget(argv, usage)) switch (n)
+       for (;;)
        {
-       case 'p':
-               pflag = 1;
+               switch (optget(argv, usage))
+               {
+               case 0:
+                       break;
+               case 'p':
+                       pflag = 1;
+                       continue;
+               case 'm':
+                       mflag = 1;
+                       mode = strperm(arg = opt_info.arg, &opt_info.arg, mode);
+                       if (*opt_info.arg)
+                               error(ERROR_exit(0), "%s: invalid mode", arg);
+                       continue;
+               case ':':
+                       error(2, "%s", opt_info.arg);
+                       continue;
+               case '?':
+                       error(ERROR_usage(2), "%s", opt_info.arg);
+                       continue;
+               }
                break;
-       case 'm':
-               mflag = 1;
-               mode = strperm(arg = opt_info.arg, &opt_info.arg, mode);
-               if (*opt_info.arg)
-                       error(ERROR_exit(0), "%s: invalid mode", arg);
-               break;
-       case ':':
-               error(2, "%s", opt_info.arg);
-               break;
-       case '?':
-               error(ERROR_usage(2), "%s", opt_info.arg);
-               break;
        }
        argv += opt_info.index;
        if (error_info.errors || !*argv)
--- old/usr/src/lib/libcmd/common/mkfifo.c      Fri Sep 25 06:25:25 2009
+++ new/usr/src/lib/libcmd/common/mkfifo.c      Fri Sep 25 06:25:23 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -26,9 +26,8 @@
  * mkfifo
  */
 
-
 static const char usage[] =
-"[-?\n@(#)$Id: mkfifo (AT&T Research) 1999-04-20 $\n]"
+"[-?\n@(#)$Id: mkfifo (AT&T Research) 2009-01-02 $\n]"
 USAGE_LICENSE
 "[+NAME?mkfifo - make FIFOs (named pipes)]"
 "[+DESCRIPTION?\bmkfifo\b creates one or more FIFO's.  By "
@@ -50,40 +49,50 @@
 #include <cmd.h>
 #include <ls.h>
 
-#define RWALL  (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
-
 int
 b_mkfifo(int argc, char *argv[], void* context)
 {
-       register char *arg;
-       register mode_t mode=RWALL, mask=0;
-       register int n;
+       register char*  arg;
+       register mode_t mode = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH;
+       register mode_t mask = 0;
+       register int    mflag = 0;
 
        cmdinit(argc, argv, context, ERROR_CATALOG, 0);
-       while (n = optget(argv, usage)) switch (n)
+       for (;;)
        {
-         case 'm':
-               mode = strperm(arg=opt_info.arg,&opt_info.arg,mode);
-               if(*opt_info.arg)
-                       error(ERROR_exit(0),"%s: invalid mode",arg);
+               switch (optget(argv, usage))
+               {
+               case 0:
+                       break;
+               case 'm':
+                       mflag = 1;
+                       mode = strperm(arg = opt_info.arg, &opt_info.arg, mode);
+                       if (*opt_info.arg)
+                               error(ERROR_exit(0), "%s: invalid mode", arg);
+                       continue;
+               case ':':
+                       error(2, "%s", opt_info.arg);
+                       continue;
+               case '?':
+                       error(ERROR_usage(2), "%s", opt_info.arg);
+                       continue;
+               }
                break;
-         case ':':
-               error(2, "%s",opt_info.arg);
-               break;
-         case '?':
-               error(ERROR_usage(2), "%s",opt_info.arg);
-               break;
        }
        argv += opt_info.index;
-       if(error_info.errors || !*argv)
-               error(ERROR_usage(2),"%s",optusage(NiL));
-       while(arg = *argv++)
+       if (error_info.errors || !*argv)
+               error(ERROR_usage(2), "%s", optusage(NiL));
+       mask = umask(0);
+       if (!mflag)
        {
-               if(mkfifo(arg,mode) < 0)
-                       error(ERROR_system(0),"%s:",arg);
+               mode &= ~mask;
+               umask(mask);
+               mask = 0;
        }
-       if(mask)
+       while (arg = *argv++)
+               if (mkfifo(arg, mode) < 0)
+                       error(ERROR_system(0), "%s:", arg);
+       if (mask)
                umask(mask);
-       return(error_info.errors!=0);
+       return error_info.errors != 0;
 }
-
--- /dev/null   Fri Sep 25 06:25:28 2009
+++ new/usr/src/lib/libcmd/common/mktemp.c      Fri Sep 25 06:25:26 2009
@@ -0,0 +1,164 @@
+/***********************************************************************
+*                                                                      *
+*               This software is part of the ast package               *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
+*                      and is licensed under the                       *
+*                  Common Public License, Version 1.0                  *
+*                    by AT&T Intellectual Property                     *
+*                                                                      *
+*                A copy of the License is available at                 *
+*            http://www.opensource.org/licenses/cpl1.0.txt             *
+*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
+*                                                                      *
+*              Information and Software Systems Research               *
+*                            AT&T Research                             *
+*                           Florham Park NJ                            *
+*                                                                      *
+*                 Glenn Fowler <gsf at research.att.com>                  *
+*                  David Korn <dgk at research.att.com>                   *
+*                                                                      *
+***********************************************************************/
+#pragma prototyped
+
+static const char usage[] =
+"[-?\n@(#)$Id: mktemp (AT&T Research) 2009-06-19 $\n]"
+USAGE_LICENSE
+"[+NAME?mktemp - make temporary file or directory]"
+"[+DESCRIPTION?\bmktemp\b creates a temporary file with optional base "
+    "name prefix \aprefix\a. If \aprefix\a is omitted then \btmp_\b is used "
+    "and \b--tmp\b is implied. If \aprefix\a contains a directory prefix "
+    "then that directory overrides any of the directories described below. A "
+    "temporary file will have mode \brw-------\b and a temporary directory "
+    "will have mode \brwx------\b, subject to \bumask\b(1). Generated paths "
+    "have these attributes:]"
+    "{"
+        "[+*?Lower case to avoid clashes on case ignorant filesystems.]"
+        "[+*?Pseudo-random part to deter denial of service attacks.]"
+        "[+*?Pseudo-random part is \a3-chars\a.\a3-chars\a to accomodate "
+            "8.3 filesystems.]"
+    "}"
+"[+?A consecutive sequence of \bX\b's in \aprefix\a is replaced by the "
+    "pseudo-random part. If there are no \bX\b's then the pseudo-random part "
+    "is appended to the prefix.]"
+"[d:directory?Create a directory instead of a regular file.]"
+"[m:mode]:[mode?Set the mode of the created temporary to \amode\a. "
+    "\amode\a is symbolic or octal mode as in \bchmod\b(1). Relative modes "
+    "assume an initial mode of \bu=rwx\b.]"
+"[p:default?Use \adirectory\a if the \bTMPDIR\b environment variable is "
+    "not defined. Implies \b--tmp\b.]:[directory]"
+"[q:quiet?Suppress file and directory error diagnostics.]"
+"[t:tmp|temporary-directory?Create a path rooted in a temporary "
+    "directory.]"
+"[u:unsafe|dry-run?Check for file/directory existence but do not create. "
+    "Who would want to do that.]"
+"\n"
+"\n[ prefix ]\n"
+"\n"
+"[+SEE ALSO?\bmkdir\b(1), \bpathtemp\b(3), \bmktemp\b(3)]"
+;
+
+#include <cmd.h>
+#include <ls.h>
+
+int
+b_mktemp(int argc, char** argv, void* context)
+{
+       mode_t          mode = 0;
+       mode_t          mask;
+       int             fd;
+       int             i;
+       int             quiet = 0;
+       int             unsafe = 0;
+       int*            fdp = &fd;
+       char*           dir = "";
+       char*           pfx;
+       char*           t;
+       char            path[PATH_MAX];
+
+       cmdinit(argc, argv, context, ERROR_CATALOG, ERROR_NOTIFY);
+       for (;;)
+       {
+               switch (optget(argv, usage))
+               {
+               case 0:
+                       break;
+               case 'd':
+                       fdp = 0;
+                       continue;
+               case 'm':
+                       mode = strperm(pfx = opt_info.arg, &opt_info.arg, 
S_IRWXU);
+                       if (*opt_info.arg)
+                               error(ERROR_exit(0), "%s: invalid mode", pfx);
+                       continue;
+               case 'p':
+                       if ((t = getenv("TMPDIR")) && *t)
+                               dir = 0;
+                       else
+                               dir = opt_info.arg;
+                       continue;
+               case 'q':
+                       quiet = 1;
+                       continue;
+               case 't':
+                       dir = 0;
+                       continue;
+               case 'u':
+                       unsafe = 1;
+                       fdp = 0;
+                       continue;
+               case ':':
+                       error(2, "%s", opt_info.arg);
+                       continue;
+               case '?':
+                       error(ERROR_usage(2), "%s", opt_info.arg);
+                       continue;
+               }
+               break;
+       }
+       argv += opt_info.index;
+       if (error_info.errors || (pfx = *argv++) && *argv)
+               error(ERROR_usage(2), "%s", optusage(NiL));
+       mask = umask(0);
+       if (!mode)
+               mode = (fdp ? (S_IRUSR|S_IWUSR) : S_IRWXU) & ~mask;
+       umask(~mode & (S_IRWXU|S_IRWXG|S_IRWXO));
+       if (!pfx)
+       {
+               pfx = "tmp_";
+               if (dir && !*dir)
+                       dir = 0;
+       }
+       if (t = strrchr(pfx, '/'))
+       {
+               i = ++t - pfx;
+               dir = fmtbuf(i);
+               memcpy(dir, pfx, i);
+               dir[i] = 0;
+               pfx = t;
+       }
+       for (;;)
+       {
+               if (!pathtemp(path, sizeof(path), dir, pfx, fdp))
+               {
+                       if (quiet)
+                               error_info.errors++;
+                       else
+                               error(ERROR_SYSTEM|2, "cannot create temporary 
path");
+                       break;
+               }
+               if (fdp || unsafe || !mkdir(path, mode))
+               {
+                       if (fdp)
+                               close(*fdp);
+                       sfputr(sfstdout, path, '\n');
+                       break;
+               }
+               if (sh_checksig(context))
+               {
+                       error_info.errors++;
+                       break;
+               }
+       }
+       umask(mask);
+       return error_info.errors != 0;
+}
--- old/usr/src/lib/libcmd/common/mv.c  Fri Sep 25 06:25:30 2009
+++ new/usr/src/lib/libcmd/common/mv.c  Fri Sep 25 06:25:28 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libcmd/common/paste.c       Fri Sep 25 06:25:33 2009
+++ new/usr/src/lib/libcmd/common/paste.c       Fri Sep 25 06:25:31 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libcmd/common/pathchk.c     Fri Sep 25 06:25:36 2009
+++ new/usr/src/lib/libcmd/common/pathchk.c     Fri Sep 25 06:25:34 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -26,44 +26,50 @@
  */
 
 static const char usage[] =
-"[-?\n@(#)$Id: pathchk (AT&T Research) 2006-09-19 $\n]"
+"[-?\n@(#)$Id: pathchk (AT&T Research) 2009-07-24 $\n]"
 USAGE_LICENSE
 "[+NAME?pathchk - check pathnames for portability]"
-"[+DESCRIPTION?\bpathchk\b checks each \apathname\a to see if it "
-       "is valid and/or portable.  A \apathname\a is valid if it "
-       "can be used to access or create a file without causing syntax "
-       "errors.  A file is portable, if no truncation will result on "
-       "any conforming POSIX.1 implementation.]"
+"[+DESCRIPTION?\bpathchk\b checks each \apathname\a to see if it is "
+    "valid and/or portable. A \apathname\a is valid if it can be used to "
+    "access or create a file without causing syntax errors. A file is "
+    "portable if no truncation will result on any conforming POSIX.1 "
+    "implementation.]"
 "[+?By default \bpathchk\b checks each component of each \apathname\a "
-       "based on the underlying file system.  A diagnostic is written "
-       "to standard error for each pathname that:]{"
-       "[+-?Is longer than \b$(getconf PATH_MAX)\b bytes.]"
-       "[+-?Contains any component longer than \b$(getconf NAME_MAX)\b bytes.]"
-       "[+-?Contains any directory component in a directory that is "
-               "not searchable.]"
-       "[+-?Contains any character in any component that is not valid in "
-               "its containing directory.]"
-       "[+-?Is empty.]"
-       "}"
-"[p:portability?Instead of performing length checks on the underlying "
-       "file system, write a diagnostic for each pathname operand that:]{"
-       "[+-?Is longer than \b$(getconf _POSIX_PATH_MAX)\b bytes.]"
-       "[+-?Contains any component longer than "
-               "\b$(getconf _POSIX_NAME_MAX)\b bytes.]"
+    "based on the underlying file system. A diagnostic is written to "
+    "standard error for each pathname that:]"
+    "{"
+        "[+-?Is longer than \b$(getconf PATH_MAX)\b bytes.]"
+        "[+-?Contains any component longer than \b$(getconf NAME_MAX)\b "
+            "bytes.]"
+        "[+-?Contains any directory component in a directory that is not "
+            "searchable.]"
+        "[+-?Contains any character in any component that is not valid "
+            "in its containing directory.]"
+        "[+-?Is empty.]"
+    "}"
+"[p:components?Instead of performing length checks on the underlying "
+    "file system, write a diagnostic for each pathname operand that:]"
+    "{"
+        "[+-?Is longer than \b$(getconf _POSIX_PATH_MAX)\b bytes.]"
+        "[+-?Contains any component longer than \b$(getconf "
+            "_POSIX_NAME_MAX)\b bytes.]"
         "[+-?Contains any character in any component that is not in the "
-               "portable filename character set.]"
-#if 0
-       "[+-?Contains any component with \b-\b as the first character.]"
-#endif
-       "[+-?Is empty.]"
-       "}"
+            "portable filename character set.]"
+    "}"
+"[P:path?Write a diagnostic for each pathname operand that:]"
+    "{"
+        "[+-?Contains any component with \b-\b as the first character.]"
+        "[+-?Is empty.]"
+    "}"
+"[a:all|portability?Equivalent to \b--components\b \b--path\b.]"
 "\n"
 "\npathname ...\n"
 "\n"
-"[+EXIT STATUS?]{"
+"[+EXIT STATUS?]"
+    "{"
         "[+0?All \apathname\a operands passed all of the checks.]"
         "[+>0?An error occurred.]"
-"}"
+    "}"
 "[+SEE ALSO?\bgetconf\b(1), \bcreat\b(2), \bpathchk\b(2)]"
 ;
 
@@ -71,6 +77,9 @@
 #include       <cmd.h>
 #include       <ls.h>
 
+#define COMPONENTS     0x1
+#define PATH   0x2
+
 #define isport(c)      (((c)>='a' && (c)<='z') || ((c)>='A' && (c)<='Z') || 
((c)>='0' && (c)<='9') || (strchr("._-",(c))!=0) )
 
 /*
@@ -82,10 +91,10 @@
 
        static const char* const        ops[] = { "NAME_MAX", "PATH_MAX" };
 
-       errno=0;
-       if((r=strtol(astconf(ops[op], path, NiL), NiL, 0))<0 && errno==0)
-               return(LONG_MAX);
-       return(r);
+       errno = 0;
+       if ((r = strtol(astconf(ops[op], path, NiL), NiL, 0)) < 0 && !errno)
+               return LONG_MAX;
+       return r;
 }
 
 /*
@@ -100,10 +109,11 @@
 
        if(!*path)
        {
-               error(2,"path is empty");
-               return(0);
+               if (mode & PATH)
+                       error(2,"path is empty");
+               return -1;
        }
-       if(mode)
+       if(mode & COMPONENTS)
        {
                name_max = _POSIX_NAME_MAX;
                path_max = _POSIX_PATH_MAX;
@@ -177,7 +187,7 @@
                        else if(errno==ENAMETOOLONG)
                        {
                                error(2,"%s: pathname too long",path);
-                               return(0);
+                               return -1;
                        }
 #endif /*ENAMETOOLONG*/
                        else
@@ -186,18 +196,18 @@
        }
        while(*(cpold=cp))
        {
-               if(mode && *cp == '-')
+               if((mode & PATH) && *cp == '-')
                {
                        error(2,"%s: path component begins with 
'-'",path,fmtquote(buf, NiL, "'", 1, 0));
-                       return(0);
+                       return -1;
                }
                while((c= *cp++) && c!='/')
-                       if(mode && !isport(c))
+                       if((mode & COMPONENTS) && !isport(c))
                        {
                                buf[0] = c;
                                buf[1] = 0;
                                error(2,"%s: '%s' not in portable character 
set",path,fmtquote(buf, NiL, "'", 1, 0));
-                               return(0);
+                               return -1;
                        }
                if((cp-cpold) > name_max)
                        goto err;
@@ -208,41 +218,51 @@
        }
        if((cp-path) >= path_max)
        {
-               error(2,"%s: pathname too long",path);
-               return(0);
+               error(2, "%s: pathname too long", path);
+               return -1;
        }
-       return(1);
-err:
-       error(2,"%s: component name %.*s too long",path,cp-cpold-1,cpold);
-       return(0);
+       return 0;
+ err:
+       error(2, "%s: component name %.*s too long", path, cp-cpold-1, cpold);
+       return -1;
 }
 
 int
 b_pathchk(int argc, char** argv, void* context)
 {
-       register int n, mode=0;
-       register char *cp;
+       register int    n;
+       register int    mode = 0;
+       register char*  s;
 
        cmdinit(argc, argv, context, ERROR_CATALOG, 0);
-       while (n = optget(argv, usage)) switch (n)
+       for (;;)
        {
-           case 'p':
-               mode = 1;
+               switch (optget(argv, usage))
+               {
+               case 0:
+                       break;
+               case 'a':
+                       mode |= COMPONENTS|PATH;
+                       continue;
+               case 'p':
+                       mode |= COMPONENTS;
+                       continue;
+               case 'P':
+                       mode |= PATH;
+                       continue;
+               case ':':
+                       error(2, "%s", opt_info.arg);
+                       continue;
+               case '?':
+                       error(ERROR_usage(2), "%s", opt_info.arg);
+                       continue;
+               }
                break;
-           case ':':
-               error(2, "%s", opt_info.arg);
-               break;
-           case '?':
-               error(ERROR_usage(2), "%s", opt_info.arg);
-               break;
        }
        argv += opt_info.index;
-       if(*argv==0 || error_info.errors)
-               error(ERROR_usage(2),"%s", optusage((char*)0));
-       while(cp = *argv++)
-       {
-               if(!pathchk(cp,mode))
-                       error_info.errors=1;
-       }
-       return(error_info.errors);
+       if (!*argv || error_info.errors)
+               error(ERROR_usage(2),"%s", optusage(NiL));
+       while (s = *argv++)
+               pathchk(s, mode);
+       return error_info.errors != 0;
 }
--- old/usr/src/lib/libcmd/common/pids.c        Fri Sep 25 06:25:39 2009
+++ new/usr/src/lib/libcmd/common/pids.c        Fri Sep 25 06:25:37 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libcmd/common/rev.c Fri Sep 25 06:25:42 2009
+++ new/usr/src/lib/libcmd/common/rev.c Fri Sep 25 06:25:40 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libcmd/common/rev.h Fri Sep 25 06:25:44 2009
+++ new/usr/src/lib/libcmd/common/rev.h Fri Sep 25 06:25:42 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libcmd/common/revlib.c      Fri Sep 25 06:25:47 2009
+++ new/usr/src/lib/libcmd/common/revlib.c      Fri Sep 25 06:25:45 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libcmd/common/rm.c  Fri Sep 25 06:25:50 2009
+++ new/usr/src/lib/libcmd/common/rm.c  Fri Sep 25 06:25:48 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -27,7 +27,7 @@
  */
 
 static const char usage[] =
-"[-?\n@(#)$Id: rm (AT&T Research) 2008-10-15 $\n]"
+"[-?\n@(#)$Id: rm (AT&T Research) 2009-06-18 $\n]"
 USAGE_LICENSE
 "[+NAME?rm - remove files]"
 "[+DESCRIPTION?\brm\b removes the named \afile\a arguments. By default it"
@@ -81,6 +81,7 @@
 
 typedef struct State_s                 /* program state                */
 {
+       void*           context;        /* builtin context              */
        int             clobber;        /* clear out file data first    */
        int             directory;      /* remove(dir) not rmdir(dir)   */
        int             force;          /* force actions                */
@@ -179,7 +180,7 @@
                        {
                                if (state->interactive)
                                {
-                                       if ((v = astquery(-1, "remove directory 
%s? ", ent->fts_path)) < 0)
+                                       if ((v = astquery(-1, "remove directory 
%s? ", ent->fts_path)) < 0 || sh_checksig(state->context))
                                                return -1;
                                        if (v > 0)
                                        {
@@ -253,7 +254,7 @@
                        sfputr(sfstdout, ent->fts_path, '\n');
                if (state->interactive)
                {
-                       if ((v = astquery(-1, "remove %s? ", ent->fts_path)) < 
0)
+                       if ((v = astquery(-1, "remove %s? ", ent->fts_path)) < 
0 || sh_checksig(state->context))
                                return -1;
                        if (v > 0)
                        {
@@ -277,7 +278,8 @@
                                        errno == ETXTBSY ? "``running 
program''" : 
 #endif
                                        ent->fts_statp->st_uid != state->uid ? 
"``not owner''" :
-                                       fmtmode(ent->fts_statp->st_mode & 
S_IPERM, 0) + 1, ent->fts_path)) < 0)
+                                       fmtmode(ent->fts_statp->st_mode & 
S_IPERM, 0) + 1, ent->fts_path)) < 0 ||
+                                       sh_checksig(state->context))
                                                return -1;
                                        if (v > 0)
                                        {
@@ -343,6 +345,7 @@
 
        cmdinit(argc, argv, context, ERROR_CATALOG, ERROR_NOTIFY);
        memset(&state, 0, sizeof(state));
+       state.context = context;
        state.fs3d = fs3d(FS3D_TEST);
        state.terminal = isatty(0);
        for (;;)
--- old/usr/src/lib/libcmd/common/rmdir.c       Fri Sep 25 06:25:53 2009
+++ new/usr/src/lib/libcmd/common/rmdir.c       Fri Sep 25 06:25:51 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libcmd/common/shcmd.h       Fri Sep 25 06:25:56 2009
+++ /dev/null   Fri Sep 25 06:25:28 2009
@@ -1,80 +0,0 @@
-/***********************************************************************
-*                                                                      *
-*               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
-*                      and is licensed under the                       *
-*                  Common Public License, Version 1.0                  *
-*                    by AT&T Intellectual Property                     *
-*                                                                      *
-*                A copy of the License is available at                 *
-*            http://www.opensource.org/licenses/cpl1.0.txt             *
-*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
-*                                                                      *
-*              Information and Software Systems Research               *
-*                            AT&T Research                             *
-*                           Florham Park NJ                            *
-*                                                                      *
-*                 Glenn Fowler <gsf at research.att.com>                  *
-*                  David Korn <dgk at research.att.com>                   *
-*                                                                      *
-***********************************************************************/
-#pragma prototyped
-
-/*
- * ksh builtin command api
- */
-
-#ifndef _SHCMD_H
-#define _SHCMD_H       1
-
-#ifndef SH_VERSION
-#   define Shell_t     void
-#endif
-#ifndef NV_DEFAULT
-#   define Namval_t    void
-#endif
-#ifndef ERROR_NOTIFY
-#   define ERROR_NOTIFY        1
-#endif
-
-typedef int (*Shbltin_f)(int, char**, void*);
-
-#undef Shbltin_t
-typedef struct Shbltin_s
-{
-       Shell_t         *shp;
-       void            *ptr;
-       int             version;
-       int             (*shrun)(int, char**);
-       int             (*shtrap)(const char*, int);
-       void            (*shexit)(int);
-       Namval_t        *(*shbltin)(const char*, Shbltin_f, void*);
-       unsigned char   notify;
-       unsigned char   sigset;
-       unsigned char   nosfio;
-       Namval_t        *bnode;
-       Namval_t        *vnode;
-       char            *data;
-       int             flags;
-} Shbltin_t;
-
-#if defined(SH_VERSION) ||  defined(_SH_PRIVATE)
-#   undef Shell_t
-#   undef Namval_t
-#else 
-#   define sh_run(c, ac, av)   ((c)?(*((Shbltin_t*)(c))->shrun)(ac,av):-1)
-#   define sh_system(c,str)    
((c)?(*((Shbltin_t*)(c))->shtrap)(str,0):system(str))
-#   define sh_exit(c,n)                
((c)?(*((Shbltin_t*)(c))->shexit)(n):exit(n))
-#   define sh_checksig(c)      ((c) && ((Shbltin_t*)(c))->sigset)
-#   if defined(SFIO_VERSION) || defined(_AST_H)
-#      define LIB_INIT(c)
-#   else
-#      define LIB_INIT(c)      ((c) && (((Shbltin_t*)(c))->nosfio = 1))
-#   endif
-#   ifndef _CMD_H
-#      define cmdinit(ac,av,c,cat,flg)         do { if((ac)<=0) return(0); \
-           (((Shbltin_t*)(c))->notify = ((flg)&ERROR_NOTIFY)?1:0);} while(0)
-#   endif
-#endif
-
-#endif
--- old/usr/src/lib/libcmd/common/stty.c        Fri Sep 25 06:25:58 2009
+++ new/usr/src/lib/libcmd/common/stty.c        Fri Sep 25 06:25:56 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -26,7 +26,7 @@
  */
 
 static const char usage[] =
-"[-?@(#)$Id: stty (AT&T Research) 2008-04-01 $\n]"
+"[-?@(#)$Id: stty (AT&T Research) 2008-11-10 $\n]"
 USAGE_LICENSE
 "[+NAME?stty - set or get terminal modes]"
 "[+DESCRIPTION?\bstty\b sets certain terminal I/O modes for the device "
@@ -913,11 +913,9 @@
        {
                switch (n = optget(argv, usage))
                {
-               case 't':
-                       flags |= T_FLAG;
-                       continue;
                case 'a':
                case 'g':
+               case 't':
                        if (!opt_info.offset || 
!argv[opt_info.index][opt_info.offset])
                        {
                                switch (n)
@@ -928,6 +926,9 @@
                                case 'g':
                                        flags |= G_FLAG;
                                        break;
+                               case 't':
+                                       flags |= T_FLAG;
+                                       break;
                                }
                                continue;
                        }
--- old/usr/src/lib/libcmd/common/sum.c Fri Sep 25 06:26:01 2009
+++ new/usr/src/lib/libcmd/common/sum.c Fri Sep 25 06:25:59 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libcmd/common/sync.c        Fri Sep 25 06:26:04 2009
+++ new/usr/src/lib/libcmd/common/sync.c        Fri Sep 25 06:26:02 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libcmd/common/tail.c        Fri Sep 25 06:26:06 2009
+++ new/usr/src/lib/libcmd/common/tail.c        Fri Sep 25 06:26:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -28,7 +28,7 @@
  */
 
 static const char usage[] =
-"+[-?\n@(#)$Id: tail (AT&T Research) 2006-10-18 $\n]"
+"+[-?\n@(#)$Id: tail (AT&T Research) 2009-08-25 $\n]"
 USAGE_LICENSE
 "[+NAME?tail - output trailing portion of one or more files ]"
 "[+DESCRIPTION?\btail\b copies one or more input files to standard output "
@@ -44,21 +44,25 @@
        "followed by one of the following characters to specify a different "
        "unit other than a single byte:]{"
                "[+b?512 bytes.]"
-               "[+k?1-kilobyte.]"
-               "[+m?1-megabyte.]"
+               "[+k?1 KiB.]"
+               "[+m?1 MiB.]"
+               "[+g?1 GiB.]"
        "}"
 "[+?For backwards compatibility, \b-\b\anumber\a  is equivalent to "
        "\b-n\b \anumber\a and \b+\b\anumber\a is equivalent to "
-       "\b-n -\b\anumber\a.]"
+       "\b-n -\b\anumber\a. \anumber\a may also have these option "
+       "suffixes: \bb c f g k l m r\b.]"
 
 "[n:lines]:[lines:=10?Copy \alines\a lines from each file.  A negative value "
-       "for \alines\a indicates an offset from the start of the file.]"
+       "for \alines\a indicates an offset from the end of the file.]"
+"[b:blocks?Copy units of 512 bytes.]"
 "[c:bytes]:?[chars?Copy \achars\a bytes from each file.  A negative value "
-       "for \achars\a indicates an offset from the start of the file.]"
+       "for \achars\a indicates an offset from the end of the file.]"
 "[f:forever|follow?Loop forever trying to read more characters as the "
        "end of each file to copy new data. Ignored if reading from a pipe "
        "or fifo.]"
 "[h!:headers?Output filename headers.]"
+"[l:lines?Copy units of lines. This is the default.]"
 "[L:log?When a \b--forever\b file times out via \b--timeout\b, verify that "
        "the curent file has not been renamed and replaced by another file "
        "of the same name (a common log file practice) before giving up on "
@@ -83,9 +87,11 @@
                "[+S?scores]"
        "}"
 "[v:verbose?Always ouput filename headers.]"
+
 "\n"
 "\n[file ...]\n"
 "\n"
+
 "[+EXIT STATUS?]{"
        "[+0?All files copied successfully.]"
        "[+>0?One or more files did not copy.]"
@@ -103,17 +109,18 @@
 #define ERROR          (1<<1)
 #define FOLLOW         (1<<2)
 #define HEADERS                (1<<3)
-#define LOG            (1<<4)
-#define NEGATIVE       (1<<5)
-#define POSITIVE       (1<<6)
-#define REVERSE                (1<<7)
-#define SILENT         (1<<8)
-#define TIMEOUT                (1<<9)
-#define VERBOSE                (1<<10)
+#define LINES          (1<<4)
+#define LOG            (1<<5)
+#define NEGATIVE       (1<<6)
+#define POSITIVE       (1<<7)
+#define REVERSE                (1<<8)
+#define SILENT         (1<<9)
+#define TIMEOUT                (1<<10)
+#define VERBOSE                (1<<11)
 
 #define NOW            (unsigned long)time(NiL)
 
-#define LINES          10
+#define DEFAULT                10
 
 #ifdef S_ISSOCK
 #define FIFO(m)                (S_ISFIFO(m)||S_ISSOCK(m))
@@ -132,8 +139,11 @@
        unsigned long   expire;
        long            dev;
        long            ino;
+       int             fifo;
 };
 
+static const char      header_fmt[] = "\n==> %s <==\n";
+
 /*
  * if file is seekable, position file to tail location and return offset
  * otherwise, return -1
@@ -159,10 +169,10 @@
                        return first;
                return offset;
        }
-       if ((offset = last - SF_BUFSIZE) < first)
-               offset = first;
        for (;;)
        {
+               if ((offset = last - SF_BUFSIZE) < first)
+                       offset = first;
                sfseek(fp, offset, SEEK_SET);
                n = last - offset;
                if (!(s = sfreserve(fp, n, SF_LOCKR)))
@@ -178,8 +188,6 @@
                if (offset == first)
                        break;
                last = offset;
-               if ((offset = last - SF_BUFSIZE) < first)
-                       offset = first;
        }
        return first;
 }
@@ -245,11 +253,13 @@
  */
 
 static int
-init(Tail_t* tp, Sfoff_t number, int delim, int flags)
+init(Tail_t* tp, Sfoff_t number, int delim, int flags, const char** format)
 {
        Sfoff_t         offset;
+       Sfio_t*         op;
        struct stat     st;
 
+       tp->fifo = 0;
        if (tp->sp)
        {
                offset = 0;
@@ -273,12 +283,46 @@
        sfset(tp->sp, SF_SHARE, 0);
        if (offset)
        {
-               if ((offset = tailpos(tp->sp, number, delim)) < 0)
+               if (number < 0 || !number && (flags & POSITIVE))
                {
+                       sfset(tp->sp, SF_SHARE, !(flags & FOLLOW));
+                       if (number < -1)
+                       {
+                               sfmove(tp->sp, NiL, -number - 1, delim);
+                               offset = sfseek(tp->sp, (Sfoff_t)0, SEEK_CUR);
+                       }
+                       else
+                               offset = 0;
+               }
+               else if ((offset = tailpos(tp->sp, number, delim)) >= 0)
+                       sfseek(tp->sp, offset, SEEK_SET);
+               else if (fstat(sffileno(tp->sp), &st))
+               {
+                       error(ERROR_system(0), "%s: cannot stat", tp->name);
+                       goto bad;
+               }
+               else if (!FIFO(st.st_mode))
+               {
                        error(ERROR_SYSTEM|2, "%s: cannot position file to 
tail", tp->name);
                        goto bad;
                }
-               sfseek(tp->sp, offset, SEEK_SET);
+               else
+               {
+                       tp->fifo = 1;
+                       if (flags & (HEADERS|VERBOSE))
+                       {
+                               sfprintf(sfstdout, *format, tp->name);
+                               *format = header_fmt;
+                       }
+                       op = (flags & REVERSE) ? sftmp(4*SF_BUFSIZE) : sfstdout;
+                       pipetail(tp->sp ? tp->sp : sfstdin, op, number, delim);
+                       if (flags & REVERSE)
+                       {
+                               sfseek(op, (Sfoff_t)0, SEEK_SET);
+                               rev_line(op, sfstdout, (Sfoff_t)0);
+                               sfclose(op);
+                       }
+               }
        }
        tp->last = offset;
        if (flags & LOG)
@@ -325,10 +369,8 @@
                s++;
        errno = 0;
        number = strtonll(s, &t, NiL, 0);
-       if (!o && t > s && *(t - 1) == 'l')
-               t--;
        if (t == s)
-               number = LINES;
+               number = DEFAULT;
        if (o && *t)
        {
                number = 0;
@@ -346,6 +388,8 @@
        else
        {
                *f |= COUNT;
+               if (t > s && isalpha(*(t - 1)))
+                       *f &= ~LINES;
                if (c == '-')
                        number = -number;
        }
@@ -357,13 +401,12 @@
 int
 b_tail(int argc, char** argv, void* context)
 {
-       static const char       header_fmt[] = "\n==> %s <==\n";
-
        register Sfio_t*        ip;
        register int            n;
        register int            i;
-       register int            delim = '\n';
-       int                     flags = HEADERS;
+       int                     delim;
+       int                     flags = HEADERS|LINES;
+       int                     blocks = 0;
        char*                   s;
        char*                   t;
        char*                   r;
@@ -370,11 +413,11 @@
        char*                   e;
        char*                   file;
        Sfoff_t                 offset;
-       Sfoff_t                 number = LINES;
+       Sfoff_t                 number = DEFAULT;
        unsigned long           timeout = 0;
        struct stat             st;
        const char*             format = header_fmt+1;
-       size_t                  z;
+       ssize_t                 z;
        Sfio_t*                 op;
        register Tail_t*        fp;
        register Tail_t*        pp;
@@ -386,13 +429,38 @@
        {
                switch (n = optget(argv, usage))
                {
-               case 'c':
-                       delim = -1;
-                       if (opt_info.arg && *opt_info.arg=='f' && 
!*(opt_info.arg+1))
+               case 0:
+                       if (!(flags & FOLLOW) && argv[opt_info.index] && 
(argv[opt_info.index][0] == '-' || argv[opt_info.index][0] == '+') && 
!argv[opt_info.index][1])
                        {
-                               flags |= FOLLOW;
+                               number = argv[opt_info.index][0] == '-' ? 10 : 
-10;
+                               flags |= LINES;
+                               opt_info.index++;
                                continue;
                        }
+                       break;
+               case 'b':
+                       blocks = 512;
+                       flags &= ~LINES;
+                       if (opt_info.option[0] == '+')
+                               number = -number;
+                       continue;
+               case 'c':
+                       flags &= ~LINES;
+                       if (opt_info.arg == argv[opt_info.index - 1])
+                       {
+                               strtol(opt_info.arg, &s, 10);
+                               if (*s)
+                               {
+                                       opt_info.index--;
+                                       t = "";
+                                       goto suffix;
+                               }
+                       }
+                       else if (opt_info.arg && isalpha(*opt_info.arg))
+                       {
+                               t = opt_info.arg;
+                               goto suffix;
+                       }
                        /*FALLTHROUGH*/
                case 'n':
                        flags |= COUNT;
@@ -400,14 +468,14 @@
                                number = num(s, &s, &flags, n);
                        else
                        {
-                               number = LINES;
+                               number = DEFAULT;
                                flags &= ~(ERROR|NEGATIVE|POSITIVE);
                                s = "";
                        }
-                       if (n=='c' && *s=='f')
+                       if (n != 'n' && s && isalpha(*s))
                        {
-                               s++;
-                               flags |= FOLLOW;
+                               t = s;
+                               goto suffix;
                        }
                        if (flags & ERROR)
                                continue;
@@ -425,6 +493,11 @@
                        else
                                flags &= ~HEADERS;
                        continue;
+               case 'l':
+                       flags |= LINES;
+                       if (opt_info.option[0] == '+')
+                               number = -number;
+                       continue;
                case 'L':
                        flags |= LOG;
                        continue;
@@ -448,25 +521,38 @@
                        continue;
                case ':':
                        /* handle old style arguments */
-                       r = s = argv[opt_info.index];
-                       number = num(s, &t, &flags, 0);
+                       if (!(r = argv[opt_info.index]) || !opt_info.offset)
+                       {
+                               error(2, "%s", opt_info.arg);
+                               break;
+                       }
+                       s = r + opt_info.offset - 1;
+                       if (i = *(s - 1) == '-' || *(s - 1) == '+')
+                               s--;
+                       if ((number = num(s, &t, &flags, 0)) && i)
+                               number = -number;
+                       goto compatibility;
+               suffix:
+                       r = 0;
+                       if (opt_info.option[0] == '+')
+                               number = -number;
+               compatibility:
                        for (;;)
                        {
                                switch (*t++)
                                {
                                case 0:
-                                       opt_info.offset = t - r - 1;
-                                       if (number)
-                                               number = -number;
+                                       if (r)
+                                               opt_info.offset = t - r - 1;
                                        break;
                                case 'c':
-                                       delim = -1;
+                                       flags &= ~LINES;
                                        continue;
                                case 'f':
                                        flags |= FOLLOW;
                                        continue;
                                case 'l':
-                                       delim = '\n';
+                                       flags |= LINES;
                                        continue;
                                case 'r':
                                        flags |= REVERSE;
@@ -473,7 +559,8 @@
                                        continue;
                                default:
                                        error(2, "%s: invalid suffix", t - 1);
-                                       opt_info.offset = strlen(r);
+                                       if (r)
+                                               opt_info.offset = strlen(r);
                                        break;
                                }
                                break;
@@ -496,12 +583,15 @@
        }
        else if (!*(argv + 1))
                flags &= ~HEADERS;
+       delim = (flags & LINES) ? '\n' : -1;
+       if (blocks)
+               number *= blocks;
        if (flags & REVERSE)
        {
                if (delim < 0)
                        error(2, "--reverse requires line mode");
-               else if (!(flags & COUNT))
-                       number = 0;
+               if (!(flags & COUNT))
+                       number = -1;
                flags &= ~FOLLOW;
        }
        if ((flags & (FOLLOW|TIMEOUT)) == TIMEOUT)
@@ -527,7 +617,7 @@
                {
                        fp->name = s;
                        fp->sp = 0;
-                       if (!init(fp, number, delim, flags))
+                       if (!init(fp, number, delim, flags, &format))
                        {
                                fp->expire = timeout ? (NOW + timeout + 1) : 0;
                                if (files)
@@ -542,27 +632,35 @@
                        return error_info.errors != 0;
                pp->next = 0;
                hp = 0;
-               for (;;)
+               while (fp = files)
                {
                        if (sfsync(sfstdout))
                                error(ERROR_system(1), "write error");
+#if 0
                        sleep(1);
+#else
+                       {
+                               struct timespec rqt = { 0L, 1000000000L/4L };
+                               (void)nanosleep(&rqt, NULL);
+                       }
+#endif
                        n = 0;
                        pp = 0;
-                       fp = files;
                        while (fp)
                        {
                                if (fstat(sffileno(fp->sp), &st))
                                        error(ERROR_system(0), "%s: cannot 
stat", fp->name);
-                               else if (st.st_size > fp->last)
+                               else if (st.st_size > fp->last || fp->fifo)
                                {
                                        n = 1;
                                        if (timeout)
                                                fp->expire = NOW + timeout;
-                                       z = st.st_size - fp->last;
+                                       z = fp->fifo ? SF_UNBOUND : st.st_size 
- fp->last;
                                        i = 0;
                                        if ((s = sfreserve(fp->sp, z, 
SF_LOCKR)) || (z = sfvalue(fp->sp)) && (s = sfreserve(fp->sp, z, SF_LOCKR)) && 
(i = 1))
                                        {
+                                               if (fp->fifo)
+                                                       z = sfvalue(fp->sp);
                                                r = 0;
                                                for (e = (t = s) + z; t < e; 
t++)
                                                        if (*t == '\n')
@@ -594,7 +692,7 @@
                                                i = 3;
                                                while (--i && stat(fp->name, 
&st))
                                                        sleep(1);
-                                               if (i && (fp->dev != st.st_dev 
|| fp->ino != st.st_ino) && !init(fp, 0, 0, flags))
+                                               if (i && (fp->dev != st.st_dev 
|| fp->ino != st.st_ino) && !init(fp, 0, 0, flags, &format))
                                                {
                                                        if (!(flags & SILENT))
                                                                
error(ERROR_warn(0), "%s: log file change", fp->name);
@@ -636,11 +734,13 @@
                                continue;
                        }
                        if (flags & (HEADERS|VERBOSE))
+                       {
                                sfprintf(sfstdout, format, file);
-                       format = header_fmt;
+                               format = header_fmt;
+                       }
                        if (number < 0 || !number && (flags & POSITIVE))
                        {
-                               sfset(ip, SF_SHARE, !(flags & FOLLOW));
+                               sfset(ip, SF_SHARE, 1);
                                if (number < -1)
                                        sfmove(ip, NiL, -number - 1, delim);
                                if (flags & REVERSE)
--- old/usr/src/lib/libcmd/common/tee.c Fri Sep 25 06:26:09 2009
+++ new/usr/src/lib/libcmd/common/tee.c Fri Sep 25 06:26:08 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -27,7 +27,7 @@
  */
 
 static const char usage[] =
-"[-?\n@(#)$Id: tee (AT&T Research) 2007-11-11 $\n]"
+"[-?\n@(#)$Id: tee (AT&T Research) 2009-06-19 $\n]"
 USAGE_LICENSE
 "[+NAME?tee - duplicate standard input]"
 "[+DESCRIPTION?\btee\b copies standard input to standard output "
@@ -52,7 +52,6 @@
 "[+SEE ALSO?\bcat\b(1), \bsignal\b(3)]"
 ;
 
-
 #include <cmd.h>
 #include <ls.h>
 #include <sig.h>
@@ -60,6 +59,7 @@
 typedef struct Tee_s
 {
        Sfdisc_t        disc;
+       int             line;
        int             fd[1];
 } Tee_t;
 
@@ -67,7 +67,8 @@
  * This discipline writes to each file in the list given in handle
  */
 
-static ssize_t tee_write(Sfio_t* fp, const void* buf, size_t n, Sfdisc_t* 
handle)
+static ssize_t
+tee_write(Sfio_t* fp, const void* buf, size_t n, Sfdisc_t* handle)
 {
        register const char*    bp;
        register const char*    ep;
@@ -82,13 +83,29 @@
                while (bp < ep)
                {
                        if ((r = write(fd, bp, ep - bp)) <= 0)
-                               return(-1);
+                               return -1;
                        bp += r;
                }
        } while ((fd = *hp++) >= 0);
-       return(n);
+       return n;
 }
 
+static void
+tee_cleanup(register Tee_t* tp)
+{
+       register int*   hp;
+       register int    n;
+
+       if (tp)
+       {
+               sfdisc(sfstdout, NiL);
+               if (tp->line >= 0)
+                       sfset(sfstdout, SF_LINE, tp->line);
+               for (hp = tp->fd; (n = *hp) >= 0; hp++)
+                       close(n);
+       }
+}
+
 int
 b_tee(int argc, register char** argv, void* context)
 {
@@ -100,32 +117,45 @@
        int                     line;
        Sfdisc_t                tee_disc;
 
-       cmdinit(argc, argv, context, ERROR_CATALOG, 0);
+       if (argc <= 0)
+       {
+               if (context && (tp = (Tee_t*)sh_context(context)->data))
+               {
+                       sh_context(context)->data = 0;
+                       tee_cleanup(tp);
+               }
+               return 0;
+       }
+       cmdinit(argc, argv, context, ERROR_CATALOG, ERROR_CALLBACK);
        line = -1;
-       while (n = optget(argv, usage)) switch (n)
+       for (;;)
        {
-       case 'a':
-               oflag &= ~O_TRUNC;
-               oflag |= O_APPEND;
+               switch (optget(argv, usage))
+               {
+               case 'a':
+                       oflag &= ~O_TRUNC;
+                       oflag |= O_APPEND;
+                       continue;
+               case 'i':
+                       signal(SIGINT, SIG_IGN);
+                       continue;
+               case 'l':
+                       line = sfset(sfstdout, 0, 0) & SF_LINE;
+                       if ((line == 0) == (opt_info.num == 0))
+                               line = -1;
+                       else
+                               sfset(sfstdout, SF_LINE, !!opt_info.num);
+                       continue;
+               case ':':
+                       error(2, "%s", opt_info.arg);
+                       break;
+               case '?':
+                       error(ERROR_usage(2), "%s", opt_info.arg);
+                       break;
+               }
                break;
-       case 'i':
-               signal(SIGINT, SIG_IGN);
-               break;
-       case 'l':
-               line = sfset(sfstdout, 0, 0) & SF_LINE;
-               if ((line == 0) == (opt_info.num == 0))
-                       line = -1;
-               else
-                       sfset(sfstdout, SF_LINE, !!opt_info.num);
-               break;
-       case ':':
-               error(2, "%s", opt_info.arg);
-               break;
-       case '?':
-               error(ERROR_usage(2), "%s", opt_info.arg);
-               break;
        }
-       if(error_info.errors)
+       if (error_info.errors)
                error(ERROR_usage(2), "%s", optusage(NiL));
        argv += opt_info.index;
        argc -= opt_info.index;
@@ -139,40 +169,36 @@
 #endif
        if (argc > 0)
        {
-               if (!(tp = (Tee_t*)stakalloc(sizeof(Tee_t) + argc * 
sizeof(int))))
-                       error(ERROR_exit(1), "no space");
-               memset(&tee_disc, 0, sizeof(tee_disc));
-               tee_disc.writef = tee_write;
-               tp->disc = tee_disc;
-               hp = tp->fd;
-               while (cp = *argv++)
+               if (tp = (Tee_t*)stakalloc(sizeof(Tee_t) + argc * sizeof(int)))
                {
-                       if ((*hp = open(cp, oflag, 
S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)) < 0)
-                               error(ERROR_system(0), "%s: cannot create", cp);
-                       else hp++;
+                       memset(&tp->disc, 0, sizeof(tp->disc));
+                       tp->disc.writef = tee_write;
+                       if (context)
+                               sh_context(context)->data = (void*)tp;
+                       tp->line = line;
+                       hp = tp->fd;
+                       while (cp = *argv++)
+                       {
+                               if ((*hp = open(cp, oflag, 
S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)) < 0)
+                                       error(ERROR_system(0), "%s: cannot 
create", cp);
+                               else
+                                       hp++;
+                       }
+                       if (hp == tp->fd)
+                               tp = 0;
+                       else
+                       {
+                               *hp = -1;
+                               sfdisc(sfstdout, &tp->disc);
+                       }
                }
-               if (hp == tp->fd)
-                       tp = 0;
                else
-               {
-                       *hp = -1;
-                       sfdisc(sfstdout, &tp->disc);
-               }
+                       error(ERROR_exit(0), "out of space");
        }
-       if (sfmove(sfstdin, sfstdout, SF_UNBOUND, -1) < 0 || !sfeof(sfstdin) || 
sfsync(sfstdout))
-               error(ERROR_system(1), "cannot copy");
-
-       /*
-        * close files and free resources
-        */
-
-       if (tp)
-       {
-               sfdisc(sfstdout, NiL);
-               if (line >= 0)
-                       sfset(sfstdout, SF_LINE, line);
-               for(hp = tp->fd; (n = *hp) >= 0; hp++)
-                       close(n);
-       }
-       return(error_info.errors);
+       if ((sfmove(sfstdin, sfstdout, SF_UNBOUND, -1) < 0 || !sfeof(sfstdin)) 
&& errno != EPIPE)
+               error(ERROR_system(0), "read error");
+       if (sfsync(sfstdout))
+               error(ERROR_system(0), "write error");
+       tee_cleanup(tp);
+       return error_info.errors;
 }
--- old/usr/src/lib/libcmd/common/tty.c Fri Sep 25 06:26:12 2009
+++ new/usr/src/lib/libcmd/common/tty.c Fri Sep 25 06:26:10 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libcmd/common/uname.c       Fri Sep 25 06:26:15 2009
+++ new/usr/src/lib/libcmd/common/uname.c       Fri Sep 25 06:26:13 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -104,7 +104,7 @@
 extern int     getdomainname(char*, size_t);
 #endif
 #if _lib_gethostid
-extern int     gethostid(void);
+extern long    gethostid(void);
 #endif
 #if _lib_gethostname
 extern int     gethostname(char*, size_t);
--- old/usr/src/lib/libcmd/common/uniq.c        Fri Sep 25 06:26:18 2009
+++ new/usr/src/lib/libcmd/common/uniq.c        Fri Sep 25 06:26:16 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -26,17 +26,17 @@
  */
 
 static const char usage[] =
-"[-n?\n@(#)$Id: uniq (AT&T Research) 2008-04-24 $\n]"
+"[-n?\n@(#)$Id: uniq (AT&T Research) 2009-08-10 $\n]"
 USAGE_LICENSE
 "[+NAME?uniq - Report or filter out repeated lines in a file]"
-"[+DESCRIPTION?\buniq\b reads an input, comparing adjacent lines, and "
-       "writing one copy of each input line on the output.  The second "
+"[+DESCRIPTION?\buniq\b reads the input, compares adjacent lines, and "
+       "writes one copy of each input line on the output.  The second "
        "and succeeding copies of the repeated adjacent lines are not "
        "written.]"
 "[+?If the output file, \aoutfile\a, is not specified, \buniq\b writes "
        "to standard output.  If no \ainfile\a is given, or if the \ainfile\a "
-       "is \b-\b, \buniq\b reads from standard input with  the start of "
-       "the file is defined as the current offset.]"
+       "is \b-\b, \buniq\b reads from standard input with the start of "
+       "the file defined as the current offset.]"
 "[c:count?Output the number of times each line occurred  along with "
        "the line.]"
 "[d:repeated|duplicates?Output the first of each duplicate line.]"
@@ -49,13 +49,15 @@
     "}"
 "[f:skip-fields]#[fields?\afields\a is the number of fields to skip over "
     "before checking for uniqueness. A field is the minimal string matching "
-    "the BRE \b[[:blank:]]]]*[^[:blank:]]]]*\b.]"
+    "the BRE \b[[:blank:]]]]*[^[:blank:]]]]*\b. -\anumber\a is equivalent to "
+    "\b--skip-fields\b=\anumber\a.]"
 "[i:ignore-case?Ignore case in comparisons.]"
 "[s:skip-chars]#[chars?\achars\a is the number of characters to skip over "
        "before checking for uniqueness.  If specified along with \b-f\b, "
        "the first \achars\a after the first \afields\a are ignored.  If "
        "the \achars\a specifies more characters than are on the line, "
-       "an empty string will be used for comparison.]"
+       "an empty string will be used for comparison. +\anumber\a is "
+       "equivalent to \b--skip-chars\b=\anumber\a.]"
 "[u:unique?Output unique lines.]"
 "[w:check-chars]#[chars?\achars\a is the number of characters to compare " 
        "after skipping any specified fields and characters.]"
@@ -145,12 +147,26 @@
                                {
                                        if(cwidth)
                                        {
-                                               outp[CWIDTH] = ' ';
-                                               if(count<MAXCNT)
+                                               if(count<9)
                                                {
-                                                       
sfsprintf(outp,cwidth,"%*d",CWIDTH,count+1);
-                                                       outp[CWIDTH] = ' ';
+                                                       f = 0;
+                                                       while(f < CWIDTH-1)
+                                                               outp[f++] = ' ';
+                                                       outp[f++] = '0' + count 
+ 1;
+                                                       outp[f] = ' ';
                                                }
+                                               else if(count<MAXCNT)
+                                               {
+                                                       count++;
+                                                       f = CWIDTH;
+                                                       outp[f--] = ' ';
+                                                       do
+                                                       {
+                                                               outp[f--] = '0' 
+ (count % 10);
+                                                       } while (count /= 10);
+                                                       while (f >= 0)
+                                                               outp[f--] = ' ';
+                                               }
                                                else
                                                {
                                                        outsize -= (CWIDTH+1);
--- old/usr/src/lib/libcmd/common/wc.c  Fri Sep 25 06:26:21 2009
+++ new/usr/src/lib/libcmd/common/wc.c  Fri Sep 25 06:26:19 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -27,7 +27,7 @@
  */
 
 static const char usage[] =
-"[-?\n@(#)$Id: wc (AT&T Research) 2006-08-25 $\n]"
+"[-?\n@(#)$Id: wc (AT&T Research) 2000-08-11 $\n]"
 USAGE_LICENSE
 "[+NAME?wc - print the number of bytes, words, and lines in files]"
 "[+DESCRIPTION?\bwc\b reads one or more input files and, by default, "
@@ -50,7 +50,10 @@
 "[c:bytes|chars:chars?List the byte counts.]"
 "[m|C:multibyte-chars?List the character counts.]"
 "[q:quiet?Suppress invalid multibyte character warnings.]"
-"[L:longest-line|max-line-length?List the longest line length.]"
+"[L:longest-line|max-line-length?List the longest line length; the newline,"
+    "if any, is not counted in the length.]"
+"[N!:utf8?For \bUTF-8\b locales \b--noutf8\b disables \bUTF-8\b "
+    "optimzations and relies on the native \bmbtowc\b(3).]"
 "\n"
 "\n[file ...]\n"
 "\n"
@@ -70,15 +73,15 @@
 
 static void printout(register Wc_t *wp, register char *name,register int mode)
 {
-       if(mode&WC_LINES)
+       if (mode&WC_LINES)
                sfprintf(sfstdout," %7I*d",sizeof(wp->lines),wp->lines);
-       if(mode&WC_WORDS)
+       if (mode&WC_WORDS)
                sfprintf(sfstdout," %7I*d",sizeof(wp->words),wp->words);
-       if(mode&WC_CHARS)
+       if (mode&WC_CHARS)
                sfprintf(sfstdout," %7I*d",sizeof(wp->chars),wp->chars);
-       if(mode&WC_LONGEST)
+       if (mode&WC_LONGEST)
                sfprintf(sfstdout," %7I*d",sizeof(wp->chars),wp->longest);
-       if(name)
+       if (name)
                sfprintf(sfstdout," %s",name);
        sfputc(sfstdout,'\n');
 }
@@ -94,71 +97,72 @@
        struct stat     statb;
 
        cmdinit(argc, argv, context, ERROR_CATALOG, 0);
-       while (n = optget(argv,usage)) switch (n)
+       for (;;)
        {
-       case 'c':
-               mode |= WC_CHARS;
+               switch (optget(argv, usage))
+               {
+               case 'c':
+                       mode |= WC_CHARS;
+                       continue;
+               case 'l':
+                       mode |= WC_LINES;
+                       continue;
+               case 'L':
+                       mode |= WC_LONGEST;
+                       continue;
+               case 'N':
+                       if (!opt_info.num)
+                               mode |= WC_NOUTF8;
+                       continue;
+               case 'm':
+               case 'C':
+                       mode |= WC_MBYTE;
+                       continue;
+               case 'q':
+                       mode |= WC_QUIET;
+                       continue;
+               case 'w':
+                       mode |= WC_WORDS;
+                       continue;
+               case ':':
+                       error(2, "%s", opt_info.arg);
+                       break;
+               case '?':
+                       error(ERROR_usage(2), "%s", opt_info.arg);
+                       break;
+               }
                break;
-       case 'l':
-               mode |= WC_LINES;
-               break;
-       case 'L':
-               mode |= WC_LONGEST;
-               break;
-       case 'm':
-       case 'C':
-               mode |= WC_MBYTE;
-               break;
-       case 'q':
-               mode |= WC_QUIET;
-               break;
-       case 'w':
-               mode |= WC_WORDS;
-               break;
-       case ':':
-               error(2, "%s", opt_info.arg);
-               break;
-       case '?':
-               error(ERROR_usage(2), "%s", opt_info.arg);
-               break;
        }
        argv += opt_info.index;
        if (error_info.errors)
                error(ERROR_usage(2), "%s", optusage(NiL));
-       if(mode&WC_MBYTE)
+       if (mode&WC_MBYTE)
        {
-               if(mode&WC_CHARS)
+               if (mode&WC_CHARS)
                        error(2, "-c and -C are mutually exclusive");
-               mode |= WC_CHARS;
-               if(!mbwide())
-               {
+               if (!mbwide())
                        mode &= ~WC_MBYTE;
-                       setlocale(LC_CTYPE, "C");
-               }
+               mode |= WC_CHARS;
        }
-       if(!(mode&(WC_WORDS|WC_CHARS|WC_LINES|WC_MBYTE|WC_LONGEST)))
+       if (!(mode&(WC_WORDS|WC_CHARS|WC_LINES|WC_MBYTE|WC_LONGEST)))
                mode |= (WC_WORDS|WC_CHARS|WC_LINES);
-       if(!(wp = wc_init(mode)))
+       if (!(wp = wc_init(mode)))
                error(3,"internal error");
-       if(!(mode&WC_WORDS))
-       {
-               memzero(wp->space, (1<<CHAR_BIT));
-               wp->space['\n'] = -1;
-       }
-       if(cp = *argv)
+       if (cp = *argv)
                argv++;
+       n = 0;
        do
        {
-               if(!cp || streq(cp,"-"))
+               if (!cp || streq(cp,"-"))
                        fp = sfstdin;
-               else if(!(fp = sfopen(NiL,cp,"r")))
+               else if (!(fp = sfopen(NiL,cp,"r")))
                {
                        error(ERROR_system(0),"%s: cannot open",cp);
                        continue;
                }
-               if(cp)
+               if (cp)
                        n++;
-               if(!(mode&(WC_WORDS|WC_LINES|WC_MBYTE|WC_LONGEST)) && 
fstat(sffileno(fp),&statb)>=0
+               if (!(mode&(WC_WORDS|WC_LINES|WC_MBYTE|WC_LONGEST)) && 
fstat(sffileno(fp),&statb)>=0
                         && S_ISREG(statb.st_mode))
                {
                        wp->chars = statb.st_size - lseek(sffileno(fp),0L,1);
@@ -166,15 +170,14 @@
                }
                else
                        wc_count(wp, fp, cp);
-               if(fp!=sfstdin)
+               if (fp!=sfstdin)
                        sfclose(fp);
                tchars += wp->chars;
                twords += wp->words;
                tlines += wp->lines;
                printout(wp,cp,mode);
-       }
-       while(cp= *argv++);
-       if(n>1)
+       } while (cp= *argv++);
+       if (n > 1)
        {
                wp->lines = tlines;
                wp->chars = tchars;
@@ -181,6 +184,5 @@
                wp->words = twords;
                printout(wp,"total",mode);
        }
-       return(error_info.errors<ERRORMAX?error_info.errors:ERRORMAX);
+       return error_info.errors<ERRORMAX?error_info.errors:ERRORMAX;
 }
-
--- old/usr/src/lib/libcmd/common/wc.h  Fri Sep 25 06:26:24 2009
+++ new/usr/src/lib/libcmd/common/wc.h  Fri Sep 25 06:26:22 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -37,15 +37,17 @@
 #define WC_MBYTE       0x08
 #define WC_LONGEST     0x10
 #define WC_QUIET       0x20
+#define WC_NOUTF8      0x40
 
 typedef struct
 {
-       signed char space[1<<CHAR_BIT];
+       char    type[1<<CHAR_BIT];
        Sfoff_t words;
        Sfoff_t lines;
        Sfoff_t chars;
        Sfoff_t longest;
        int     mode;
+       int     mb;
 } Wc_t;
 
 #define wc_count       _cmd_wccount
--- old/usr/src/lib/libcmd/common/wclib.c       Fri Sep 25 06:26:26 2009
+++ new/usr/src/lib/libcmd/common/wclib.c       Fri Sep 25 06:26:25 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -34,6 +34,7 @@
 
 #include <wchar.h>
 #include <wctype.h>
+#include <lc.h>
 
 #else
 
@@ -43,80 +44,197 @@
 
 #endif
 
-#define endline(c)     (((signed char)-1)<0?(c)<0:(c)==((char)-1))
-#define mbok(p,n)      
(((n)<1)?0:mbwide()?((*ast.mb_towc)(NiL,(char*)(p),n)>=0):1)
+#define        WC_SP           0x08
+#define        WC_NL           0x10
+#define        WC_MB           0x20
+#define        WC_ERR          0x40
 
-Wc_t *wc_init(int mode)
+#define eol(c)         ((c)&WC_NL)
+#define mbc(c)         ((c)&WC_MB)
+#define spc(c)         ((c)&WC_SP)
+#define mbwc(w,p,n)    (*ast.mb_towc)(&w,(char*)p,n)
+
+Wc_t* wc_init(int mode)
 {
        register int    n;
        register int    w;
        Wc_t*           wp;
 
-       if(!(wp = (Wc_t*)stakalloc(sizeof(Wc_t))))
-               return(0);
-       wp->mode = mode;
+       if (!(wp = (Wc_t*)stakalloc(sizeof(Wc_t))))
+               return 0;
+       if (!mbwide())
+               wp->mb = 0;
+#if _hdr_wchar && _hdr_wctype && _lib_iswctype
+       else if (!(mode & WC_NOUTF8) && (lcinfo(LC_CTYPE)->lc->flags & LC_utf8))
+               wp->mb = 1;
+#endif
+       else
+               wp->mb = -1;
        w = mode & WC_WORDS;
-       for(n=(1<<CHAR_BIT);--n >=0;)
-               wp->space[n] = w ? !!isspace(n) : 0;
-       wp->space['\n'] = -1;
-       return(wp);
+       for (n = (1<<CHAR_BIT); --n >= 0;)
+               wp->type[n] = (w && isspace(n)) ? WC_SP : 0;
+       wp->type['\n'] = WC_SP|WC_NL;
+       if ((mode & (WC_MBYTE|WC_WORDS)) && wp->mb > 0)
+       {
+               for (n = 0; n < 64; n++)
+               {
+                       wp->type[0x80+n] |= WC_MB;
+                       if (n<32)
+                               wp->type[0xc0+n] |= WC_MB+1;
+                       else if (n<48)
+                               wp->type[0xc0+n] |= WC_MB+2;
+                       else if (n<56)
+                               wp->type[0xc0+n] |= WC_MB+3;
+                       else if (n<60)
+                               wp->type[0xc0+n] |= WC_MB+4;
+                       else if (n<62)
+                               wp->type[0xc0+n] |= WC_MB+5;
+               }
+               wp->type[0xc0] = WC_MB|WC_ERR;
+               wp->type[0xc1] = WC_MB|WC_ERR;
+               wp->type[0xfe] = WC_MB|WC_ERR;
+               wp->type[0xff] = WC_MB|WC_ERR;
+       }
+       wp->mode = mode;
+       return wp;
 }
 
+static int invalid(const char *file, int nlines)
+{
+       error_info.file = (char*)file;
+       error_info.line = nlines;
+       error(ERROR_SYSTEM|1, "invalid multibyte character");
+       error_info.file = 0;
+       error_info.line = 0;
+       return nlines;
+}
+
 /*
+ * handle utf space characters
+ */
+
+static int chkstate(int state, register unsigned int c)
+{
+       switch(state)
+       {
+       case 1:
+               state = (c==0x9a?4:0);
+               break;
+       case 2:
+               state = ((c==0x80||c==0x81)?6+(c&1):0);
+               break;
+       case 3:
+               state = (c==0x80?5:0);
+               break;
+       case 4:
+               state = (c==0x80?10:0);
+               break;
+       case 5:
+               state = (c==0x80?10:0);
+               break;
+       case 6:
+               state = 0;
+               if(c==0xa0 || c==0xa1)
+                       return(10);
+               else if((c&0xf0)== 0x80)
+               {
+                       if((c&=0xf)==7)
+                               return(iswspace(0x2007)?10:0);
+                       if(c<=0xb)
+                               return(10);
+               }
+               else if(c==0xaf && iswspace(0x202f))
+                       return(10);
+               break;
+       case 7:
+               state = (c==0x9f?10:0);
+               break;
+       case 8:
+               return (iswspace(c)?10:0);
+       }
+       return state;
+}
+
+/*
  * compute the line, word, and character count for file <fd>
  */
+
 int wc_count(Wc_t *wp, Sfio_t *fd, const char* file)
 {
-       register signed char    *space = wp->space;
-       register unsigned char  *cp;
+       register char*          type = wp->type;
+       register unsigned char* cp;
        register Sfoff_t        nchars;
        register Sfoff_t        nwords;
        register Sfoff_t        nlines;
-       register Sfoff_t        eline;
-       register Sfoff_t        longest;
+       register Sfoff_t        eline = -1;
+       register Sfoff_t        longest = 0;
        register ssize_t        c;
-       register unsigned char  *endbuff;
-       register int            lasttype = 1;
+       register unsigned char* endbuff;
+       register int            lasttype = WC_SP;
        unsigned int            lastchar;
-       unsigned char           *buff;
+       ssize_t                 n;
+       ssize_t                 o;
+       unsigned char*          buff;
        wchar_t                 x;
+       unsigned char           side[32];
 
        sfset(fd,SF_WRITE,1);
        nlines = nwords = nchars = 0;
        wp->longest = 0;
-       if (wp->mode & (WC_LONGEST|WC_MBYTE))
+       if (wp->mb < 0 && (wp->mode & (WC_MBYTE|WC_WORDS)))
        {
-               longest = 0;
-               eline = -1;
                cp = buff = endbuff = 0;
                for (;;)
                {
-                       if (!mbok(cp, endbuff-cp))
+                       if (cp >= endbuff || (n = mbwc(x, cp, endbuff-cp)) < 0)
                        {
-                               if (buff)
-                                       sfread(fd, buff, cp-buff);
-                               if (!(buff = (unsigned char*)sfreserve(fd, 
SF_UNBOUND, SF_LOCKR)))
-                                       break;
-                               endbuff = (cp = buff) + sfvalue(fd);
-                       }
-                       nchars++;
-                       x = mbchar(cp);
-                       if (x == -1)
-                       {
-                               if (eline != nlines && !(wp->mode & WC_QUIET))
+                               if ((o = endbuff-cp) < sizeof(side))
                                {
-                                       error_info.file = (char*)file;
-                                       error_info.line = eline = nlines;
-                                       error(ERROR_SYSTEM|1, "invalid 
multibyte character");
-                                       error_info.file = 0;
-                                       error_info.line = 0;
+                                       if (buff)
+                                       {
+                                               if (o)
+                                                       memcpy(side, cp, o);
+                                               mbinit();
+                                       }
+                                       else
+                                               o = 0;
+                                       cp = side + o;
+                                       if (!(buff = (unsigned 
char*)sfreserve(fd, SF_UNBOUND, 0)) || (n = sfvalue(fd)) <= 0)
+                                       {
+                                               if ((nchars - longest) > 
wp->longest)
+                                                       wp->longest = nchars - 
longest;
+                                               break;
+                                       }
+                                       if ((c = sizeof(side) - o) > n)
+                                               c = n;
+                                       if (c)
+                                               memcpy(cp, buff, c);
+                                       endbuff = buff + n;
+                                       cp = side;
+                                       x = mbchar(cp);
+                                       if ((cp-side) < o)
+                                       {
+                                               cp = buff;
+                                               nchars += (cp-side) - 1;
+                                       }
+                                       else
+                                               cp = buff + (cp-side) - o;
                                }
+                               else
+                               {
+                                       cp++;
+                                       x = -1;
+                               }
+                               if (x == -1 && eline != nlines && !(wp->mode & 
WC_QUIET))
+                                       eline = invalid(file, nlines);
                        }
-                       else if (x == '\n')
+                       else
+                               cp += n ? n : 1;
+                       if (x == '\n')
                        {
                                if ((nchars - longest) > wp->longest)
                                        wp->longest = nchars - longest;
-                               longest = nchars;
+                               longest = nchars + 1;
                                nlines++;
                                lasttype = 1;
                        }
@@ -127,71 +245,253 @@
                                lasttype = 0;
                                nwords++;
                        }
+                       nchars++;
                }
        }
+       else if (!wp->mb && !(wp->mode & WC_LONGEST) || wp->mb > 0 && 
!(wp->mode & (WC_MBYTE|WC_WORDS|WC_LONGEST)))
+       {
+               if (!(wp->mode & (WC_MBYTE|WC_WORDS|WC_LONGEST)))
+               {
+                       while ((cp = (unsigned char*)sfreserve(fd, SF_UNBOUND, 
0)) && (c = sfvalue(fd)) > 0)
+                       {
+                               nchars += c;
+                               endbuff = cp + c;
+                               if (*--endbuff == '\n')
+                                       nlines++;
+                               else
+                                       *endbuff = '\n';
+                               for (;;)
+                                       if (*cp++ == '\n')
+                                       {
+                                               if (cp > endbuff)
+                                                       break;
+                                               nlines++;
+                                       }
+                       }
+               }
+               else
+               {
+                       while ((cp = buff = (unsigned char*)sfreserve(fd, 
SF_UNBOUND, 0)) && (c = sfvalue(fd)) > 0)
+                       {
+                               nchars += c;
+                               /* check to see whether first character 
terminates word */
+                               if (c==1)
+                               {
+                                       if (eol(lasttype))
+                                               nlines++;
+                                       if ((c = type[*cp]) && !lasttype)
+                                               nwords++;
+                                       lasttype = c;
+                                       continue;
+                               }
+                               if (!lasttype && type[*cp])
+                                       nwords++;
+                               lastchar = cp[--c];
+                               *(endbuff = cp+c) = '\n';
+                               c = lasttype;
+                               /* process each buffer */
+                               for (;;)
+                               {
+                                       /* process spaces and new-lines */
+                                       do
+                                       {
+                                               if (eol(c))
+                                                       for (;;)
+                                                       {
+                                                               /* check for 
end of buffer */
+                                                               if (cp > 
endbuff)
+                                                                       goto 
beob;
+                                                               nlines++;
+                                                               if (*cp != '\n')
+                                                                       break;
+                                                               cp++;
+                                                       }
+                                       } while (c = type[*cp++]);
+                                       /* skip over word characters */
+                                       while (!(c = type[*cp++]));
+                                       nwords++;
+                               }
+                       beob:
+                               if ((cp -= 2) >= buff)
+                                       c = type[*cp];
+                               else
+                                       c = lasttype;
+                               lasttype = type[lastchar];
+                               /* see if was in word */
+                               if (!c && !lasttype)
+                                       nwords--;
+                       }
+                       if (eol(lasttype))
+                               nlines++;
+                       else if (!lasttype)
+                               nwords++;
+               }
+       }
        else
        {
-               for (;;)
+               int             lineoff=0;
+               int             skip=0;
+               int             adjust=0;
+               int             state=0;
+               int             oldc;
+               int             xspace;
+               int             wasspace = 1;
+               unsigned char*  start;
+
+               lastchar = 0;
+               start = (endbuff = side) + 1;
+               xspace = iswspace(0xa0) || iswspace(0x85);
+               while ((cp = buff = (unsigned char*)sfreserve(fd, SF_UNBOUND, 
0)) && (c = sfvalue(fd)) > 0)
                {
-                       /* fill next buffer and check for end-of-file */
-                       if (!(buff = (unsigned char*)sfreserve(fd, 0, 0)) || (c 
= sfvalue(fd)) <= 0)
-                               break;
-                       sfread(fd,(char*)(cp=buff),c);
                        nchars += c;
+                       start = cp-lineoff;
                        /* check to see whether first character terminates word 
*/
                        if(c==1)
                        {
-                               if(endline(lasttype))
+                               if(eol(lasttype))
                                        nlines++;
-                               if((c = space[*cp]) && !lasttype)
+                               if((c = type[*cp]) && !lasttype)
                                        nwords++;
                                lasttype = c;
+                               endbuff = start;
                                continue;
                        }
-                       if(!lasttype && space[*cp])
-                               nwords++;
                        lastchar = cp[--c];
-                       cp[c] = '\n';
                        endbuff = cp+c;
+                       cp[c] = '\n';
+                       if(mbc(lasttype))
+                       {
+                               c = lasttype;
+                               goto mbyte;
+                       }
+                       if(!lasttype && spc(type[*cp]))
+                               nwords++;
                        c = lasttype;
                        /* process each buffer */
                        for (;;)
                        {
                                /* process spaces and new-lines */
-                               do if (endline(c))
+                       spaces:
+                               do
                                {
-                                       for (;;)
+                                       if (eol(c))
                                        {
                                                /* check for end of buffer */
                                                if (cp > endbuff)
                                                        goto eob;
+                                               if(wp->mode&WC_LONGEST)
+                                               {
+                                                       if((cp-start)-adjust > 
longest)
+                                                               longest = 
(cp-start)-adjust-1;
+                                                       start = cp;
+                                               }
                                                nlines++;
-                                               if (*cp != '\n')
+                                               nchars -= adjust;
+                                               adjust = 0;
+                                       }
+                               } while (spc(c = type[*cp++]));
+                               wasspace=1;
+                               if(mbc(c))
+                               {
+                               mbyte:
+                                       do
+                                       {
+                                               if(c&WC_ERR)
+                                                       goto err;
+                                               if(skip && (c&7))
                                                        break;
-                                               cp++;
+                                               if(!skip)
+                                               {
+                                                       if(!(c&7))
+                                                       {
+                                                               skip=1;
+                                                               break;
+                                                       }
+                                                       skip = (c&7);
+                                                       adjust += skip;
+                                                       state = 0;
+                                                       if(skip==2 && 
(cp[-1]&0xc)==0 && (state=(cp[-1]&0x3)))
+                                                               oldc = *cp;
+                                                       else if(xspace && 
cp[-1]==0xc2)
+                                                       {
+                                                               state = 8;
+                                                               oldc = *cp;
+                                                       }
+                                               }
+                                               else
+                                               {
+                                                       skip--;
+                                                       if(state && 
(state=chkstate(state,oldc)))
+                                                       {
+                                                               if(state==10)
+                                                               {
+                                                                       
if(!wasspace)
+                                                                               
nwords++;
+                                                                       
wasspace = 1;
+                                                                       state=0;
+                                                                       goto 
spaces;
+                                                               }
+                                                               oldc = *cp;
+                                                       }
+                                               }
+                                       } while (mbc(c = type[*cp++]));
+                                       wasspace = 0;
+                                       if(skip)
+                                       {
+                                               if(eol(c) && (cp > endbuff))
+                                                       goto eob;
+                               err:
+                                               skip = 0;
+                                               state = 0;
+                                               if(eline!=nlines && !(wp->mode 
& WC_QUIET))
+                                                       eline = invalid(file, 
nlines);
+                                               while(mbc(c) && ((c|WC_ERR) || 
(c&7)==0)) 
+                                                       c=type[*cp++];
+                                               if(eol(c) && (cp > endbuff))
+                                               {
+                                                       c = WC_MB|WC_ERR;
+                                                       goto eob;
+                                               }
+                                               if(mbc(c))
+                                                       goto mbyte;
+                                               else if(c&WC_SP)
+                                                       goto spaces;
                                        }
-                               } while (c = space[*cp++]);
+                                       if(spc(c))
+                                       {
+                                               nwords++;
+                                               continue;
+                                       }
+                               }
                                /* skip over word characters */
-                               while(!(c = space[*cp++]));
+                               while(!(c = type[*cp++]));
+                               if(mbc(c))
+                                       goto mbyte;
                                nwords++;
                        }
                eob:
+                       lineoff = cp-start;
                        if((cp -= 2) >= buff)
-                               c = space[*cp];
+                               c = type[*cp];
                        else
-                               c  = lasttype;
-                       lasttype = space[lastchar];
+                               c = lasttype;
+                       lasttype = type[lastchar];
                        /* see if was in word */
                        if(!c && !lasttype)
                                nwords--;
                }
-               if(endline(lasttype))
+               if ((wp->mode&WC_LONGEST) && ((endbuff + 1 - start) - adjust - 
(lastchar == '\n')) > longest)
+                       longest = (endbuff + 1 - start) - adjust - (lastchar == 
'\n');
+               wp->longest = longest;
+               if (eol(lasttype))
                        nlines++;
-               else if(!lasttype)
+               else if (!lasttype)
                        nwords++;
+               nchars -= adjust;
        }
        wp->chars = nchars;
        wp->words = nwords;
        wp->lines = nlines;
-       return(0);
+       return 0;
 }
+
--- old/usr/src/lib/libcmd/i386/include/ast/cmd.h       Fri Sep 25 06:26:29 2009
+++ new/usr/src/lib/libcmd/i386/include/ast/cmd.h       Fri Sep 25 06:26:28 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -44,6 +44,8 @@
 
 #define cmdinit                        _cmd_init
 
+#define ERROR_CALLBACK         ERROR_SET
+
 #if _BLD_cmd && defined(__EXPORT__)
 #undef __MANGLE__
 #define __MANGLE__ __LINKAGE__         __EXPORT__
@@ -96,7 +98,7 @@
                error_info.catalog = (char*)catalog;
        opt_info.index = 0;
        if (context)
-               error_info.flags |= flags;
+               error_info.flags |= flags & ~(ERROR_CALLBACK|ERROR_NOTIFY);
        return 0;
 }
 
--- old/usr/src/lib/libcmd/i386/include/ast/cmdext.h    Fri Sep 25 06:26:32 2009
+++ new/usr/src/lib/libcmd/i386/include/ast/cmdext.h    Fri Sep 25 06:26:30 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -39,11 +39,14 @@
 extern __MANGLE__ int  b_cut __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_date __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_dirname __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_egrep __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_expr __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_fds __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_fgrep __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_fmt __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_fold __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_getconf __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_grep __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_head __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_id __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_join __PROTO__((int, char**, __V_*));
@@ -52,11 +55,13 @@
 extern __MANGLE__ int  b_md5sum __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_mkdir __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_mkfifo __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_mktemp __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_mv __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_paste __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_pathchk __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_pids __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_rev __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_readlink __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_rm __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_rmdir __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_stty __PROTO__((int, char**, __V_*));
@@ -68,3 +73,4 @@
 extern __MANGLE__ int  b_uname __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_uniq __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_wc __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_xgrep __PROTO__((int, char**, __V_*));
--- old/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/ids      Fri Sep 25 
06:26:35 2009
+++ new/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/ids      Fri Sep 25 
06:26:33 2009
@@ -1,8 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libcmd/features/ids
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libcmd/features/ids
 by iffe version 2009-05-01 : : */
 #ifndef _def_ids_cmd
 #define _def_ids_cmd   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _lib_endgrent  1       /* endgrent() in default lib(s) */
 #define _lib_getgrent  1       /* getgrent() in default lib(s) */
--- old/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/sockets  Fri Sep 25 
06:26:38 2009
+++ new/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/sockets  Fri Sep 25 
06:26:36 2009
@@ -1,8 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libcmd/features/sockets
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libcmd/features/sockets
 by iffe version 2009-05-01 : : */
 #ifndef _def_sockets_cmd
 #define _def_sockets_cmd       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _sys_socket    1       /* #include <sys/socket.h> ok */
 #define _hdr_arpa_inet 1       /* #include <arpa/inet.h> ok */
--- old/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/symlink  Fri Sep 25 
06:26:41 2009
+++ new/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/symlink  Fri Sep 25 
06:26:39 2009
@@ -1,8 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libcmd/features/symlink
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libcmd/features/symlink
 by iffe version 2009-05-01 : : */
 #ifndef _def_symlink_cmd
 #define _def_symlink_cmd       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _lib_lchown    1       /* lchown implemented */
 #endif
--- old/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/utsname  Fri Sep 25 
06:26:44 2009
+++ new/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/utsname  Fri Sep 25 
06:26:42 2009
@@ -1,8 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libcmd/features/utsname
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libcmd/features/utsname
 by iffe version 2009-05-01 : : */
 #ifndef _def_utsname_cmd
 #define _def_utsname_cmd       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _lib_getdomainname     1       /* getdomainname() in default lib(s) */
 #define _lib_gethostid 1       /* gethostid() in default lib(s) */
--- old/usr/src/lib/libcmd/mapfile-vers Fri Sep 25 06:26:46 2009
+++ new/usr/src/lib/libcmd/mapfile-vers Fri Sep 25 06:26:45 2009
@@ -55,11 +55,14 @@
        b_cut;
        b_date;
        b_dirname;
+       b_egrep;
        b_expr;
        b_fds;
+       b_fgrep;
        b_fmt;
        b_fold;
        b_getconf;
+       b_grep;
        b_head;
        b_id;
        b_join;
@@ -68,10 +71,12 @@
        b_md5sum;
        b_mkdir;
        b_mkfifo;
+       b_mktemp;
        b_mv;
        b_paste;
        b_pathchk;
        b_pids;
+       b_pgrep;
        b_readlink;
        b_rev;
        b_rm;
@@ -85,6 +90,7 @@
        b_uname;
        b_uniq;
        b_wc;
+       b_xgrep;
     local:
        *;
 };
--- old/usr/src/lib/libcmd/sparc/include/ast/cmd.h      Fri Sep 25 06:26:49 2009
+++ new/usr/src/lib/libcmd/sparc/include/ast/cmd.h      Fri Sep 25 06:26:47 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -44,6 +44,8 @@
 
 #define cmdinit                        _cmd_init
 
+#define ERROR_CALLBACK         ERROR_SET
+
 #if _BLD_cmd && defined(__EXPORT__)
 #undef __MANGLE__
 #define __MANGLE__ __LINKAGE__         __EXPORT__
@@ -96,7 +98,7 @@
                error_info.catalog = (char*)catalog;
        opt_info.index = 0;
        if (context)
-               error_info.flags |= flags;
+               error_info.flags |= flags & ~(ERROR_CALLBACK|ERROR_NOTIFY);
        return 0;
 }
 
--- old/usr/src/lib/libcmd/sparc/include/ast/cmdext.h   Fri Sep 25 06:26:52 2009
+++ new/usr/src/lib/libcmd/sparc/include/ast/cmdext.h   Fri Sep 25 06:26:50 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -39,11 +39,14 @@
 extern __MANGLE__ int  b_cut __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_date __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_dirname __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_egrep __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_expr __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_fds __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_fgrep __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_fmt __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_fold __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_getconf __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_grep __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_head __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_id __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_join __PROTO__((int, char**, __V_*));
@@ -52,11 +55,13 @@
 extern __MANGLE__ int  b_md5sum __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_mkdir __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_mkfifo __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_mktemp __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_mv __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_paste __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_pathchk __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_pids __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_rev __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_readlink __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_rm __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_rmdir __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_stty __PROTO__((int, char**, __V_*));
@@ -68,3 +73,4 @@
 extern __MANGLE__ int  b_uname __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_uniq __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_wc __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_xgrep __PROTO__((int, char**, __V_*));
--- old/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/ids     Fri Sep 25 
06:26:55 2009
+++ new/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/ids     Fri Sep 25 
06:26:53 2009
@@ -1,8 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libcmd/features/ids
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libcmd/features/ids
 by iffe version 2009-05-01 : : */
 #ifndef _def_ids_cmd
 #define _def_ids_cmd   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _lib_endgrent  1       /* endgrent() in default lib(s) */
 #define _lib_getgrent  1       /* getgrent() in default lib(s) */
--- old/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/sockets Fri Sep 25 
06:26:58 2009
+++ new/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/sockets Fri Sep 25 
06:26:56 2009
@@ -1,8 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libcmd/features/sockets
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libcmd/features/sockets
 by iffe version 2009-05-01 : : */
 #ifndef _def_sockets_cmd
 #define _def_sockets_cmd       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _sys_socket    1       /* #include <sys/socket.h> ok */
 #define _hdr_arpa_inet 1       /* #include <arpa/inet.h> ok */
--- old/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/symlink Fri Sep 25 
06:27:00 2009
+++ new/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/symlink Fri Sep 25 
06:26:59 2009
@@ -1,8 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libcmd/features/symlink
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libcmd/features/symlink
 by iffe version 2009-05-01 : : */
 #ifndef _def_symlink_cmd
 #define _def_symlink_cmd       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _lib_lchown    1       /* lchown implemented */
 #endif
--- old/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/utsname Fri Sep 25 
06:27:03 2009
+++ new/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/utsname Fri Sep 25 
06:27:01 2009
@@ -1,8 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libcmd/features/utsname
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libcmd/features/utsname
 by iffe version 2009-05-01 : : */
 #ifndef _def_utsname_cmd
 #define _def_utsname_cmd       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _lib_getdomainname     1       /* getdomainname() in default lib(s) */
 #define _lib_gethostid 1       /* gethostid() in default lib(s) */
--- old/usr/src/lib/libcmd/sparcv9/include/ast/cmd.h    Fri Sep 25 06:27:06 2009
+++ new/usr/src/lib/libcmd/sparcv9/include/ast/cmd.h    Fri Sep 25 06:27:04 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -44,6 +44,8 @@
 
 #define cmdinit                        _cmd_init
 
+#define ERROR_CALLBACK         ERROR_SET
+
 #if _BLD_cmd && defined(__EXPORT__)
 #undef __MANGLE__
 #define __MANGLE__ __LINKAGE__         __EXPORT__
@@ -96,7 +98,7 @@
                error_info.catalog = (char*)catalog;
        opt_info.index = 0;
        if (context)
-               error_info.flags |= flags;
+               error_info.flags |= flags & ~(ERROR_CALLBACK|ERROR_NOTIFY);
        return 0;
 }
 
--- old/usr/src/lib/libcmd/sparcv9/include/ast/cmdext.h Fri Sep 25 06:27:09 2009
+++ new/usr/src/lib/libcmd/sparcv9/include/ast/cmdext.h Fri Sep 25 06:27:07 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1992-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1992-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -39,11 +39,14 @@
 extern __MANGLE__ int  b_cut __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_date __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_dirname __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_egrep __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_expr __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_fds __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_fgrep __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_fmt __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_fold __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_getconf __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_grep __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_head __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_id __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_join __PROTO__((int, char**, __V_*));
@@ -52,11 +55,13 @@
 extern __MANGLE__ int  b_md5sum __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_mkdir __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_mkfifo __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_mktemp __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_mv __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_paste __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_pathchk __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_pids __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_rev __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_readlink __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_rm __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_rmdir __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_stty __PROTO__((int, char**, __V_*));
@@ -68,3 +73,4 @@
 extern __MANGLE__ int  b_uname __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_uniq __PROTO__((int, char**, __V_*));
 extern __MANGLE__ int  b_wc __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int  b_xgrep __PROTO__((int, char**, __V_*));
--- old/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/ids   Fri Sep 25 
06:27:12 2009
+++ new/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/ids   Fri Sep 25 
06:27:10 2009
@@ -1,8 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libcmd/features/ids
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libcmd/features/ids
 by iffe version 2009-05-01 : : */
 #ifndef _def_ids_cmd
 #define _def_ids_cmd   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _lib_endgrent  1       /* endgrent() in default lib(s) */
 #define _lib_getgrent  1       /* getgrent() in default lib(s) */
--- old/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/sockets       Fri Sep 
25 06:27:15 2009
+++ new/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/sockets       Fri Sep 
25 06:27:13 2009
@@ -1,8 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libcmd/features/sockets
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libcmd/features/sockets
 by iffe version 2009-05-01 : : */
 #ifndef _def_sockets_cmd
 #define _def_sockets_cmd       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _sys_socket    1       /* #include <sys/socket.h> ok */
 #define _hdr_arpa_inet 1       /* #include <arpa/inet.h> ok */
--- old/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/symlink       Fri Sep 
25 06:27:17 2009
+++ new/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/symlink       Fri Sep 
25 06:27:16 2009
@@ -1,8 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libcmd/features/symlink
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libcmd/features/symlink
 by iffe version 2009-05-01 : : */
 #ifndef _def_symlink_cmd
 #define _def_symlink_cmd       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _lib_lchown    1       /* lchown implemented */
 #endif
--- old/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/utsname       Fri Sep 
25 06:27:20 2009
+++ new/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/utsname       Fri Sep 
25 06:27:18 2009
@@ -1,8 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libcmd/features/utsname
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libcmd/features/utsname
 by iffe version 2009-05-01 : : */
 #ifndef _def_utsname_cmd
 #define _def_utsname_cmd       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _lib_getdomainname     1       /* getdomainname() in default lib(s) */
 #define _lib_gethostid 1       /* gethostid() in default lib(s) */
--- old/usr/src/lib/libdll/Makefile.com Fri Sep 25 06:27:23 2009
+++ new/usr/src/lib/libdll/Makefile.com Fri Sep 25 06:27:21 2009
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -34,6 +34,7 @@
        dllfind.o \
        dlllook.o \
        dllnext.o \
+       dllopen.o \
        dllplug.o \
        dllscan.o
 
--- old/usr/src/lib/libdll/amd64/src/lib/libdll/FEATURE/dll     Fri Sep 25 
06:27:26 2009
+++ new/usr/src/lib/libdll/amd64/src/lib/libdll/FEATURE/dll     Fri Sep 25 
06:27:24 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libdll/features/dll
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libdll/features/dll
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_dll_dll
 #if !defined(__PROTO__)
@@ -63,7 +63,7 @@
 
 #define _def_dll_dll   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _hdr_dlfcn     1       /* #include <dlfcn.h> ok */
 #define _LIB_dl        1       /* -ldl is a library */
@@ -70,6 +70,9 @@
 #define _lib_dlopen    1       /* dlopen() in default lib(s) */
 #define _DLL_NEXT_PATH "/usr/lib/libc.so.1"
 
+#if defined(__MVS__) && !defined(__SUSV3)
+#define __SUSV3                1
+#endif
 #include <dlfcn.h>
 
 #define DLL_INFO_PREVER        0x0001  /* pre-suffix style version */
@@ -112,6 +115,7 @@
 extern __MANGLE__ Dllinfo_t*   dllinfo __PROTO__((void));
 extern __MANGLE__ __V_*                dllplug __PROTO__((const char*, const 
char*, const char*, int, char*, size_t));
 extern __MANGLE__ __V_*                dllfind __PROTO__((const char*, const 
char*, int, char*, size_t));
+extern __MANGLE__ __V_*                dllopen __PROTO__((const char*, int));
 extern __MANGLE__ __V_*                dllnext __PROTO__((int));
 extern __MANGLE__ __V_*                dlllook __PROTO__((__V_*, const char*));
 
--- old/usr/src/lib/libdll/amd64/src/lib/libdll/dlldefs.h       Fri Sep 25 
06:27:29 2009
+++ new/usr/src/lib/libdll/amd64/src/lib/libdll/dlldefs.h       Fri Sep 25 
06:27:27 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libdll/features/dll
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libdll/features/dll
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_dll_dll
 #if !defined(__PROTO__)
@@ -63,7 +63,7 @@
 
 #define _def_dll_dll   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _hdr_dlfcn     1       /* #include <dlfcn.h> ok */
 #define _LIB_dl        1       /* -ldl is a library */
@@ -70,6 +70,9 @@
 #define _lib_dlopen    1       /* dlopen() in default lib(s) */
 #define _DLL_NEXT_PATH "/usr/lib/libc.so.1"
 
+#if defined(__MVS__) && !defined(__SUSV3)
+#define __SUSV3                1
+#endif
 #include <dlfcn.h>
 
 #define DLL_INFO_PREVER        0x0001  /* pre-suffix style version */
@@ -112,6 +115,7 @@
 extern __MANGLE__ Dllinfo_t*   dllinfo __PROTO__((void));
 extern __MANGLE__ __V_*                dllplug __PROTO__((const char*, const 
char*, const char*, int, char*, size_t));
 extern __MANGLE__ __V_*                dllfind __PROTO__((const char*, const 
char*, int, char*, size_t));
+extern __MANGLE__ __V_*                dllopen __PROTO__((const char*, int));
 extern __MANGLE__ __V_*                dllnext __PROTO__((int));
 extern __MANGLE__ __V_*                dlllook __PROTO__((__V_*, const char*));
 
--- old/usr/src/lib/libdll/common/RELEASE       Fri Sep 25 06:27:32 2009
+++ new/usr/src/lib/libdll/common/RELEASE       Fri Sep 25 06:27:30 2009
@@ -1,3 +1,4 @@
+09-04-15 dllopen.c: add, use dllopen() internally to wrap dlopen()
 08-05-12 dllscan.c: LIBSUFFIX==.dylib => default plugin version match 0.0
 06-10-11 dllscan.c: check sfstruse() return values -- doh
 06-01-25 dllplug.c: add errorf() library message for dlopen() error
--- old/usr/src/lib/libdll/common/dlfcn.c       Fri Sep 25 06:27:34 2009
+++ new/usr/src/lib/libdll/common/dlfcn.c       Fri Sep 25 06:27:33 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1997-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1997-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -26,7 +26,7 @@
  * AT&T Research
  */
 
-static const char id[] = "\n@(#)$Id: dll library (AT&T Research) 2005-02-14 
$\0\n";
+static const char id[] = "\n@(#)$Id: dll library (AT&T Research) 2009-04-15 
$\0\n";
 
 #include <ast.h>
 #include <dlldefs.h>
--- old/usr/src/lib/libdll/common/dllfind.c     Fri Sep 25 06:27:37 2009
+++ new/usr/src/lib/libdll/common/dllfind.c     Fri Sep 25 06:27:35 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1997-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1997-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libdll/common/dlllook.c     Fri Sep 25 06:27:40 2009
+++ new/usr/src/lib/libdll/common/dlllook.c     Fri Sep 25 06:27:38 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1997-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1997-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libdll/common/dllnext.c     Fri Sep 25 06:27:43 2009
+++ new/usr/src/lib/libdll/common/dllnext.c     Fri Sep 25 06:27:41 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1997-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1997-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -80,7 +80,7 @@
        {
                do
                {
-                       if (strcmp(vp, "MAIN") && (lp = dlopen(vp, flags)))
+                       if (strcmp(vp, "MAIN") && (lp = dllopen(vp, flags)))
                        {
                                if (xr = (Write_f)dlsym(lp, "write"))
                                        wr = xr;
@@ -92,7 +92,7 @@
        {
                do
                {
-                       if (lp = dlopen(strcmp(vp, "MAIN") ? vp : (char*)0, 
flags))
+                       if (lp = dllopen(strcmp(vp, "MAIN") ? vp : (char*)0, 
flags))
                        {
                                if (found)
                                {
@@ -207,7 +207,7 @@
        }
 #endif
        ver = path + strlen(path);
-       while (!(dll = dlopen(path, flags)))
+       while (!(dll = dllopen(path, flags)))
        {
                do
                {
--- /dev/null   Fri Sep 25 06:27:46 2009
+++ new/usr/src/lib/libdll/common/dllopen.c     Fri Sep 25 06:27:44 2009
@@ -0,0 +1,93 @@
+/***********************************************************************
+*                                                                      *
+*               This software is part of the ast package               *
+*          Copyright (c) 1997-2009 AT&T Intellectual Property          *
+*                      and is licensed under the                       *
+*                  Common Public License, Version 1.0                  *
+*                    by AT&T Intellectual Property                     *
+*                                                                      *
+*                A copy of the License is available at                 *
+*            http://www.opensource.org/licenses/cpl1.0.txt             *
+*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
+*                                                                      *
+*              Information and Software Systems Research               *
+*                            AT&T Research                             *
+*                           Florham Park NJ                            *
+*                                                                      *
+*                 Glenn Fowler <gsf at research.att.com>                  *
+*                                                                      *
+***********************************************************************/
+#pragma prototyped
+/*
+ * Glenn Fowler
+ * at&t research
+ */
+
+#include <ast.h>
+#include <dlldefs.h>
+#include <error.h>
+
+#if 0
+
+/*
+ * dlopen() wrapper that properly initializes LIBPATH
+ * with the path of the dll to be opened
+ *
+ * 2009-04-15 -- if ld.so re-checked the env this would work ...
+ */
+
+void*
+dllopen(const char* name, int mode)
+{
+       void*           dll;
+       Dllinfo_t*      info;
+       char*           olibpath;
+       char*           path;
+       char*           oenv;
+       char*           nenv[2];
+       char*           dir;
+       char*           base;
+       int             len;
+
+       if (!environ)
+       {
+               nenv[0] = nenv[1] = 0;
+               environ = nenv;
+       }
+       info = dllinfo();
+       oenv = environ[0];
+       olibpath = getenv(info->env);
+       if (base = strrchr(name, '/'))
+       {
+               dir = (char*)name;
+               len = ++base - dir;
+       }
+       else
+       {
+               dir = "./";
+               len = 2;
+               base = (char*)name;
+       }
+       path = sfprints("%-.*s%s%c%s=%-.*s%s%s", len, dir, base, 0, info->env, 
len, dir, olibpath ? ":" : "", olibpath ? olibpath : "");
+       environ[0] = path + strlen(path) + 1;
+       dll = dlopen(path, mode);
+       if (environ == nenv)
+               environ = 0;
+       else
+               environ[0] = oenv;
+       return dll;
+}
+
+#else
+
+/*
+ * dlopen() wrapper -- waiting for prestidigitaions
+ */
+
+void*
+dllopen(const char* name, int mode)
+{
+       return dlopen(name, mode);
+}
+
+#endif
--- old/usr/src/lib/libdll/common/dllplug.c     Fri Sep 25 06:27:48 2009
+++ new/usr/src/lib/libdll/common/dllplug.c     Fri Sep 25 06:27:47 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1997-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1997-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -50,7 +50,7 @@
                        while (dle = dllsread(dls))
                        {
                                hit = 1;
-                               if (dll = dlopen(dle->path, 
flags|RTLD_GLOBAL|RTLD_PARENT))
+                               if (dll = dllopen(dle->path, 
flags|RTLD_GLOBAL|RTLD_PARENT))
                                {
                                        if (path && size)
                                                strncopy(path, dle->path, size);
@@ -67,9 +67,7 @@
                        break;
                lib = 0;
        }
-       if (!(dll = dlopen(name, flags)) && !strchr(name, '/') && strchr(name, 
'.'))
-               dll = dlopen(sfprints("./%s", name), flags);
-       if (dll && path && size)
+       if ((dll = dllopen(name, flags)) && dll && path && size)
                strncopy(path, name, size);
        return dll;
 }
--- old/usr/src/lib/libdll/common/dllscan.c     Fri Sep 25 06:27:51 2009
+++ new/usr/src/lib/libdll/common/dllscan.c     Fri Sep 25 06:27:49 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1997-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1997-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libdll/common/features/dll  Fri Sep 25 06:27:54 2009
+++ new/usr/src/lib/libdll/common/features/dll  Fri Sep 25 06:27:52 2009
@@ -75,6 +75,9 @@
        echo "#define _DLL_NEXT_PATH    \"$lib\""
 }end
 tst    - output{
+       #if defined(__MVS__) && !defined(__SUSV3)
+       #define __SUSV3         1
+       #endif
        #if _hdr_dlfcn && _lib_dlopen
        #include <dlfcn.h>
        #endif
@@ -90,6 +93,9 @@
                static char*    local[] = { "__elf_header", 
"_call_add_gp_range", "_etext" };
        #endif
                printf("\n");
+               printf("#if defined(__MVS__) && !defined(__SUSV3)\n");
+               printf("#define __SUSV3         1\n");
+               printf("#endif\n");
        #if _hdr_dlfcn && _lib_dlopen
                printf("#include <dlfcn.h>\n");
        #endif
@@ -206,6 +212,7 @@
                printf("extern Dllinfo_t*       dllinfo(void);\n");
                printf("extern void*            dllplug(const char*, const 
char*, const char*, int, char*, size_t);\n");
                printf("extern void*            dllfind(const char*, const 
char*, int, char*, size_t);\n");
+               printf("extern void*            dllopen(const char*, int);\n");
                printf("extern void*            dllnext(int);\n");
                printf("extern void*            dlllook(void*, const 
char*);\n");
        #if _hdr_rld_interface
--- old/usr/src/lib/libdll/i386/src/lib/libdll/FEATURE/dll      Fri Sep 25 
06:27:57 2009
+++ new/usr/src/lib/libdll/i386/src/lib/libdll/FEATURE/dll      Fri Sep 25 
06:27:55 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libdll/features/dll
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libdll/features/dll
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_dll_dll
 #if !defined(__PROTO__)
@@ -63,7 +63,7 @@
 
 #define _def_dll_dll   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _hdr_dlfcn     1       /* #include <dlfcn.h> ok */
 #define _LIB_dl        1       /* -ldl is a library */
@@ -70,6 +70,9 @@
 #define _lib_dlopen    1       /* dlopen() in default lib(s) */
 #define _DLL_NEXT_PATH "/usr/lib/libc.so.1"
 
+#if defined(__MVS__) && !defined(__SUSV3)
+#define __SUSV3                1
+#endif
 #include <dlfcn.h>
 
 #define DLL_INFO_PREVER        0x0001  /* pre-suffix style version */
@@ -112,6 +115,7 @@
 extern __MANGLE__ Dllinfo_t*   dllinfo __PROTO__((void));
 extern __MANGLE__ __V_*                dllplug __PROTO__((const char*, const 
char*, const char*, int, char*, size_t));
 extern __MANGLE__ __V_*                dllfind __PROTO__((const char*, const 
char*, int, char*, size_t));
+extern __MANGLE__ __V_*                dllopen __PROTO__((const char*, int));
 extern __MANGLE__ __V_*                dllnext __PROTO__((int));
 extern __MANGLE__ __V_*                dlllook __PROTO__((__V_*, const char*));
 
--- old/usr/src/lib/libdll/i386/src/lib/libdll/dlldefs.h        Fri Sep 25 
06:28:00 2009
+++ new/usr/src/lib/libdll/i386/src/lib/libdll/dlldefs.h        Fri Sep 25 
06:27:58 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libdll/features/dll
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libdll/features/dll
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_dll_dll
 #if !defined(__PROTO__)
@@ -63,7 +63,7 @@
 
 #define _def_dll_dll   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _hdr_dlfcn     1       /* #include <dlfcn.h> ok */
 #define _LIB_dl        1       /* -ldl is a library */
@@ -70,6 +70,9 @@
 #define _lib_dlopen    1       /* dlopen() in default lib(s) */
 #define _DLL_NEXT_PATH "/usr/lib/libc.so.1"
 
+#if defined(__MVS__) && !defined(__SUSV3)
+#define __SUSV3                1
+#endif
 #include <dlfcn.h>
 
 #define DLL_INFO_PREVER        0x0001  /* pre-suffix style version */
@@ -112,6 +115,7 @@
 extern __MANGLE__ Dllinfo_t*   dllinfo __PROTO__((void));
 extern __MANGLE__ __V_*                dllplug __PROTO__((const char*, const 
char*, const char*, int, char*, size_t));
 extern __MANGLE__ __V_*                dllfind __PROTO__((const char*, const 
char*, int, char*, size_t));
+extern __MANGLE__ __V_*                dllopen __PROTO__((const char*, int));
 extern __MANGLE__ __V_*                dllnext __PROTO__((int));
 extern __MANGLE__ __V_*                dlllook __PROTO__((__V_*, const char*));
 
--- old/usr/src/lib/libdll/sparc/src/lib/libdll/FEATURE/dll     Fri Sep 25 
06:28:03 2009
+++ new/usr/src/lib/libdll/sparc/src/lib/libdll/FEATURE/dll     Fri Sep 25 
06:28:01 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libdll/features/dll
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libdll/features/dll
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_dll_dll
 #if !defined(__PROTO__)
@@ -63,7 +63,7 @@
 
 #define _def_dll_dll   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _hdr_dlfcn     1       /* #include <dlfcn.h> ok */
 #define _LIB_dl        1       /* -ldl is a library */
@@ -70,6 +70,9 @@
 #define _lib_dlopen    1       /* dlopen() in default lib(s) */
 #define _DLL_NEXT_PATH "/usr/lib/libc.so.1"
 
+#if defined(__MVS__) && !defined(__SUSV3)
+#define __SUSV3                1
+#endif
 #include <dlfcn.h>
 
 #define DLL_INFO_PREVER        0x0001  /* pre-suffix style version */
@@ -112,6 +115,7 @@
 extern __MANGLE__ Dllinfo_t*   dllinfo __PROTO__((void));
 extern __MANGLE__ __V_*                dllplug __PROTO__((const char*, const 
char*, const char*, int, char*, size_t));
 extern __MANGLE__ __V_*                dllfind __PROTO__((const char*, const 
char*, int, char*, size_t));
+extern __MANGLE__ __V_*                dllopen __PROTO__((const char*, int));
 extern __MANGLE__ __V_*                dllnext __PROTO__((int));
 extern __MANGLE__ __V_*                dlllook __PROTO__((__V_*, const char*));
 
--- old/usr/src/lib/libdll/sparc/src/lib/libdll/dlldefs.h       Fri Sep 25 
06:28:05 2009
+++ new/usr/src/lib/libdll/sparc/src/lib/libdll/dlldefs.h       Fri Sep 25 
06:28:04 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libdll/features/dll
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libdll/features/dll
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_dll_dll
 #if !defined(__PROTO__)
@@ -63,7 +63,7 @@
 
 #define _def_dll_dll   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _hdr_dlfcn     1       /* #include <dlfcn.h> ok */
 #define _LIB_dl        1       /* -ldl is a library */
@@ -70,6 +70,9 @@
 #define _lib_dlopen    1       /* dlopen() in default lib(s) */
 #define _DLL_NEXT_PATH "/usr/lib/libc.so.1"
 
+#if defined(__MVS__) && !defined(__SUSV3)
+#define __SUSV3                1
+#endif
 #include <dlfcn.h>
 
 #define DLL_INFO_PREVER        0x0001  /* pre-suffix style version */
@@ -112,6 +115,7 @@
 extern __MANGLE__ Dllinfo_t*   dllinfo __PROTO__((void));
 extern __MANGLE__ __V_*                dllplug __PROTO__((const char*, const 
char*, const char*, int, char*, size_t));
 extern __MANGLE__ __V_*                dllfind __PROTO__((const char*, const 
char*, int, char*, size_t));
+extern __MANGLE__ __V_*                dllopen __PROTO__((const char*, int));
 extern __MANGLE__ __V_*                dllnext __PROTO__((int));
 extern __MANGLE__ __V_*                dlllook __PROTO__((__V_*, const char*));
 
--- old/usr/src/lib/libdll/sparcv9/src/lib/libdll/FEATURE/dll   Fri Sep 25 
06:28:08 2009
+++ new/usr/src/lib/libdll/sparcv9/src/lib/libdll/FEATURE/dll   Fri Sep 25 
06:28:06 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libdll/features/dll
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libdll/features/dll
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_dll_dll
 #if !defined(__PROTO__)
@@ -63,7 +63,7 @@
 
 #define _def_dll_dll   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _hdr_dlfcn     1       /* #include <dlfcn.h> ok */
 #define _LIB_dl        1       /* -ldl is a library */
@@ -70,6 +70,9 @@
 #define _lib_dlopen    1       /* dlopen() in default lib(s) */
 #define _DLL_NEXT_PATH "/usr/lib/libc.so.1"
 
+#if defined(__MVS__) && !defined(__SUSV3)
+#define __SUSV3                1
+#endif
 #include <dlfcn.h>
 
 #define DLL_INFO_PREVER        0x0001  /* pre-suffix style version */
@@ -112,6 +115,7 @@
 extern __MANGLE__ Dllinfo_t*   dllinfo __PROTO__((void));
 extern __MANGLE__ __V_*                dllplug __PROTO__((const char*, const 
char*, const char*, int, char*, size_t));
 extern __MANGLE__ __V_*                dllfind __PROTO__((const char*, const 
char*, int, char*, size_t));
+extern __MANGLE__ __V_*                dllopen __PROTO__((const char*, int));
 extern __MANGLE__ __V_*                dllnext __PROTO__((int));
 extern __MANGLE__ __V_*                dlllook __PROTO__((__V_*, const char*));
 
--- old/usr/src/lib/libdll/sparcv9/src/lib/libdll/dlldefs.h     Fri Sep 25 
06:28:11 2009
+++ new/usr/src/lib/libdll/sparcv9/src/lib/libdll/dlldefs.h     Fri Sep 25 
06:28:09 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libdll/features/dll
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libdll/features/dll
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_dll_dll
 #if !defined(__PROTO__)
@@ -63,7 +63,7 @@
 
 #define _def_dll_dll   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _hdr_dlfcn     1       /* #include <dlfcn.h> ok */
 #define _LIB_dl        1       /* -ldl is a library */
@@ -70,6 +70,9 @@
 #define _lib_dlopen    1       /* dlopen() in default lib(s) */
 #define _DLL_NEXT_PATH "/usr/lib/libc.so.1"
 
+#if defined(__MVS__) && !defined(__SUSV3)
+#define __SUSV3                1
+#endif
 #include <dlfcn.h>
 
 #define DLL_INFO_PREVER        0x0001  /* pre-suffix style version */
@@ -112,6 +115,7 @@
 extern __MANGLE__ Dllinfo_t*   dllinfo __PROTO__((void));
 extern __MANGLE__ __V_*                dllplug __PROTO__((const char*, const 
char*, const char*, int, char*, size_t));
 extern __MANGLE__ __V_*                dllfind __PROTO__((const char*, const 
char*, int, char*, size_t));
+extern __MANGLE__ __V_*                dllopen __PROTO__((const char*, int));
 extern __MANGLE__ __V_*                dllnext __PROTO__((int));
 extern __MANGLE__ __V_*                dlllook __PROTO__((__V_*, const char*));
 
--- old/usr/src/lib/libpp/Makefile.com  Fri Sep 25 06:28:14 2009
+++ new/usr/src/lib/libpp/Makefile.com  Fri Sep 25 06:28:12 2009
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -87,7 +87,7 @@
        -D_PACKAGE_ast \
        '-DUSAGE_LICENSE=\
                "[-author?Glenn Fowler <gsf at research.att.com>]"\
-               "[-copyright?Copyright (c) 1986-2008 AT&T Intellectual 
Property]"\
+               "[-copyright?Copyright (c) 1986-2009 AT&T Intellectual 
Property]"\
                "[-license?http://www.opensource.org/licenses/cpl1.0.txt]"\
                "[--catalog?libpp]"'
 
@@ -100,8 +100,8 @@
 pics/ppcall.o          := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED
 pics/ppcontrol.o       := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED
 pics/ppcpp.o           := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED
-pics/pplex.o           := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED
 pics/ppexpr.o          := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED
+pics/pplex.o           := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED
 pics/ppop.o            := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED
 pics/ppsearch.o        := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED
 pics/ppsearch.o        := CERRWARN += -_gcc=-Wno-sequence-point
--- old/usr/src/lib/libpp/common/RELEASE        Fri Sep 25 06:28:17 2009
+++ new/usr/src/lib/libpp/common/RELEASE        Fri Sep 25 06:28:15 2009
@@ -1,3 +1,12 @@
+09-02-02 pp.probe,probe.win32: check for compiler supplied __FUNCTION__
+09-02-02 ppop.c: include pp_default.h/probe at end of builtin script
+09-01-20 probe.win32: elide #pragma comment.*linker.*manifest
+09-01-06 ppcall.c: fix macro definition overwrite bug -- I know
+09-01-05 ppcontrol.c: fix multiple include guard for #include outside guard
+08-12-07 pp.h,ppdata.c: fix ancient pptype and ppctype[] off by one
+08-11-15 ppsearch.c: '\\' => '/' in first step; msvc complains about '\\' in 
#line!!
+08-10-31 ppsearch.c: relax pp:nomultiple pedantry
+08-10-30 pplex.c: handle =#x S_CHRB|SPLICE bug
 08-05-11 ppproto.c: fix proto test 10 regression
 07-09-21 ppproto.c: add "Public Domain" to the noticed list
 07-08-11 probe.win32: add cl.exe setuid workaround, CC.VERSION[.STRING]
--- old/usr/src/lib/libpp/common/gentab.sh      Fri Sep 25 06:28:20 2009
+++ new/usr/src/lib/libpp/common/gentab.sh      Fri Sep 25 06:28:18 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1986-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1986-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
--- old/usr/src/lib/libpp/common/pp.h   Fri Sep 25 06:28:23 2009
+++ new/usr/src/lib/libpp/common/pp.h   Fri Sep 25 06:28:21 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -82,7 +82,7 @@
 #define ppsymset(t,n)  (struct 
ppsymbol*)hashlook(t,n,HASH_CREATE|HASH_SIZE(sizeof(struct ppsymbol)),NiL)
 
 #if CHAR_MIN < 0
-#define pptype         (ppctype-(CHAR_MIN)+1)
+#define pptype         (ppctype-(CHAR_MIN))
 #else
 #define pptype         (ppctype)
 #endif
--- old/usr/src/lib/libpp/common/pp.probe       Fri Sep 25 06:28:25 2009
+++ new/usr/src/lib/libpp/common/pp.probe       Fri Sep 25 06:28:24 2009
@@ -2,7 +2,7 @@
 # Glenn Fowler
 # AT&T Research
 #
-# @(#)pp.probe (AT&T Research) 2006-09-05
+# @(#)pp.probe (AT&T Research) 2009-02-02
 #
 # C probe for libpp
 #
@@ -25,6 +25,7 @@
 cpu=
 model=
 machine=
+undef_predef=
 
 #
 # path cleanup
@@ -575,6 +576,13 @@
        eval sys_$i=$x
 done
 
+echo "char* fun() { return (char*)__FUNCTION__; }
+int main() { return !fun(); }" > fun.$src
+rm -f fun.exe
+if     $cc -o fun.exe fun.$src && test -x fun.exe
+then   undef_predef="$undef_predef __FUNCTION__"
+fi
+
 case "`grep -c '__STDC__[-0    ]*[=!]=[        ]*0' $usrinclude/stdio.h 
2>/dev/null`" in
 0)     ;;
 *)     hostedtransition=1 ;;
@@ -1033,6 +1041,13 @@
 *)     echo "#define #dialect(dynamic)" ;;
 esac
 echo
+case $undef_predef in
+?*)    for m in $undef_predef
+       do      echo "#undef    $m"
+       done
+       echo
+       ;;
+esac
 case $plusplus in
 ?*)    echo "#pragma pp:plusplus" ;;
 esac
--- old/usr/src/lib/libpp/common/ppargs.c       Fri Sep 25 06:28:28 2009
+++ new/usr/src/lib/libpp/common/ppargs.c       Fri Sep 25 06:28:27 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -27,7 +27,7 @@
  */
 
 static const char usage[] =
-"[-?\n@(#)$Id: cpp (AT&T Research) 2007-03-11 $\n]"
+"[-?\n@(#)$Id: cpp (AT&T Research) 2009-02-02 $\n]"
 USAGE_LICENSE
 "[+NAME?cpp - C language preprocessor]"
 "[+DESCRIPTION?\bcpp\b is the preprocessor for all C language dialects. It is"
--- old/usr/src/lib/libpp/common/ppbuiltin.c    Fri Sep 25 06:28:31 2009
+++ new/usr/src/lib/libpp/common/ppbuiltin.c    Fri Sep 25 06:28:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libpp/common/ppcall.c       Fri Sep 25 06:28:34 2009
+++ new/usr/src/lib/libpp/common/ppcall.c       Fri Sep 25 06:28:32 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -51,6 +51,7 @@
        int                             last_line;
        long                            old_state;
        char*                           last_file;
+       char*                           old_next;
        char*                           old_token;
        struct ppmacstk*                mp;
        struct ppinstk*                 old_in;
@@ -183,6 +184,7 @@
                        for (p = pp.in->nextchr; isspace(*p); p++);
                        if ((c = *p) != '(' && c != '/' && c != 0 && c != MARK)
                                goto disable;
+                       old_next = (c == MARK) ? pp.in->nextchr : NiL;
                        old_token = pp.token;
                        mp = pp.macp->next;
                        if ((pp.token = (char*)&mp->arg[mac->arity + 1]) > 
pp.maxmac)
@@ -200,25 +202,30 @@
                        if (c != '(')
                        {
                                pp.state = old_state;
-                               if (c)
+                               if (old_next)
+                                       pp.in->nextchr = old_next;
+                               else
                                {
-                                       p = pp.toknxt;
-                                       while (p > pp.token)
-                                               ungetchr(*--p);
+                                       if (c)
+                                       {
+                                               p = pp.toknxt;
+                                               while (p > pp.token)
+                                                       ungetchr(*--p);
 #if COMPATIBLE
-                                       if ((pp.state & (COMPATIBILITY|STRICT)) 
== (COMPATIBILITY|STRICT))
-                                               error(1, "%s: macro arguments 
omitted", sym->name);
+                                               if ((pp.state & 
(COMPATIBILITY|STRICT)) == (COMPATIBILITY|STRICT))
+                                                       error(1, "%s: macro 
arguments omitted", sym->name);
 #endif
-                                       if (c == T_ID && !(pp.state & HIDDEN))
-                                               ungetchr(' ');
+                                               if (c == T_ID && !(pp.state & 
HIDDEN))
+                                                       ungetchr(' ');
+                                       }
+                                       if (pp.hidden != old_hidden)
+                                       {
+                                               ungetchr('\n');
+                                               error_info.line--;
+                                               if (pp.hidden && !--pp.hidden)
+                                                       pp.state &= ~HIDDEN;
+                                       }
                                }
-                               if (pp.hidden != old_hidden)
-                               {
-                                       ungetchr('\n');
-                                       error_info.line--;
-                                       if (pp.hidden && !--pp.hidden)
-                                               pp.state &= ~HIDDEN;
-                               }
                                pp.token = old_token;
                                goto disable;
                        }
--- old/usr/src/lib/libpp/common/ppcomment.c    Fri Sep 25 06:28:37 2009
+++ new/usr/src/lib/libpp/common/ppcomment.c    Fri Sep 25 06:28:35 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libpp/common/ppcontext.c    Fri Sep 25 06:28:40 2009
+++ new/usr/src/lib/libpp/common/ppcontext.c    Fri Sep 25 06:28:38 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libpp/common/ppcontrol.c    Fri Sep 25 06:28:43 2009
+++ new/usr/src/lib/libpp/common/ppcontrol.c    Fri Sep 25 06:28:41 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -450,6 +450,7 @@
                        }
                        pp.state &= ~DISABLE;
                        pp.state |= HEADER|STRIP;
+                       pp.in->flags |= IN_noguard;
                        switch (c = pplex())
                        {
                        case T_STRING:
@@ -1468,11 +1469,12 @@
                        {
                        case T_STRING:
                                s = error_info.file;
-                               if (*(p = pp.token)) pathcanon(p, 0);
+                               if (*(p = pp.token))
+                                       pathcanon(p, 0);
                                fp = ppsetfile(p);
                                error_info.file = fp->name;
                                if (error_info.line == 1)
-                                       ppmultiple(fp, INC_TEST);
+                                       ppmultiple(fp, INC_IGNORE);
                                switch (c = pplex())
                                {
                                case '\n':
@@ -1953,8 +1955,8 @@
                                break;
                        case X_MULTIPLE:
                                n = 1;
-                               if (pp.in->type == IN_FILE)
-                                       ppmultiple(ppsetfile(error_info.file), 
i0 ? INC_CLEAR : INC_TEST);
+                               if (pp.in->type == IN_FILE || pp.in->type == 
IN_RESCAN)
+                                       ppmultiple(ppsetfile(error_info.file), 
i0 ? INC_CLEAR : INC_IGNORE);
                                break;
                        case X_NATIVE:
                                setoption(NATIVE, i0);
--- old/usr/src/lib/libpp/common/ppcpp.c        Fri Sep 25 06:28:46 2009
+++ new/usr/src/lib/libpp/common/ppcpp.c        Fri Sep 25 06:28:44 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libpp/common/ppdata.c       Fri Sep 25 06:28:49 2009
+++ new/usr/src/lib/libpp/common/ppdata.c       Fri Sep 25 06:28:47 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -48,7 +48,7 @@
  *     only within macro bodies
  */
 
-static const char id[] = "\n@(#)$Id: libpp (AT&T Research) 2007-06-12 $\0\n";
+static const char id[] = "\n@(#)$Id: libpp (AT&T Research) 2009-02-02 $\0\n";
 
 #include "pplib.h"
 
@@ -176,4 +176,4 @@
        /* the rest are implicitly initialized */
 };
 
-char   ppctype[UCHAR_MAX];
+char   ppctype[UCHAR_MAX+1];
--- old/usr/src/lib/libpp/common/pperror.c      Fri Sep 25 06:28:52 2009
+++ new/usr/src/lib/libpp/common/pperror.c      Fri Sep 25 06:28:50 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libpp/common/ppexpr.c       Fri Sep 25 06:28:54 2009
+++ new/usr/src/lib/libpp/common/ppexpr.c       Fri Sep 25 06:28:53 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libpp/common/ppfsm.c        Fri Sep 25 06:28:57 2009
+++ new/usr/src/lib/libpp/common/ppfsm.c        Fri Sep 25 06:28:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libpp/common/ppfsm.h        Fri Sep 25 06:29:00 2009
+++ new/usr/src/lib/libpp/common/ppfsm.h        Fri Sep 25 06:28:58 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libpp/common/ppincref.c     Fri Sep 25 06:29:03 2009
+++ new/usr/src/lib/libpp/common/ppincref.c     Fri Sep 25 06:29:01 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libpp/common/ppinput.c      Fri Sep 25 06:29:06 2009
+++ new/usr/src/lib/libpp/common/ppinput.c      Fri Sep 25 06:29:04 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libpp/common/ppkey.c        Fri Sep 25 06:29:09 2009
+++ new/usr/src/lib/libpp/common/ppkey.c        Fri Sep 25 06:29:07 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libpp/common/ppkey.h        Fri Sep 25 06:29:12 2009
+++ new/usr/src/lib/libpp/common/ppkey.h        Fri Sep 25 06:29:10 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libpp/common/pplex.c        Fri Sep 25 06:29:15 2009
+++ new/usr/src/lib/libpp/common/pplex.c        Fri Sep 25 06:29:13 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -2036,7 +2036,7 @@
                                                SYNCIN();
                                                PUSH_QUOTE(pp.macp->arg[c - 
ARGOFFSET], pp.macp->line);
                                                CACHEIN();
-                                               bp = ip - 1;
+                                               *(bp = ip - 1) = '"';
                                                if (st & 
(COLLECTING|EOF2NL|JOINING)) rp = fsm[START];
                                                if (state = rp[c = '"']) goto 
fsm_next;
                                                goto fsm_get;
--- old/usr/src/lib/libpp/common/pplib.h        Fri Sep 25 06:29:18 2009
+++ new/usr/src/lib/libpp/common/pplib.h        Fri Sep 25 06:29:16 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libpp/common/ppline.c       Fri Sep 25 06:29:21 2009
+++ new/usr/src/lib/libpp/common/ppline.c       Fri Sep 25 06:29:19 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libpp/common/ppmacref.c     Fri Sep 25 06:29:23 2009
+++ new/usr/src/lib/libpp/common/ppmacref.c     Fri Sep 25 06:29:22 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libpp/common/ppmisc.c       Fri Sep 25 06:29:26 2009
+++ new/usr/src/lib/libpp/common/ppmisc.c       Fri Sep 25 06:29:24 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libpp/common/ppop.c Fri Sep 25 06:29:29 2009
+++ new/usr/src/lib/libpp/common/ppop.c Fri Sep 25 06:29:27 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -841,8 +841,6 @@
                                        if (!(pp.ppdefault = pathprobe(pp.path, 
NiL, "C", pp.pass, pp.probe ? pp.probe : PPPROBE, 0)))
                                                error(1, "cannot determine 
default definitions for %s", pp.probe ? pp.probe : PPPROBE);
                                }
-                               if (pp.ppdefault)
-                                       sfprintf(sp, "#%s \"%s\"\n", 
dirname(INCLUDE), pp.ppdefault);
                                if (pp.probe)
                                        pp.lastdir->next->type = c;
                        }
@@ -908,9 +906,6 @@
                                );
                        sfprintf(sp,
 "\
-#%s __STDC__\n\
-#%s __STDC__ #(STDC)\n\
-#%s\n\
 #%s #%s(%s)\n\
 #%s %s:%s\n\
 #%s %s:%s\n\
@@ -918,9 +913,6 @@
 #%s\n\
 #%s\n\
 "
-                               , dirname(IFNDEF)
-                               , dirname(DEFINE)
-                               , dirname(ENDIF)
                                , dirname(IF)
                                , keyname(X_OPTION)
                                , keyname(X_STRICT)
@@ -978,6 +970,18 @@
                                , pp.pass
                                , keyname(X_BUILTIN)
                                );
+                       if (pp.ppdefault && *pp.ppdefault)
+                               sfprintf(sp, "#%s \"%s\"\n", dirname(INCLUDE), 
pp.ppdefault);
+                       sfprintf(sp,
+"\
+#%s !defined(__STDC__) && (!#option(compatibility) || #option(transition))\n\
+#%s __STDC__ #(STDC)\n\
+#%s\n\
+"
+                               , dirname(IF)
+                               , dirname(DEFINE)
+                               , dirname(ENDIF)
+                               );
                        t = sfstruse(sp);
                        debug((-9, "\n/* begin initialization */\n%s/* end 
initialization */", t));
                        ppcomment = pp.comment;
--- old/usr/src/lib/libpp/common/pppragma.c     Fri Sep 25 06:29:32 2009
+++ new/usr/src/lib/libpp/common/pppragma.c     Fri Sep 25 06:29:30 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libpp/common/ppprintf.c     Fri Sep 25 06:29:35 2009
+++ new/usr/src/lib/libpp/common/ppprintf.c     Fri Sep 25 06:29:33 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libpp/common/ppproto.c      Fri Sep 25 06:29:38 2009
+++ new/usr/src/lib/libpp/common/ppproto.c      Fri Sep 25 06:29:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libpp/common/ppsearch.c     Fri Sep 25 06:29:41 2009
+++ new/usr/src/lib/libpp/common/ppsearch.c     Fri Sep 25 06:29:39 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -82,7 +82,7 @@
        {
                if (status != INC_CLEAR)
                {
-                       if (status != INC_TEST && status->macro || !(pp.mode & 
ALLMULTIPLE) && !(pp.state & STRICT))
+                       if (status == INC_TEST || status->macro)
                        {
                                if ((pp.mode & (ALLMULTIPLE|LOADING)) == 
LOADING)
                                        fp->guard = INC_IGNORE;
@@ -96,6 +96,8 @@
                }
                if ((pp.mode & (ALLMULTIPLE|LOADING)) == LOADING)
                        test = INC_IGNORE;
+               else
+                       return 1;
        }
        fp->guard = test;
        return 1;
@@ -605,8 +607,14 @@
 
        pp.include = 0;
        fd = -1;
-       dospath = 0;
        chop = 0;
+       if (s = strchr(file, '\\'))
+       {
+               do *s++ = '/'; while (s = strchr(s, '\\'));
+               dospath = 1;
+       }
+       else
+               dospath = 0;
  again:
        pathcanon(file, 0);
        if (chop)
@@ -757,15 +765,6 @@
 
                switch (dospath)
                {
-               case 0:
-                       if (s = strchr(file, '\\'))
-                       {
-                               do *s++ = '/'; while (s = strchr(s, '\\'));
-                               pathcanon(file, 0);
-                               dospath = 1;
-                               goto again;
-                       }
-                       /*FALLTHROUGH*/
                case 1:
                        if (ppisid(file[0]) && file[1] == ':' && file[2] == '/')
                        {
--- old/usr/src/lib/libpp/common/ppsym.c        Fri Sep 25 06:29:44 2009
+++ new/usr/src/lib/libpp/common/ppsym.c        Fri Sep 25 06:29:42 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libpp/common/pptrace.c      Fri Sep 25 06:29:47 2009
+++ new/usr/src/lib/libpp/common/pptrace.c      Fri Sep 25 06:29:45 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1986-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1986-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/Makefile   Fri Sep 25 06:29:50 2009
+++ new/usr/src/lib/libshell/Makefile   Fri Sep 25 06:29:48 2009
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -63,7 +63,7 @@
 
 FRC:
 
-# rules to install demo files in $(ROOT)/usr/demo/ksh/
 include Makefile.demo
+include Makefile.doc
 
 include ../Makefile.targ
--- old/usr/src/lib/libshell/Makefile.com       Fri Sep 25 06:29:53 2009
+++ new/usr/src/lib/libshell/Makefile.com       Fri Sep 25 06:29:51 2009
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -37,8 +37,10 @@
        bltins/getopts.o \
        bltins/hist.o \
        bltins/misc.o \
+       bltins/poll_solaris.o \
        bltins/print.o \
        bltins/read.o \
+       bltins/regress.o \
        bltins/shiocmd_solaris.o \
        bltins/sleep.o \
        bltins/test.o \
--- old/usr/src/lib/libshell/Makefile.demo      Fri Sep 25 06:29:56 2009
+++ new/usr/src/lib/libshell/Makefile.demo      Fri Sep 25 06:29:54 2009
@@ -27,12 +27,7 @@
 ROOTDEMODIRBASE=       $(ROOT)/usr/demo/ksh
 
 DEMOFILES= \
-       doc/RELEASE \
-       doc/README \
-       doc/TYPES \
-       doc/DESIGN \
-       doc/COMPATIBILITY \
-       doc/OBSOLETE \
+       bin/cpvprint \
        bin/crawlsrccomments \
        bin/filemutexdemo1 \
        bin/filetree1 \
@@ -39,6 +34,7 @@
        bin/gnaw \
        bin/mandelbrotset1 \
        bin/multifollow \
+       bin/numtree1 \
        bin/primenumbers1 \
        bin/rssread \
        bin/shcalc \
@@ -49,6 +45,8 @@
        bin/shpiano \
        bin/shtinyurl \
        bin/shtwitter \
+       bin/simplefileattributetree1 \
+       bin/simplefiletree1 \
        bin/svcproptree1 \
        bin/termclock \
        bin/test_net_sctp \
@@ -57,6 +55,31 @@
        fun/popd \
        fun/pushd \
        fun/title \
+       src/cpvprint.sh \
+       src/crawlsrccomments.sh \
+       src/filemutexdemo1.sh \
+       src/filetree1.sh \
+       src/gnaw.sh \
+       src/mandelbrotset1.sh \
+       src/multifollow.sh \
+       src/numtree1.sh \
+       src/primenumbers1.sh \
+       src/rssread.sh \
+       src/shcalc.sh \
+       src/shircbot.sh \
+       src/shlint.sh \
+       src/shman.sh \
+       src/shnote.sh \
+       src/shpiano.sh \
+       src/shtinyurl.sh \
+       src/shtwitter.sh \
+       src/simplefileattributetree1.sh \
+       src/simplefiletree1.sh \
+       src/svcproptree1.sh \
+       src/termclock.sh \
+       src/test_net_sctp.sh \
+       src/xmldocumenttree1.sh \
+       tests/README.tests \
        tests/shtests \
        tests/alias.sh \
        tests/append.sh \
@@ -93,7 +116,14 @@
        tests/sigchld.sh \
        tests/signal.sh \
        tests/statics.sh \
+       tests/subshell.sh \
+       tests/substring.sh \
+       tests/sun_solaris_array_default_datatype.sh \
+       tests/sun_solaris_builtin_poll.sh \
        tests/sun_solaris_builtin_sum.sh \
+       tests/sun_solaris_builtin_tail.sh \
+       tests/sun_solaris_command_substitution.sh \
+       tests/sun_solaris_compound_nameref.sh \
        tests/sun_solaris_compoundvario.sh \
        
tests/sun_solaris_cr_6687139_command_substitution_exec_redirection_allocation_loop.sh
 \
        tests/sun_solaris_cr_6713682_compound_var_bleeds_through_subshell.sh \
@@ -102,8 +132,20 @@
        tests/sun_solaris_cr_6754020_weird_square_bracket_expansion.sh \
        tests/sun_solaris_cr_6763594_command_failure_execs_twice.sh \
        tests/sun_solaris_cr_6766246_pattern_matching_bug.sh \
+       
tests/sun_solaris_cr_6769332_substitutions_terminate_shell_after_257_iterations.sh
 \
+       tests/sun_solaris_cr_6777491_lacks_arithmetric_function_iszero.sh \
+       tests/sun_solaris_cr_6778077_sigthaw_trap.sh \
+       tests/sun_solaris_cr_6789247_printf_hexfloat_rounding.sh \
        tests/sun_solaris_cr_6800929_large_command_substitution_hang.sh \
+       tests/sun_solaris_cr_6805792_varmovetest1.sh \
+       tests/sun_solaris_cr_6805794_character_to_wchar_not_working.sh \
+       tests/sun_solaris_cr_6805795_negative_zero.sh \
        tests/sun_solaris_cr_6807179_shellpattern_uses_getpwnam.sh \
+       tests/sun_solaris_cr_6835835_builtin_cat_n_broken.sh \
+       
tests/sun_solaris_cr_6848486_echo_test_with_test_undefined_executes_test_builtin.sh
 \
+       tests/sun_solaris_cr_6855875_typeset_hexfloat_has_too_few_digits.sh \
+       tests/sun_solaris_cr_6862121_shbinexec_kernel_module_defunct.sh \
+       
tests/sun_solaris_cr_6881017_background_process_in_subshell_hangs_caller.sh \
        tests/sun_solaris_getconf.sh \
        tests/sun_solaris_local_compound_nameref001.sh \
        tests/sun_solaris_staticvariables.sh \
@@ -110,10 +152,9 @@
        tests/sun_solaris_vartree001.sh \
        tests/sun_solaris_vartree002.sh \
        tests/sun_solaris_vartree003.sh \
-       tests/substring.sh \
-       tests/subshell.sh \
        tests/tilde.sh \
        tests/timetype.sh \
+       tests/treemove.sh \
        tests/types.sh \
        tests/variables.sh \
        tests/vartree1.sh \
@@ -132,18 +173,14 @@
        cat "$<" >"$(@F)"
        $(INS) -s -m $(FILEMODE) -f $(@D) "$(@F)"
        $(RM) "$(@F)"
-       
-# Documentation rules
-$(ROOTDEMODIRBASE)/doc/%: common/%
-       $(INS.file)
 
-$(ROOTDEMODIRBASE)/doc/%: misc/%
+$(ROOTDEMODIRBASE)/src/%.sh: common/scripts/%.sh
        $(INS.file)
-
+       
 ROOTDEMODIRS=  $(ROOTDEMODIRBASE) .WAIT \
                $(ROOTDEMODIRBASE)/bin \
-               $(ROOTDEMODIRBASE)/doc \
                $(ROOTDEMODIRBASE)/fun \
+               $(ROOTDEMODIRBASE)/src \
                $(ROOTDEMODIRBASE)/tests
 
 install: $(ROOTDEMODIRS) .WAIT $(ROOTDEMOFILES)
--- /dev/null   Fri Sep 25 06:29:58 2009
+++ new/usr/src/lib/libshell/Makefile.doc       Fri Sep 25 06:29:57 2009
@@ -0,0 +1,91 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+ROOTDOCDIRBASE=        $(ROOT)/usr/share/doc/ksh
+
+DOCFILES= \
+       RELEASE \
+       README \
+       TYPES \
+       DESIGN \
+       COMPATIBILITY \
+       OBSOLETE \
+       shell_styleguide.docbook \
+       shell_styleguide.html \
+       images/tag_bourne.png \
+       images/tag_i18n.png \
+       images/tag_ksh88.png \
+       images/tag_ksh93.png \
+       images/tag_ksh.png \
+       images/tag_l10n.png \
+       images/tag_perf.png \
+       images/callouts/1.png \
+       images/callouts/2.png \
+       images/callouts/3.png \
+       images/callouts/4.png \
+       images/callouts/5.png \
+       images/callouts/6.png \
+       images/callouts/7.png \
+       images/callouts/8.png \
+       images/callouts/9.png \
+       images/callouts/10.png
+
+# Documentation rules
+$(ROOTDOCDIRBASE)/%: common/%
+       $(INS.file)
+
+$(ROOTDOCDIRBASE)/%: misc/%
+       $(INS.file)
+
+ROOTDOCDIRS=   \
+       $(ROOTDOCDIRBASE) .WAIT \
+       $(ROOTDOCDIRBASE)/images .WAIT \
+       $(ROOTDOCDIRBASE)/images/callouts
+
+$(ROOTDOCDIRBASE)/%.html: misc/%.docbook
+       /usr/bin/xsltproc \
+               --nonet \
+               --stringparam generate.section.toc.level 0 \
+               --stringparam toc.max.depth 3 \
+               --stringparam toc.section.depth 12 \
+               --xinclude \
+               -o "$(@F)" \
+                       
/usr/share/sgml/docbook/xsl-stylesheets/html/docbook.xsl \
+                       "$<" >xsltproc.log 2>&1
+       $(INS) -s -m $(FILEMODE) -f "$(@D)" "$(@F)"
+       $(RM) "$(@F)"
+
+# Generic documentation rules
+DOCFILESRCDIR=         common
+ROOTDOCFILES=  $(DOCFILES:%=$(ROOTDOCDIRBASE)/%)
+$(ROOTDOCDIRS) :=      OWNER =         root
+$(ROOTDOCDIRS) :=      GROUP =         bin
+$(ROOTDOCDIRS) :=      DIRMODE =       755
+
+$(ROOTDOCDIRS):
+       $(INS.dir)
+
+install: $(ROOTDOCDIRS) .WAIT $(ROOTDOCFILES)
--- old/usr/src/lib/libshell/amd64/include/ast/history.h        Fri Sep 25 
06:30:01 2009
+++ new/usr/src/lib/libshell/amd64/include/ast/history.h        Fri Sep 25 
06:29:59 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/amd64/include/ast/nval.h   Fri Sep 25 06:30:04 2009
+++ new/usr/src/lib/libshell/amd64/include/ast/nval.h   Fri Sep 25 06:30:02 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -276,6 +276,7 @@
 extern __MANGLE__ Namval_t             *nv_lastdict __PROTO__((void));
 extern __MANGLE__ Namval_t             *nv_mkinttype __PROTO__((char*, size_t, 
int, const char*, Namdisc_t*));
 extern __MANGLE__ void                 nv_newattr 
__PROTO__((Namval_t*,unsigned,int));
+extern __MANGLE__ void                 nv_newtype __PROTO__((Namval_t*));
 extern __MANGLE__ Namval_t             *nv_open __PROTO__((const 
char*,Dt_t*,int));
 extern __MANGLE__ void                 nv_putval __PROTO__((Namval_t*,const 
char*,int));
 extern __MANGLE__ void                 nv_putv __PROTO__((Namval_t*,const 
char*,int,Namfun_t*));
--- old/usr/src/lib/libshell/amd64/include/ast/shell.h  Fri Sep 25 06:30:07 2009
+++ new/usr/src/lib/libshell/amd64/include/ast/shell.h  Fri Sep 25 06:30:05 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -146,8 +146,8 @@
        int             inlineno;       /* line number of current input file */
        int             exitval;        /* most recent exit value */
        unsigned char   trapnote;       /* set when trap/signal is pending */
-       char            subshell;       /* set for virtual subshell */
        char            shcomp;         /* set when runing shcomp */
+       short           subshell;       /* set for virtual subshell */
 #ifdef _SH_PRIVATE
        _SH_PRIVATE
 #endif /* _SH_PRIVATE */
--- old/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/acct   Fri Sep 25 
06:30:10 2009
+++ new/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/acct   Fri Sep 25 
06:30:08 2009
@@ -1,11 +1,11 @@
-/* : : generated by iffe version 2008-01-31 : : */
+/* : : generated by iffe version 2009-05-01 : : */
 #ifndef _def_acct_ksh93
 #define _def_acct_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _lib_acct      1       /* acct() in default lib(s) */
--- old/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/cmds   Fri Sep 25 
06:30:13 2009
+++ new/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/cmds   Fri Sep 25 
06:30:11 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/cmds
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/cmd/ksh93/features/cmds
 by iffe version 2009-05-01 : : */
 #ifndef _def_cmds_ksh93
 #define _def_cmds_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _cmd_newgrp    1       /* newgrp in ?(/usr)/(bin|etc|ucb) */
--- old/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/dynamic        Fri Sep 
25 06:30:16 2009
+++ new/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/dynamic        Fri Sep 
25 06:30:14 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/dynamic
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/cmd/ksh93/features/dynamic
 by iffe version 2009-05-01 : : */
 #ifndef _def_dynamic_ksh93
 #define _def_dynamic_ksh93     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #if SHOPT_DYNAMIC
--- old/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/execargs       Fri Sep 
25 06:30:18 2009
+++ new/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/execargs       Fri Sep 
25 06:30:17 2009
@@ -1,11 +1,11 @@
-/* : : generated by iffe version 2008-01-31 : : */
+/* : : generated by iffe version 2009-05-01 : : */
 #ifndef _def_execargs_ksh93
 #define _def_execargs_ksh93    1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #endif
--- old/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/externs        Fri Sep 
25 06:30:21 2009
+++ new/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/externs        Fri Sep 
25 06:30:19 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/externs
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/cmd/ksh93/features/externs
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_externs_ksh93
 #if !defined(__PROTO__)
@@ -63,10 +63,10 @@
 
 #define _def_externs_ksh93     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _hdr_exec_attr 1       /* #include <exec_attr.h> ok */
--- old/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/locale Fri Sep 25 
06:30:24 2009
+++ new/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/locale Fri Sep 25 
06:30:22 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/locale
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/cmd/ksh93/features/locale
 by iffe version 2009-05-01 : : */
 #ifndef _def_locale_ksh93
 #define _def_locale_ksh93      1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _hdr_locale    1       /* #include <locale.h> ok */
--- old/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/math   Fri Sep 25 
06:30:27 2009
+++ new/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/math   Fri Sep 25 
06:30:25 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/math.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/cmd/ksh93/features/math.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_math_ksh93
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
@@ -62,15 +62,15 @@
 
 #define _def_math_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
                   
 
-/* : : generated by iffe from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/data/math.tab
 : : */
+/* : : generated by iffe from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/cmd/ksh93/data/math.tab
 : : */
 
 typedef Sfdouble_t (*Math_f) __PROTO__((Sfdouble_t,...));
 
@@ -88,7 +88,13 @@
 static int local_islessequal __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, 
a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return islessequal(a1,a2);}
 static int local_islessgreater __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, 
a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return islessgreater(a1,a2);}
 static int local_isnormal __PARAM__((Sfdouble_t a1), (a1)) 
__OTORP__(Sfdouble_t a1;){return isnormal(a1);}
+#ifdef FP_SUBNORMAL
+static int local_issubnormal __PARAM__((Sfdouble_t x), (x)) 
__OTORP__(Sfdouble_t x;){ return fpclassify(x) == FP_SUBNORMAL; }
+#endif
 static int local_isunordered __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, 
a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return isunordered(a1,a2);}
+#ifdef FP_ZERO
+static int local_iszero __PARAM__((Sfdouble_t x), (x)) __OTORP__(Sfdouble_t 
x;){ return fpclassify(x) == FP_ZERO; }
+#endif
 static int local_signbit __PARAM__((Sfdouble_t a1), (a1)) __OTORP__(Sfdouble_t 
a1;){return signbit(a1);}
 
 /*
@@ -136,9 +142,19 @@
        "\012islessgreater",    (Math_f)local_islessgreater,
        "\011isnan",    (Math_f)isnanl,
        "\011isnormal", (Math_f)local_isnormal,
+#ifdef FP_SUBNORMAL
+       "\011issubnormal",      (Math_f)local_issubnormal,
+#endif
        "\012isunordered",      (Math_f)local_isunordered,
+#ifdef FP_ZERO
+       "\011iszero",   (Math_f)local_iszero,
+#endif
+       "\001j0",       (Math_f)j0l,
+       "\001j1",       (Math_f)j1l,
+       "\002jn",       (Math_f)jnl,
        "\001lgamma",   (Math_f)lgammal,
        "\001log",      (Math_f)logl,
+       "\001log10",    (Math_f)log10l,
        "\001log1p",    (Math_f)log1pl,
        "\001log2",     (Math_f)log2l,
        "\001logb",     (Math_f)logbl,
@@ -159,6 +175,9 @@
        "\001tanh",     (Math_f)tanhl,
        "\001tgamma",   (Math_f)tgammal,
        "\001trunc",    (Math_f)truncl,
+       "\001y0",       (Math_f)y0l,
+       "\001y1",       (Math_f)y1l,
+       "\002yn",       (Math_f)ynl,
        "",             (Math_f)0
 };
 #endif
--- old/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/options        Fri Sep 
25 06:30:30 2009
+++ new/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/options        Fri Sep 
25 06:30:28 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/options
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/cmd/ksh93/features/options
 by iffe version 2009-05-01 : : */
 #ifndef _def_options_ksh93
 #define _def_options_ksh93     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define SHELLMAGIC     1
--- old/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/poll   Fri Sep 25 
06:30:33 2009
+++ new/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/poll   Fri Sep 25 
06:30:31 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/poll
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/cmd/ksh93/features/poll
 by iffe version 2009-05-01 : : */
 #ifndef _def_poll_ksh93
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
@@ -62,10 +62,10 @@
 
 #define _def_poll_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _hdr_poll      1       /* #include <poll.h> ok */
--- old/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/pstat  Fri Sep 25 
06:30:35 2009
+++ new/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/pstat  Fri Sep 25 
06:30:34 2009
@@ -1,11 +1,11 @@
-/* : : generated by iffe version 2008-01-31 : : */
+/* : : generated by iffe version 2009-05-01 : : */
 #ifndef _def_pstat_ksh93
 #define _def_pstat_ksh93       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #endif
--- old/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/rlimits        Fri Sep 
25 06:30:38 2009
+++ new/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/rlimits        Fri Sep 
25 06:30:36 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/rlimits
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/cmd/ksh93/features/rlimits
 by iffe version 2009-05-01 : : */
 #ifndef _def_rlimits_ksh93
 #define _def_rlimits_ksh93     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _sys_resource  1       /* #include <sys/resource.h> ok */
--- old/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/setjmp Fri Sep 25 
06:30:41 2009
+++ new/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/setjmp Fri Sep 25 
06:30:39 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/setjmp
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/cmd/ksh93/features/setjmp
 by iffe version 2009-05-01 : : */
 #ifndef _def_setjmp_ksh93
 #define _def_setjmp_ksh93      1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _lib_sigsetjmp 1       /* sigsetjmp() in default lib(s) */
--- old/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/sigfeatures    Fri Sep 
25 06:30:44 2009
+++ new/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/sigfeatures    Fri Sep 
25 06:30:42 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/sigfeatures
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/cmd/ksh93/features/sigfeatures
 by iffe version 2009-05-01 : : */
 #ifndef _def_sigfeatures_ksh93
 #define _def_sigfeatures_ksh93 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _lib_sigrelse  1       /* sigrelse() in default lib(s) */
--- old/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/time   Fri Sep 25 
06:30:47 2009
+++ new/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/time   Fri Sep 25 
06:30:45 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/time
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/cmd/ksh93/features/time
 by iffe version 2009-05-01 : : */
 #ifndef _def_time_ksh93
 #define _def_time_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _hdr_utime     1       /* #include <utime.h> ok */
--- old/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/ttys   Fri Sep 25 
06:30:50 2009
+++ new/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/ttys   Fri Sep 25 
06:30:48 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/ttys
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/cmd/ksh93/features/ttys
 by iffe version 2009-05-01 : : */
 #ifndef _def_ttys_ksh93
 #define _def_ttys_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _hdr_termios   1       /* #include <termios.h> ok */
--- old/usr/src/lib/libshell/common/RELEASE     Fri Sep 25 06:30:53 2009
+++ new/usr/src/lib/libshell/common/RELEASE     Fri Sep 25 06:30:51 2009
@@ -1,3 +1,233 @@
+09-09-09  --- Release ksh93t+  ---
+09-09-09  A bug in the processing of line joining in here documents which
+         occurred when a buffer began with <escape><new-line> has been fixed.
+09-09-09  A leading ; with commands in a brace group or parenthesis group
+         no longer causes an error.  It now is used for the "showme" option.
+09-09-09  A bug in which a subshell containing a background process could
+         block until the background process completed has been fixed.
+09-09-04  A bug in handing ${var[sub]}, where var is a nameref has been fixed.
+09-09-03  A bug which caused an index array to have the wrong number of 
elements
+         when it was converted from a compound variable by adding an another
+         element has been fixed.
+09-09-03  Specifying export for a compound variable now generates an error.
+09-09-02  $"..." localizations strings are no longer recognized inside `...`.
+09-09-01  A bug in the for loop optimizer in the handling of type static
+         variables has been fixed.
+09-09-01  An error message is not displayed when * and @ are used as 
subscripts.
+09-09-01  Several bugs in the processing for types that included an associative
+         array of another type has been fixed.
+09-09-01  A bug in the tracing of [[ a < b ]] and [[ a > b ]] has been fixed.
+09-08-26  The .sh.file variable was not being set for a script that was run
+         by name and didn't start with #! and this has been fixed.
+09-08-25  A bug in which a function called to deeply from command substitution
+         did not display an error message has been fixed.
+09-08-24  When processing profiles, ksh93 now violates the POSIX standard and
+         treats &> as a redirection operator similar to bash.
+09-08-23  A bug in the handling of the trap on SIGPIPE that could lead to am
+         memory fault has been fixed.
+09-08-21  A bug in the handling of the comma operator in arithmetic expressions
+         that could cause a core dump on some systems has been fixed.
+09-08-20  A bug in which a compound variable containing an array of a type
+         that doesn't have any elements now expands correctly.
+09-08-19  A bug which disabled function tracing inside a function after
+         a call to another function has been fixed.
+09-08-19  A bug in which initializing a compound variable instance to another
+         compound variable by name has been fixed.
+09-08-18  A bug in which compound variable instances could be lost after
+         an instance that invoked a type method discipline has been fixed.
+09-08-18  A bug in which a discipline function for a type applied to an
+         array instance when invoked in a function ignored the subscript
+         has been fixed.
+09-08-18  A scoping error with variables in arithmetic expression with
+         type variables when reference with a name reference has been fixed.
+09-08-10  Several memory leaks were fixed primarily related to subshells.
+09-08-06  A bug in which setting the trap on CHLD to ignore could cause
+         a script to hang has been fixed. 
+09-07-08  A bug in the processing of name reference assignments when it
+         contained pattern expansions with quoting has been fixed.
+09-06-22  The default width for typeset -X has been changed so that there
+         should be no loss of precision when converting to a string.
+09-06-19  A bug in the printing of array elements for binary variables with
+         printf %B has been fixed.
+09-06-19  A bug which caused a core dump with trap DEBUG set with an array
+         assignment with no elements has been fixed.
+09-06-19  A bug with read with typeset -b -Z<num> has been fixed.
+09-06-19  Two bugs related to read -b for array variables has been fixed.
+09-06-19  A bug with typeset for compound variables containing arrays of
+         compound variables has been fixed.
+09-06-18  A bug in appending a compound variable to a an indexed array of
+         compound variables has been fixed.
+09-06-18  A bug which occurs when appending a compound variable to an indexed
+         array element has been fixed.
+09-06-18  Setting VISUAL to a value other than one ending in vi or emacs will
+         no longer unset the edit mode.
+09-06-17  A bug in typeset -m when moving a local compound variable to a
+         global compound variable via a name reference has been fixed.
+09-06-17  A bug in appending to nodes of an array of compound variables when
+         addressing them via nameref has been fixed.
+09-06-17  A bug in typeset -p var, when var is an array of compound variables
+         in which the output only contained on array element has been fixed.
+09-06-17  The prefix expansion ${...@} now works when y is a name
+         reference to an element of an array.
+09-06-16  Traps on signals that are ignored when the shell is invoked
+         no longer display.  Previously they were ignored as required but
+         would be listed with trap -p.
+09-06-12  A bug in vi edit mode in which hitting the up arrow key at the
+         end of a line longer than 40 characters which caused a core dump
+         has been fixed. 
+09-06-11  A bug in which "eval non-builtin &" would create two processes,
+         one for the & and another for non-builtin has been fixed.
+09-06-08  When var is an identifier and is unset, ${var} no longer tries to
+         run command substitution on the command var.
+09-06-08  Process substitution arguments of the form <(command) can now be
+         used following the < redirection operator to redirect from command.
+09-05-13  A bug in which redirections of the form 2>&1 1>&5 inside command
+         substitution could cause the command substitution to hang has been
+         fixed.
+09-05-12  To conform with POSIX, the -u option only checks for unset variables
+         and subscript elements rather than checking for all parameters.
+09-05-12  A bug which could cause a core dump when a variable whose name
+         begins with a . was referenced as part of a name reference inside
+         a function has been fixed.
+09-05-01  A bug that caused a core dump when SIGWINCH was received and
+         both vi and emacs mode were off has been fixed.
+09-04-22  Default alias compound='typeset -C' added.
+09-04-15  A bug that caused ${...;} to hang for large files has ben fixed.
+09-04-08  A change was made in the -n option which printed out an incorrect
+         warning with <>.
+09-04-07  The emacs edit command M-_ and M_. and the vi command _ was fixed
+         to handle the case there there is no history file.
+09-04-05  A bug in handling new-lines with read -n has been fixed.
+09-04-05  The ENV variable defaults the the file named by $HOME/.kshrc rather
+         then to the string $HOME/.kshrc.
+09-03-31  A bug in which a nested command substitution with redirections could
+         leave a file descriptor open has been fixed.
+09-03-24  ksh now only uses the value of the _ variable on startup if it can
+         verify that it was set by the invoking process rather than being
+         inherited by some other ancestor.
+09-03-24  When ksh is invoked without -p and ruid!=euid, and the shell is
+         compiled without SHOPT_P_UID or ruid<SHOPT_P_UID, the shell now
+         enables the -p option.  The previous version instead set the
+         euid to the ruid as it does for set +p.
+09-03-24  When SHOPT_P_UID is defined at compile time and the shell is started
+         without -p and ruid!=euid and ruid>=SHOPT_P_UID then euid is set
+         to ruid. A bug that did the wrong test (ruid<SHOPT_P_UID) was fixed.
+09-03-17  The sleep(1) builtin now accept and ISO 8601 PnYnMnDTnHnMnS
+         duration or date(1) compatible date/time operand.
+09-03-10  If a variable that was left or right justified or zero-filled was
+         changed with a typeset statement that was left or right justified
+         or zero-filled, then the original justification no longer affects
+         the result.
+09-03-10  A bug in the handling of traps when the last command in a script
+         is a subshell grouping command has been fixed.
+09-03-03  A bug in which an expansion of the form ${!pre...@} could generate
+         an exception after the return from a function has been fixed.
+09-02-02  A bug in restricted mode in which the value of ENV could be
+         changed from within a function has been fixed.
+09-02-02  A bug in which an erroneous message indicating that a process
+         terminated with a coredump has been fixed.
+09-02-02  The exit status when exit was called without an argument from
+         a signal handler was incorrect and has been fixed.
+09-02-02  A bug in which a function autoloaded in a subshell could cause
+         a core dump when the subshell completed has been fixed.
+09-02-02  A bug in which 2>&1 inside a command substitution wasn't working
+         correctly has been fixed.
+09-02-02  A bug in the call stack of arithmetic function with 2 args
+         returning int has been fixed.
+09-01-30  A bug in which 'eval print \$0' inside a function was giving the
+         wrong value for $0 has been fixed.
+09-01-28  A bug in which a command substitution could return an exit status
+         of 127 when the pipefail option is enabled has been fixed.
+09-01-26  ksh93 now generates an error message if you attempt to create
+         a global name reference to a local variable.
+09-01-26  The [[ -v var ]] operator was modified to test for array elements.
+09-01-23  The redirection operator <>; was added.  It is similar to <>
+         except that if the command it is applied to succeeds, the file
+         is truncated to the offset at the command completion.
+09-01-23  The default file descriptor for <> was changed to 1.
+09-01-20  A bug in which the exit status specified in an exit trap was
+         not used when a process terminated with a signal has been fixed.
+09-01-19  A bug in which a signal whose default action is to terminate
+         a process could be ignored when the process is running a sub-shell
+         has been fixed.
+09-01-19  A bug in which sending SIGWINCH to a process that reads from a pipe
+         could cause a memory fault has been fixed.
+09-01-16  The -R unary operator was added to [[...]] and test to check whether
+         a variable is a  name reference.
+09-01-16  The -v unary operator was added to [[...]] and test to check whether
+         a variable is set.
+09-01-14  The unset built-in was modified to return 0 exit status when
+         unsetting a variable that was unset to conform with the POSIX
+         standard.
+09-01-14  The unset built-in was modified to continue to unset variables
+         after encountering a variable that it could not unset to
+         conform to the POSIX standard.
+09-01-14  The parameter expansion ${x+value} no longer expands the value of
+         the variable x when determining whether x is set or not.
+09-01-13  A bug in which background jobs and pipelines that were not waited
+         for could, in rare instances, cause the shell to go into an infinite
+         loop or fail has been fixed.
+09-01-06  A bug in indexed arrays of compound variables in which referencing
+         non-existent sub-variable in an arithmetic expression could cause
+         the sub-variable to be created has been fixed.
+09-01-05  A bug in which the \ character did not escape extended regular
+         expression pattern characters has been fixed.
+08-12-24  A bug in which killing the last element of a pipe did not cause
+         a write to the pipe to generate a SIGPIPE has been fixed.
+08-12-19  A bug which could cause command substitution to hang when the
+         last element of a pipeline in a command substitution was a built-in
+         and the output was more that PIPE_BUFF.
+08-12-18  A bug which occurs when a here documented marker embedded in a
+         command substitution occurs on a buffer boundary has been fixed.
+08-12-17  A bug in the output of typeset -p for variables that had attributes
+         but did not have a value has been fixed.
+08-12-16  A bug in which a name reference to a name reference variable that
+         references an array element has been fixed.
+08-12-16  A bug in which a variable given both the -A and -C attribute along
+         with an initial assignment didn't work correctly has been fixed.
+08-12-10  The [[ -t fd ]] test was fixed to handle fd>9.
+08-12-10  A bug where function stack misalignment could cause a bus error
+         has been fixed.
+08-12-09  Command completion was changed to use \ to quote special characters
+         instead of quoting the argument in single quotes.
+08-12-07  A bug in typeset -m which occurred when the target node was an
+         associative array element has been fixed.
+08-12-07  A timing bug on some systems (for example darwin), that could
+         cause the last process of a pipeline entered interactively to fail
+         with an "Exec format error" has been fixed.
+08-12-04  SHOPT_BGX enables background job extensions. Noted by "J" in
+         the version string when enabled. (1) JOBMAX=n limits the number
+         of concurrent & jobs to n; the n+1 & job will block until a
+         running background job completes. (2) SIGCHLD traps are queued
+         so that each completing background job gets its own trap; $! is
+         set to the job pid and $? is set to the job exit status at the
+         beginning of the trap. (3) sleep -s added to sleep until the time
+         expires or until a signal is delivered.
+08-12-04  The sign of floating point zero is preserved across arithmetic
+         function calls.
+08-12-04  A bug that caused print(1) to produce garbled stdout/stderr
+         output has been fixed.
+08-12-04  A bug in which printf "%d\n" "'<euro>'" did not output the
+          numerical value of the EURO symbol, 8354, has been fixed.
+08-11-24  /dev/fd* and /dev/std* redirections are first attempted with
+         open() to preserve seek semantics; failing that the corresponding
+         file descriptors are dup()'d.
+08-11-20  A bug which could cause a core dump if a function compiled with
+         shcomp was found has been fixed.
+08-11-20  A bug in which jobs were not cleared from the jobs table for
+         interactive shells when the pipefail option is on has been fixed.
+08-11-11  A bug in which a field that was unset in a type definition and later
+         set for an instance could appear twice when displaying the variable
+         has been fixed.
+08-11-11  A bug in which running a simple command & inside a function would
+         not return the correct process id has been fixed.
+08=11-10  A bug in which the exit status of a command could be lost if the pid
+         was that of the most recent command substitution that had completed
+         has been fixed.
+08-11-10  The maximum depth for subshells has been increased from 256 to 65536.
+08-11-06  A bug which could cause a core dump when the _ reference variable was
+          used as an embedded type with a compound assignment has been fixed.
+
 08-10-31  --- Release ksh93t  ---
 08-10-31  Variable scoping/initialization bugs that could dump core were fixed.
 08-10-24  The lexer now accepts all RE characters for patterns prefixed
@@ -6,7 +236,7 @@
 08-10-18  A bug in array scoping that could dump core has been fixed.
 08-10-10  read -n and -N fixed to count characters in multibyte locales.
 08-10-10  A bug that mishandled _.array[] type references has been fixed.
-08-10-09  ${.sh.version} now contains a catenation of the following (after
+08-10-09  ${.sh.version} now contains a concatenation of the following (after
          'Version') denoting compile time features:
                A       SHOPT_AUDIT
                B       SHOPT_BASH
@@ -115,7 +345,7 @@
          jobs completed has been fixed.
 08-06-23  KSH_VERSION added as a name reference to .sh.version.
 08-06-20  type now outputs 'special builtin' for special builtins.
-08-06-19  A couple of bugs in multi-dimensional arrays have been fxied.
+08-06-19  A couple of bugs in multi-dimensional arrays have been fixed.
 08-06-19  A bug in which a syntax error in a dot script could generated
          a syntax error in the next subsequent command has been fixed.
 08-06-17  Reduced the maximum function call depth to 2048 to avoid exceptions
@@ -865,7 +1095,7 @@
          used inside ${...} has been fixed.
 03-07-15  An error in which expanding an indexed array inside a compound
          variable could cause a core dump has been fixed.
-03-07-15  A bug in which under on rare occassions a job completion interrupt
+03-07-15  A bug in which on rare occasions a job completion interrupt
          could cause to core dump has been fixed.
 03-06-26  A bug in which process substitution embedded within command
          substitution would generate a syntax error has been fixed.
--- old/usr/src/lib/libshell/common/bltins/alarm.c      Fri Sep 25 06:30:56 2009
+++ new/usr/src/lib/libshell/common/bltins/alarm.c      Fri Sep 25 06:30:54 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/bltins/cd_pwd.c     Fri Sep 25 06:30:59 2009
+++ new/usr/src/lib/libshell/common/bltins/cd_pwd.c     Fri Sep 25 06:30:57 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -37,7 +37,6 @@
 #include       "name.h"
 #include       "builtins.h"
 #include       <ls.h>
-#include       <ctype.h>
 
 /*
  * Invalidate path name bindings to relative paths
--- old/usr/src/lib/libshell/common/bltins/cflow.c      Fri Sep 25 06:31:02 2009
+++ new/usr/src/lib/libshell/common/bltins/cflow.c      Fri Sep 25 06:31:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -33,7 +33,6 @@
 #include       "defs.h"
 #include       <ast.h>
 #include       <error.h>
-#include       <ctype.h>
 #include       "shnodes.h"
 #include       "builtins.h"
 
@@ -65,7 +64,7 @@
                errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0));
        pp->mode = (**argv=='e'?SH_JMPEXIT:SH_JMPFUN);
        argv += opt_info.index;
-       n = (((arg= *argv)?(int)strtol(arg, (char**)0, 
10):shp->oldexit)&SH_EXITMASK);
+       n = (((arg= *argv)?(int)strtol(arg, (char**)0, 
10)&SH_EXITMASK:shp->oldexit));
        /* return outside of function, dotscript and profile is exit */
        if(shp->fn_depth==0 && shp->dot_depth==0 && !sh_isstate(SH_PROFILE))
                pp->mode = SH_JMPEXIT;
--- old/usr/src/lib/libshell/common/bltins/enum.c       Fri Sep 25 06:31:04 2009
+++ new/usr/src/lib/libshell/common/bltins/enum.c       Fri Sep 25 06:31:03 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/bltins/getopts.c    Fri Sep 25 06:31:07 2009
+++ new/usr/src/lib/libshell/common/bltins/getopts.c    Fri Sep 25 06:31:05 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/bltins/hist.c       Fri Sep 25 06:31:10 2009
+++ new/usr/src/lib/libshell/common/bltins/hist.c       Fri Sep 25 06:31:08 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -22,7 +22,6 @@
 #include       <stak.h>
 #include       <ls.h>
 #include       <error.h>
-#include       <ctype.h>
 #include       "variables.h"
 #include       "io.h"
 #include       "name.h"
--- old/usr/src/lib/libshell/common/bltins/misc.c       Fri Sep 25 06:31:13 2009
+++ new/usr/src/lib/libshell/common/bltins/misc.c       Fri Sep 25 06:31:11 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -116,7 +116,7 @@
                register struct argnod *arg=shp->envlist;
                register Namval_t* np;
                register char *cp;
-               if(shp->subshell)
+               if(shp->subshell && !shp->subshare)
                        sh_subfork();
                if(logp && logp->clear)
                {
@@ -572,7 +572,7 @@
             case 2:
                if(!shp->lim.fs3d)
                        goto failed;
-               if(shp->subshell)
+               if(shp->subshell && !shp->subshare)
                        sh_subfork();
                for(n=0;n<argc;n+=2)
                {
--- old/usr/src/lib/libshell/common/bltins/mkservice.c  Fri Sep 25 06:31:16 2009
+++ new/usr/src/lib/libshell/common/bltins/mkservice.c  Fri Sep 25 06:31:14 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- /dev/null   Fri Sep 25 06:31:19 2009
+++ new/usr/src/lib/libshell/common/bltins/poll_solaris.c       Fri Sep 25 
06:31:17 2009
@@ -0,0 +1,377 @@
+/***********************************************************************
+*                                                                      *
+*               This software is part of the ast package               *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
+*                      and is licensed under the                       *
+*                  Common Public License, Version 1.0                  *
+*                    by AT&T Intellectual Property                     *
+*                                                                      *
+*                A copy of the License is available at                 *
+*            http://www.opensource.org/licenses/cpl1.0.txt             *
+*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
+*                                                                      *
+*              Information and Software Systems Research               *
+*                            AT&T Research                             *
+*                           Florham Park NJ                            *
+*                                                                      *
+*               Roland Mainz <roland.mainz at nrubsig.org>                *
+*                                                                      *
+***********************************************************************/
+#pragma prototyped
+
+#include       <shell.h>
+#include       <stdio.h>
+#include       <stdbool.h>
+#include       <option.h>
+#include       <stk.h>
+#include       <tm.h>
+#include       "name.h"
+#undef nv_isnull
+#ifndef SH_DICT
+#   define SH_DICT     "libshell"
+#endif
+#include       <poll.h>
+
+#define sh_contexttoshb(context)       ((Shbltin_t*)(context))
+#define sh_contexttoshell(context)     
((context)?(sh_contexttoshb(context)->shp):(NULL))
+
+static const char sh_optpoll[] =
+"[-?\n@(#)$Id: poll (AT&T Labs Research) 2009-05-14 $\n]"
+"[-author?Roland Mainz <roland.mainz at nrubsig.org]"
+"[-license?http://www.opensource.org/licenses/cpl1.0.txt]";
+"[+NAME? poll - input/output multiplexing]"
+"[+DESCRIPTION?The poll command provides applications with a mechanism "
+       "for multiplexing input/output over a set of file descriptors. "
+       "For each member of the array variable \bvar\b, "
+       "poll examines the given file descriptor in the subscript \b.fd\b "
+       "for the event(s) specified in the subscript \b.events\b."
+       "The poll command identifies those file descriptors on which an "
+       "application can read or write data, or on which certain events have "
+       "occurred.]"
+"[+?The \bvar\b argument specifies the file descriptors to be examined "
+       "and the events of interest for each file descriptor. "
+       "It is a array of structured variables with one member for each open "
+       "file descriptor of interest. The array's members contain the following 
"
+       "subscripts:]{"
+               "[+?\b.fd\b       # file descriptor]"
+               "[+?\b.events\b   # requested events]"
+               "[+?\b.revents\b  # returned event]"
+       "}"
+"[+?The \bfd\b variable specifies an open file descriptor and the "
+       "\bevents\b and \brevents\b members are strings constructed from "
+       "a concaternation of the following event flags, seperated by '|':]"
+       "{ "
+       "[+POLLIN?Data other than high priority data may be "
+               "read without blocking. For STREAMS, this "
+               "flag is set in revents even if the message "
+               "is of zero length.]"
+       "[+POLLRDNORM?Normal data (priority band equals 0) may be "
+               "read without blocking. For STREAMS, this "
+               "flag is set in revents even if the message "
+               "is of zero length.]"
+       "[+POLLRDBAND?Data from a non-zero priority band may be "
+               "read without blocking. For STREAMS, this "
+               "flag is set in revents even if the message "
+               "is of zero length.]"
+       "[+POLLPRI?High priority data may be received without "
+               "blocking. For STREAMS, this flag is set in "
+               "revents even if the message is of zero "
+               "length.]"
+       "[+POLLOUT?Normal data (priority band equals 0) may be "
+               "written without blocking.]"
+       "[+POLLWRNORM?The same as POLLOUT.]"
+       "[+POLLWRBAND?Priority data (priority band > 0) may be "
+               "written.  This event only examines bands "
+               "that have been written to at least once.]"
+       "[+POLLERR?An error has occurred on the device or "
+               "stream.  This flag is only valid in the "
+               "revents bitmask; it is not used in the "
+               "events member.]"
+       "[+POLLHUP?A hangup has occurred on the stream. This "
+               "event and POLLOUT are mutually exclusive; a "
+               "stream can never be writable if a hangup has "
+               "occurred. However, this event and POLLIN, "
+               ", POLLRDBAND, or POLLPRI are not "
+               "mutually exclusive. This flag is only valid "
+               "in the revents bitmask; it is not used in "
+               "the events member.]"
+       "[+POLLNVAL?The specified fd value does not belong to an "
+               "open file. This flag is only valid in the "
+               "revents member; it is not used in the events "
+               "member.]"
+   "}"
+"]"
+
+"[+?If the value fd is less than 0, events is ignored and "
+       "revents is set to 0 in that entry on return from poll.]"
+
+"[+?The results of the poll query are stored in the revents "
+       "member in the \bvar\b structure. POLL*-strings are set in the 
\brevents\b "
+       "variable to indicate which of the requested events are true. "
+       "If none are true, the \brevents\b will be an empty string when "
+       "the poll command returns. The event flags "
+       "POLLHUP, POLLERR, and POLLNVAL are always set in \brevents\b "
+       "if the conditions they indicate are true; this occurs even "
+       "though these flags were not present in events.]"
+
+"[+?If none of the defined events have occurred on any selected "
+       "file descriptor, poll waits at least timeout milliseconds "
+       "for an event to occur on any of the selected file descriptors. "
+       "On a computer where millisecond timing accuracy is not "
+       "available, timeout is rounded up to the nearest legal value "
+       "available on that system. If the value timeout is 0, poll "
+       "returns immediately. If the value of timeout is -1, poll "
+       "blocks until a requested event occurs or until the call is "
+       "interrupted.]"
+
+"[+?The poll function supports regular files, terminal and "
+       "pseudo-terminal devices, STREAMS-based files, FIFOs and "
+       "pipes. The behavior of poll on elements of fds that refer "
+       "to other types of file is unspecified.]"
+
+"[+?The poll function supports sockets.]"
+
+"[+?A file descriptor for a socket that is listening for connections "
+       "will indicate that it is ready for reading, once connections "
+       "are available. A file descriptor for a socket that "
+       "is connecting asynchronously will indicate that it is ready "
+       "for writing, once a connection has been established.]"
+ 
+"[+?Regular files always poll TRUE for reading and writing.]"
+
+"[e:eventarray]:[fdcount?Upon successful completion, an indexed array "
+       "of strings is returned which contains a list of array subscripts "
+       "in the poll array which received events.]"
+"[t:timeout]:[seconds?Timeout in seconds. If the value timeout is 0, "
+       "poll returns immediately. If the value of timeout is -1, poll "
+       "blocks until a requested event occurs or until the call is "
+       "interrupted.]"
+"[T:mtimeout]:[milliseconds?Timeout in milliseconds. If the value timeout is 
0, "
+       "poll returns immediately. If the value of timeout is -1, poll "
+       "blocks until a requested event occurs or until the call is "
+       "interrupted.]"
+"\n"
+"\nvar\n"
+"\n"
+"[+EXIT STATUS?]{"
+        "[+0?Success.]"
+        "[+>0?An error occurred.]"
+"}"
+"[+SEE ALSO?\bopen\b(1),\btmpfile\b(1),\bdup\b(1),\bclose\b(1),\bpoll\b(2)]"
+;
+
+/*
+ * |mystpcpy| - like |strcpy()| but returns the end of the buffer
+ *
+ * Copy string s2 to s1.  s1 must be large enough.
+ * return s1-1 (position of string terminator ('\0') in destnation buffer).
+ */
+static
+char *mystpcpy(char *s1, const char *s2)
+{
+        while (*s1++ = *s2++)
+                ;
+        return (s1-1);
+}
+
+static
+Namval_t *nv_open_fmt(Dt_t *dict, int flags, const char *namefmt, ...)
+{
+       char    varnamebuff[PATH_MAX];
+       va_list ap;
+
+       va_start(ap, namefmt);
+       vsnprintf(varnamebuff, sizeof(varnamebuff), namefmt, ap);
+       va_end(ap);
+       
+       return nv_open(varnamebuff, dict, flags);
+}
+
+static
+int poll_strtoevents(const char *str)
+{
+       int events = 0;
+    
+       if (strstr(str, "POLLIN"))     events |= POLLIN;
+       if (strstr(str, "POLLRDNORM")) events |= POLLRDNORM;
+       if (strstr(str, "POLLRDBAND")) events |= POLLRDBAND;
+       if (strstr(str, "POLLPRI"))    events |= POLLPRI;
+       if (strstr(str, "POLLOUT"))    events |= POLLOUT;
+       if (strstr(str, "POLLWRNORM")) events |= POLLWRNORM;
+       if (strstr(str, "POLLWRBAND")) events |= POLLWRBAND;
+       if (strstr(str, "POLLERR"))    events |= POLLERR;
+       if (strstr(str, "POLLHUP"))    events |= POLLHUP;
+       if (strstr(str, "POLLNVAL"))   events |= POLLNVAL;
+
+       return events;
+}
+
+
+static
+void poll_eventstostr(char *s, int events)
+{
+       *s='\0';
+       if (!events)
+               return;
+       
+       if (events & POLLIN)            s=mystpcpy(s, "POLLIN|");
+       if (events & POLLRDNORM)        s=mystpcpy(s, "POLLRDNORM|");
+       if (events & POLLRDBAND)        s=mystpcpy(s, "POLLRDBAND|");
+       if (events & POLLPRI)           s=mystpcpy(s, "POLLPRI|");
+       if (events & POLLOUT)           s=mystpcpy(s, "POLLOUT|");
+       if (events & POLLWRNORM)        s=mystpcpy(s, "POLLWRNORM|");
+       if (events & POLLWRBAND)        s=mystpcpy(s, "POLLWRBAND|");
+       if (events & POLLERR)           s=mystpcpy(s, "POLLERR|");
+       if (events & POLLHUP)           s=mystpcpy(s, "POLLHUP|");
+       if (events & POLLNVAL)          s=mystpcpy(s, "POLLNVAL|");
+
+       /* Remove trailling '|' */
+       s--;
+       if(*s=='|')
+               *s='\0';
+}
+
+#undef  getconf
+#define getconf(x)      strtol(astconf(x,NiL,NiL),NiL,0)
+               
+extern int b_poll(int argc, char *argv[], void *extra)
+{
+       Namval_t *np;
+       Shell_t *shp = sh_contexttoshell(extra);
+       char *varname;
+       int n;
+       int fd;
+       unsigned int numpollfd = 0;
+       int i;
+       char *s;
+       double timeout = -1.;
+       char buff[PATH_MAX*2+1]; /* enogth to hold two variable names */
+       char *eventarrayname = NULL;
+
+       while (n = optget(argv, sh_optpoll)) switch (n)
+       {
+           case 't':
+           case 'T':
+               errno = 0;
+               timeout = strtod(opt_info.arg, (char **)NULL);  
+               if (errno != 0)
+                       errormsg(SH_DICT, ERROR_system(1), "%s: invalid 
timeout", opt_info.arg);
+
+               /* -t uses seconds, -T milliseconds */
+               if (n == 't')
+                       timeout *= 1000.;
+               break;
+           case 'e':
+               eventarrayname = opt_info.arg;
+               break;
+           case ':':
+               errormsg(SH_DICT, 2, "%s", opt_info.arg);
+               break;
+           case '?':
+               errormsg(SH_DICT, ERROR_usage(2), "%s", opt_info.arg);
+               break;
+       }
+       argc -= opt_info.index;
+       argv += opt_info.index;
+       if(argc!=1)
+               errormsg(SH_DICT, ERROR_usage(2), optusage((char*)0));
+
+        varname = argv[0];
+
+       Namval_t *array_np, *array_np_sub;
+       const char *subname;
+
+       array_np = nv_open(varname, shp->var_tree, NV_NOFAIL|NV_NOADD);
+       if (!array_np)
+               errormsg(SH_DICT, ERROR_system(1), "cannot find array variable 
%s", varname);
+       if(!nv_isattr(array_np, NV_ARRAY))
+               errormsg(SH_DICT, ERROR_system(1), "variable %s is not an 
array", varname);
+
+       /* Count number of array elememts. We need to do it "manually" to
+        * handle sparse indexed and associative arrays */
+       nv_putsub(array_np, NULL, ARRAY_SCAN);
+       array_np_sub = array_np;
+       do
+       {
+               if (!(subname=nv_getsub(array_np_sub)))
+                       break;
+               numpollfd++;
+       } while( array_np_sub && nv_nextsub(array_np_sub) );
+
+       struct pollfd pollfd[numpollfd+1];
+
+       nv_putsub(array_np, NULL, ARRAY_SCAN);
+       array_np_sub = array_np;
+       i = 0;
+       do
+       {
+               if (!(subname=nv_getsub(array_np_sub)))
+                       break;
+
+               np = nv_open_fmt(shp->var_tree, NV_NOFAIL|NV_NOADD, 
"%s[%s].fd", varname, subname);
+               if (!np)
+                       errormsg(SH_DICT, ERROR_system(1), "missing pollfd 
%s[%s].fd", varname, subname);
+               fd = (int)nv_getnum(np);
+               if (fd < 0 || fd > OPEN_MAX)
+                       errormsg(SH_DICT, ERROR_system(1), "invalid pollfd fd 
%d", fd);
+               nv_close(np);
+               pollfd[i].fd = fd;
+
+               np = nv_open_fmt(shp->var_tree, NV_NOFAIL|NV_NOADD, 
"%s[%s].events", varname, subname);
+               if (!np)
+                       errormsg(SH_DICT, ERROR_system(1), "missing pollfd 
%s[%s].events", varname, subname);
+
+               s = nv_getval(np);
+               if (!s)
+                       errormsg(SH_DICT, ERROR_system(1), "missing pollfd 
events value");
+               pollfd[i].events  = poll_strtoevents(s);
+               nv_close(np);
+
+               pollfd[i].revents = 0;
+               
+               i++;
+       } while( array_np_sub && nv_nextsub(array_np_sub) );
+       
+       n = poll(pollfd, numpollfd, timeout);
+       /* FixMe: EGAIN and EINTR may require extra handling */
+       if (n < 0)
+               errormsg(SH_DICT, ERROR_system(1), "failure");
+
+       if (eventarrayname)
+       {
+               np = nv_open_fmt(shp->var_tree, NV_VARNAME|NV_ARRAY|NV_NOFAIL, 
"%s", eventarrayname);
+               if (!np)
+                       errormsg(SH_DICT, ERROR_system(1), "couldn't create 
poll count variable %s", eventarrayname);
+               nv_close(np);
+       }
+
+       nv_putsub(array_np, NULL, ARRAY_SCAN);
+       array_np_sub = array_np;
+       i = 0;
+       do
+       {
+               if (!(subname=nv_getsub(array_np_sub)))
+                       break;
+       
+               np = nv_open_fmt(shp->var_tree, NV_NOFAIL, "%s[%s].revents", 
varname, subname);
+               if (!np)
+                       errormsg(SH_DICT, ERROR_system(1), "couldn't create 
pollfd %s[%s].revents", varname, subname);
+
+               poll_eventstostr(buff, pollfd[i].revents);
+       
+               nv_putval(np, buff, 0);
+               nv_close(np);
+               
+               if (eventarrayname && pollfd[i].revents)
+               {
+                       sprintf(buff, "%s+=( '%s' )", eventarrayname, subname);
+                       sh_trap(buff, 0);
+               }
+               
+               i++;
+       } while( array_np_sub && nv_nextsub(array_np_sub) );
+       
+       nv_close(array_np);
+       
+       return(0);
+}
--- old/usr/src/lib/libshell/common/bltins/print.c      Fri Sep 25 06:31:22 2009
+++ new/usr/src/lib/libshell/common/bltins/print.c      Fri Sep 25 06:31:20 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -36,7 +36,6 @@
 #include       "builtins.h"
 #include       "streval.h"
 #include       <tmx.h>
-#include       <ctype.h>
 #include       <ccode.h>
 
 union types_t
@@ -203,8 +202,11 @@
                                fd = -1;
                        break;
                case 'v':
-                       vflag=1;
+                       vflag='v';
                        break;
+               case 'C':
+                       vflag='C';
+                       break;
                case ':':
                        /* The following is for backward compatibility */
 #if OPT_VERSION >= 19990123
@@ -240,7 +242,7 @@
        if(error_info.errors || (argc<0 && !(format = *argv++)))
                errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0));
        if(vflag && format)
-               errormsg(SH_DICT,ERROR_usage(2),"-v and -f are mutually 
exclusive");
+               errormsg(SH_DICT,ERROR_usage(2),"-%c and -f are mutually 
exclusive",vflag);
 skip:
        if(format)
                format = genformat(format);
@@ -293,6 +295,8 @@
                } while(*pdata.nextarg && pdata.nextarg!=argv);
                if(pdata.nextarg == nullarg && pdata.argsize>0)
                        sfwrite(outfile,stakptr(staktell()),pdata.argsize);
+               if(sffileno(outfile)!=sffileno(sfstderr))
+                       sfsync(outfile);
                sfpool(sfstderr,pool,SF_WRITE);
                exitval = pdata.err;
        }
@@ -299,7 +303,11 @@
        else if(vflag)
        {
                while(*argv)
-                       fmtbase64(outfile,*argv++,0);
+               {
+                       fmtbase64(outfile,*argv++,vflag=='C');
+                       if(!nflag)
+                               sfputc(outfile,'\n');
+               }
        }
        else
        {
@@ -519,7 +527,14 @@
                else
                {
                        int n = nv_size(np);
-                       cp = (char*)np->nvalue.cp;
+                       if(nv_isarray(np))
+                       {
+                               nv_onattr(np,NV_RAW);
+                               cp = nv_getval(np);
+                               nv_offattr(np,NV_RAW);
+                       }
+                       else
+                               cp = (char*)np->nvalue.cp;
                        if((size = n)==0)
                                size = strlen(cp);
                        size = sfwrite(iop, cp, size);
@@ -593,6 +608,7 @@
        union types_t*  value = (union types_t*)v;
        struct printf*  pp = (struct printf*)fe;
        register char*  argp = *pp->nextarg;
+       char*           w;
 
        if(fe->n_str>0 && varname(fe->t_str,fe->n_str) && (!argp || 
varname(argp,-1)))
        {
@@ -712,8 +728,14 @@
                        fe->flags &= ~SFFMT_LONG;
                        break;
                case 'c':
-                       if(fe->base >=0)
+                       if(mbwide() && (n = mbsize(argp)) > 1)
+                       {
+                               fe->fmt = 's';
+                               fe->size = n;
                                value->s = argp;
+                       }
+                       else if(fe->base >=0)
+                               value->s = argp;
                        else
                                value->c = *argp;
                        fe->flags &= ~SFFMT_LONG;
@@ -737,8 +759,12 @@
                        {
                        case '\'':
                        case '"':
-                               value->ll = ((unsigned char*)argp)[1];
-                               if(argp[2] && (argp[2] != argp[0] || argp[3]))
+                               w = argp + 1;
+                               if(mbwide() && mbsize(w) > 1)
+                                       value->ll = mbchar(w);
+                               else
+                                       value->ll = *(unsigned char*)w++;
+                               if(w[0] && (w[0] != argp[0] || w[1]))
                                {
                                        
errormsg(SH_DICT,ERROR_warn(0),e_charconst,argp);
                                        pp->err = 1;
--- old/usr/src/lib/libshell/common/bltins/read.c       Fri Sep 25 06:31:25 2009
+++ new/usr/src/lib/libshell/common/bltins/read.c       Fri Sep 25 06:31:23 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -28,7 +28,6 @@
 
 #include       <ast.h>
 #include       <error.h>
-#include       <ctype.h>
 #include       "defs.h"
 #include       "variables.h"
 #include       "lexstates.h"
@@ -68,9 +67,14 @@
        int save_prompt, fixargs=((Shbltin_t*)extra)->invariant;
        struct read_save *rp;
        static char default_prompt[3] = {ESC,ESC};
+       rp = (struct read_save*)(((Shbltin_t*)extra)->data);
        if(argc==0)
+       {
+               if(rp)
+                       free((void*)rp);
                return(0);
-       if(rp = (struct read_save*)(((Shbltin_t*)extra)->data))
+       }
+       if(rp)
        {
                flags = rp->flags;
                timeout = rp->timeout;
@@ -199,7 +203,7 @@
 
 int sh_readline(register Shell_t *shp,char **names, int fd, int flags,long 
timeout)
 {
-       register int            c;
+       register ssize_t        c;
        register unsigned char  *cp;
        register Namval_t       *np;
        register char           *name, *val;
@@ -217,7 +221,7 @@
        void                    *timeslot=0;
        int                     delim = '\n';
        int                     jmpval=0;
-       int                     size = 0;
+       ssize_t                 size = 0;
        int                     binary;
        struct  checkpt         buff;
        if(!(iop=shp->sftable[fd]) && !(iop=sh_iostream(shp,fd)))
@@ -225,9 +229,12 @@
        sh_stats(STAT_READS);
        if(names && (name = *names))
        {
+               Namval_t *mp;
                if(val= strchr(name,'?'))
                        *val = 0;
                np = nv_open(name,shp->var_tree,NV_NOASSIGN|NV_VARNAME);
+               if(np && nv_isarray(np) && (mp=nv_opensub(np)))
+                       np = mp;
                if((flags&V_FLAG) && shp->ed_context)
                        ((struct edit*)shp->ed_context)->e_default = np;
                if(flags&A_FLAG)
@@ -311,7 +318,7 @@
        }
        if(flags&(N_FLAG|NN_FLAG))
        {
-               char buf[64],*var=buf,*cur,*end,*up,*v;
+               char buf[256],*var=buf,*cur,*end,*up,*v;
                /* reserved buffer */
                if((c=size)>=sizeof(buf))
                {
@@ -331,22 +338,25 @@
                }
                else
                {
-                       int     f,m;
+                       ssize_t m;
+                       int     f;
                        for (;;)
                        {
                                c = (flags&NN_FLAG) ? -size : -1;
                                cp = sfreserve(iop,c,SF_LOCKR);
                                f = 1;
-                               if((m = sfvalue(iop)) > 0)
+                               if(cp)
+                                       m = sfvalue(iop);
+                               else
                                {
-                                       if(!cp)
-                                       {
-                                               m = (cp = 
sfreserve(iop,size,0)) ? sfvalue(iop) : 0;
-                                               f = 0;
-                                       }
-                                       if(m>0 && (flags&N_FLAG) && !binary && 
(v=memchr(cp,'\n',m)))
-                                               m = v-(char*)cp;
+                                       m = (cp = sfreserve(iop,size,0)) ? 
sfvalue(iop) : 0;
+                                       f = 0;
                                }
+                               if(m>0 && (flags&N_FLAG) && !binary && 
(v=memchr(cp,'\n',m)))
+                               {
+                                       *v++ = 0;
+                                       m = v-(char*)cp;
+                               }
                                if((c=m)>size)
                                        c = size;
                                if(c>0)
@@ -353,18 +363,18 @@
                                {
                                        if(c > (end-cur))
                                        {
-                                               int     cx = cur - var, ux = up 
- var;
+                                               ssize_t cx = cur - var, ux = up 
- var;
+                                               m = (end - var) + (c - (end - 
cur));
                                                if (var == buf)
                                                {
-                                                       m = (end - var) + (c - 
(end - cur));
                                                        v = (char*)malloc(m+1);
-                                                       memcpy(v, var, cur - 
var);
+                                                       var = memcpy(v, var, 
cur - var);
                                                }
                                                else
-                                                       v = newof(var, char, m, 
1);
-                                               end = v + m;
-                                               cur = v + cx;
-                                               up = v + ux;
+                                                       var = newof(var, char, 
m, 1);
+                                               end = var + m;
+                                               cur = var + cx;
+                                               up = var + ux;
                                        }
                                        memcpy((void*)cur,cp,c);
                                        if(f)
@@ -375,7 +385,6 @@
                                        {
                                                int     x;
                                                int     z;
-                                               int     y = cur - up;
 
                                                mbinit();
                                                *cur = 0;
@@ -402,16 +411,19 @@
                }
                if(timeslot)
                        timerdel(timeslot);
-               if(binary)
+               if(binary && !((size=nv_size(np)) && nv_isarray(np) && c!=size))
                {
-                       if(c==nv_size(np))
+                       if((c==size) && np->nvalue.cp && !nv_isarray(np))
                                memcpy((char*)np->nvalue.cp,var,c);
                        else
                        {
+                               Namval_t *mp;
                                if(var==buf)
                                        var = memdup(var,c);
                                nv_putval(np,var,NV_RAW);
                                nv_setsize(np,c);
+                               if(!nv_isattr(np,NV_IMPORT|NV_EXPORT)  && 
(mp=(Namval_t*)np->nvenv))
+                                       nv_setsize(mp,c);
                        }
                }
                else
--- /dev/null   Fri Sep 25 06:31:28 2009
+++ new/usr/src/lib/libshell/common/bltins/regress.c    Fri Sep 25 06:31:26 2009
@@ -0,0 +1,343 @@
+/***********************************************************************
+*                                                                      *
+*               This software is part of the ast package               *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
+*                      and is licensed under the                       *
+*                  Common Public License, Version 1.0                  *
+*                    by AT&T Intellectual Property                     *
+*                                                                      *
+*                A copy of the License is available at                 *
+*            http://www.opensource.org/licenses/cpl1.0.txt             *
+*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
+*                                                                      *
+*              Information and Software Systems Research               *
+*                            AT&T Research                             *
+*                           Florham Park NJ                            *
+*                                                                      *
+*                  David Korn <dgk at research.att.com>                   *
+*                                                                      *
+***********************************************************************/
+#pragma prototyped
+/*
+ * regression test intercept control
+ * enable with SHOPT_REGRESS==1 in Makefile
+ * not for production use
+ * see --man for details
+ * all string constants inline here instead of in data/...
+ *
+ *   David Korn
+ *   at&t research
+ */
+
+#include       "defs.h"
+
+#if SHOPT_REGRESS
+
+#include       <error.h>
+#include       <ls.h>
+#include       "io.h"
+#include       "builtins.h"
+#include       <tmx.h>
+
+#define REGRESS_HEADER "ksh:REGRESS:"
+
+#define TRACE(r,i,f)           sh_regress(REGRESS_##r, i, sfprints f, 
__LINE__, __FILE__)
+
+static const char      usage[] =
+"[-1p0?\n@(#)$Id: __regress__ (AT&T Research) 2009-03-29 $\n]"
+USAGE_LICENSE
+"[+NAME?__regress__ - shell regression test intercept control]"
+"[+DESCRIPTION?\b__regress__\b controls the regression test intercepts "
+    "for shells compiled with SHOPT_REGRESS==1. Shells compiled this way are "
+    "for testing only. In addition to \b__regress__\b and the \b--regress\b "
+    "command line option, these shells may contain system library function "
+    "intercepts that behave different from the native counterparts.]"
+"[+?Each option controls a different test and possibly a different set "
+    "of intercepts. The options are interpreted \bdd\b(1) style -- '-' or "
+    "'--' prefix not required. This simplifies the specification of the "
+    "command line \b--regress\b=\avalue\a option, where \avalue\a is passed "
+    "as an option to the \b__regress__\b builtin. Typically regression test "
+    "intercepts are enabled with one or more command line \b--regress\b "
+    "options, with optional specific calls to \b__regress__\b in test "
+    "scripts to enable/disable intercepts as the test progresses.]"
+"[+?Each enabled intercept may result in trace lines of the form \b" 
REGRESS_HEADER
+    "\aoption\a:\aintercept\a:\ainfo\a on the standard error, where "
+    "\aoption\a is one of the options below, \aintercept\a is the name of "
+    "the specific intercept for \aoption\a, and \ainfo\a is \aoption\a "
+    "specific information. Unless noted otherwise, one regression test trace "
+    "line is produced each time an enabled intercept is called.]"
+"[101:egid?The intercept effective gid is set to \aoriginal-egid\a. The "
+    "effective gid of the underlying system process is not affected. The "
+    "trace line info is either \begid==rgid\b or \begid!=rgid\b. The "
+    "intercepts are:]#?[original-egid:=1]"
+    "{"
+        "[+getegid()?The intercept effecive gid is returned. The "
+            "\bsetgid\b() intercept may change this between the real gid and "
+            "\aoriginal-egid\a.]"
+        "[+setgid(gid)?Sets the intercept effective gid to \agid\a. "
+            "Fails if \agid\a is neither the real gid nor "
+            "\aoriginal-egid\a.]"
+    "}"
+"[102:euid?The intercept effective uid is set to \aoriginal-euid\a. The "
+    "effective uid of the underlying system process is not affected. The "
+    "trace line info is either \beuid==ruid\b or \beuid!=ruid\b. The "
+    "intercepts are:]#?[original-euid:=1]"
+    "{"
+        "[+geteuid()?The intercept effecive uid is returned. The "
+            "\bsetuid\b() intercept may change this between the real uid and "
+            "\aoriginal-euid\a.]"
+        "[+setuid(uid)?Sets the intercept effective uid to \auid\a. "
+            "Fails if \auid\a is neither the real uid nor "
+            "\aoriginal-euid\a.]"
+    "}"
+"[103:p_suid?Specifies a value for SHOPT_P_SUID. Effective uids greater "
+    "than the non-privileged-uid disable the priveleged mode. The intercepts "
+    "are:]#?[non-privileged-uid:=1]"
+    "{"
+        "[+SHOPT_P_SUID?The SHOPT_P_SUID macro value is overridden by "
+            "\bp_suid\b. A trace line is output for each SHOPT_P_SUID "
+            "access.]"
+    "}"
+"[104:source?The intercepts are:]"
+    "{"
+        "[+sh_source()?The trace line info is the path of the script "
+            "being sourced. Used to trace shell startup scripts.]"
+    "}"
+"[105:etc?Map file paths matching \b/etc/\b* to \aetc-dir\a/*. The "
+    "intercepts are:]:[etc-dir:=/etc]"
+    "{"
+        "[+sh_open()?Paths matching \b/etc/\b* are changed to "
+            "\aetc-dir\a/*.]"
+    "}"
+"[+SEE ALSO?\bksh\b(1), \bregress\b(1), \brt\b(1)]"
+;
+
+static const char*     regress_options[] =
+{
+       "ERROR",
+       "egid",
+       "euid",
+       "p_suid",
+       "source",
+       "etc",
+};
+
+void sh_regress_init(Shell_t* shp)
+{
+       static Regress_t        state;
+
+       shp->regress = &state;
+}
+
+/*
+ * regress info trace output
+ */
+
+void sh_regress(unsigned int index, const char* intercept, const char* info, 
unsigned int line, const char* file)
+{
+       char*   name;
+       char    buf[16];
+
+       if (index >= 1 && index <= elementsof(regress_options))
+               name = (char*)regress_options[index];
+       else
+               sfsprintf(name = buf, sizeof(buf), "%u", index);
+       sfprintf(sfstderr, REGRESS_HEADER "%s:%s:%s\n", name, intercept, 
fmtesc(info));
+}
+
+/*
+ * egid intercepts
+ */
+
+static gid_t   intercept_sgid = 0;
+static gid_t   intercept_egid = -1;
+static gid_t   intercept_rgid = -1;
+
+gid_t getegid(void)
+{
+       if (intercept_rgid == -1)
+               intercept_rgid = getgid();
+       if (sh_isregress(REGRESS_egid))
+       {
+               TRACE(egid, "getegid", ("%s", intercept_egid == intercept_rgid 
? "egid==rgid" : "egid!=rgid"));
+               return intercept_egid;
+       }
+       return intercept_rgid;
+}
+
+int setgid(gid_t gid)
+{
+       if (intercept_rgid == -1)
+               intercept_rgid = getgid();
+       if (sh_isregress(REGRESS_egid))
+       {
+               if (gid != intercept_rgid && gid != intercept_sgid)
+               {
+                       TRACE(egid, "setgid", ("%s", "EPERM"));
+                       errno = EPERM;
+                       return -1;
+               }
+               intercept_egid = gid;
+               TRACE(egid, "setgid", ("%s", intercept_egid == intercept_rgid ? 
"egid==rgid" : "egid!=rgid"));
+       }
+       else if (gid != intercept_rgid)
+       {
+               errno = EPERM;
+               return -1;
+       }
+       return 0;
+}
+
+/*
+ * euid intercepts
+ */
+
+static uid_t   intercept_suid = 0;
+static uid_t   intercept_euid = -1;
+static uid_t   intercept_ruid = -1;
+
+uid_t geteuid(void)
+{
+       if (intercept_ruid == -1)
+               intercept_ruid = getuid();
+       if (sh_isregress(REGRESS_euid))
+       {
+               TRACE(euid, "geteuid", ("%s", intercept_euid == intercept_ruid 
? "euid==ruid" : "euid!=ruid"));
+               return intercept_euid;
+       }
+       return intercept_ruid;
+}
+
+int setuid(uid_t uid)
+{
+       if (intercept_ruid == -1)
+               intercept_ruid = getuid();
+       if (sh_isregress(REGRESS_euid))
+       {
+               if (uid != intercept_ruid && uid != intercept_suid)
+               {
+                       TRACE(euid, "setuid", ("%s", "EPERM"));
+                       errno = EPERM;
+                       return -1;
+               }
+               intercept_euid = uid;
+               TRACE(euid, "setuid", ("%s", intercept_euid == intercept_ruid ? 
"euid==ruid" : "euid!=ruid"));
+       }
+       else if (uid != intercept_ruid)
+       {
+               errno = EPERM;
+               return -1;
+       }
+       return 0;
+}
+
+/*
+ * p_suid intercept
+ */
+
+static uid_t   intercept_p_suid = 0x7fffffff;
+
+uid_t sh_regress_p_suid(unsigned int line, const char* file)
+{
+       REGRESS(p_suid, "SHOPT_P_SUID", ("%d", intercept_p_suid));
+       return intercept_p_suid;
+}
+
+/*
+ * p_suid intercept
+ */
+
+static char*   intercept_etc = 0;
+
+char* sh_regress_etc(const char* path, unsigned int line, const char* file)
+{
+       REGRESS(etc, "sh_open", ("%s => %s%s", path, intercept_etc, path+4));
+       return intercept_etc;
+}
+
+/*
+ * __regress__ builtin
+ */
+
+int b___regress__(int argc, char** argv, void *extra)
+{
+       register Shell_t*       shp = ((Shbltin_t*)extra)->shp;
+       int                     n;
+
+       for (;;)
+       {
+               switch (n = optget(argv, usage))
+               {
+               case '?':
+                       errormsg(SH_DICT, ERROR_usage(2), "%s", opt_info.arg);
+                       break;
+               case ':':
+                       errormsg(SH_DICT, 2, "%s", opt_info.arg);
+                       break;
+               case 0:
+                       break;
+               default:
+                       if (n < -100)
+                       {
+                               n = -(n + 100);
+                               if (opt_info.arg || opt_info.number)
+                                       sh_onregress(n);
+                               else
+                                       sh_offregress(n);
+                               switch (n)
+                               {
+                               case REGRESS_egid:
+                                       if (sh_isregress(n))
+                                       {
+                                               intercept_egid = intercept_sgid 
= (gid_t)opt_info.number;
+                                               TRACE(egid, argv[0], ("%d", 
intercept_egid));
+                                       }
+                                       else
+                                               TRACE(egid, argv[0], ("%s", 
"off"));
+                                       break;
+                               case REGRESS_euid:
+                                       if (sh_isregress(n))
+                                       {
+                                               intercept_euid = intercept_suid 
= (uid_t)opt_info.number;
+                                               TRACE(euid, argv[0], ("%d", 
intercept_euid));
+                                       }
+                                       else
+                                               TRACE(euid, argv[0], ("%s", 
"off"));
+                                       break;
+                               case REGRESS_p_suid:
+                                       if (sh_isregress(n))
+                                       {
+                                               intercept_p_suid = 
(uid_t)opt_info.number;
+                                               TRACE(p_suid, argv[0], ("%d", 
intercept_p_suid));
+                                       }
+                                       else
+                                               TRACE(p_suid, argv[0], ("%s", 
"off"));
+                                       break;
+                               case REGRESS_source:
+                                       TRACE(source, argv[0], ("%s", 
sh_isregress(n) ? "on" : "off"));
+                                       break;
+                               case REGRESS_etc:
+                                       if (sh_isregress(n))
+                                       {
+                                               intercept_etc = opt_info.arg;
+                                               TRACE(etc, argv[0], ("%s", 
intercept_etc));
+                                       }
+                                       else
+                                               TRACE(etc, argv[0], ("%s", 
"off"));
+                                       break;
+                               }
+                       }
+                       continue;
+               }
+               break;
+       }
+       if (error_info.errors || *(argv + opt_info.index))
+               errormsg(SH_DICT, ERROR_usage(2), "%s", optusage(NiL));
+       return 0;
+}
+
+#else
+
+NoN(regress)
+
+#endif
--- old/usr/src/lib/libshell/common/bltins/shiocmd_solaris.c    Fri Sep 25 
06:31:30 2009
+++ new/usr/src/lib/libshell/common/bltins/shiocmd_solaris.c    Fri Sep 25 
06:31:28 2009
@@ -857,330 +857,7 @@
        return(0);
 }
 
-static const char sh_optpoll[] =
-"[-?\n@(#)$Id: poll (AT&T Labs Research) 2007-12-20 $\n]"
-"[-author?Roland Mainz <roland.mainz at nrubsig.org]"
-"[-license?http://www.opensource.org/licenses/cpl1.0.txt]";
-"[+NAME? poll - input/output multiplexing]"
-"[+DESCRIPTION?The poll command provides applications with a mechanism "
-       "for multiplexing input/output over a set of file descriptors. "
-       "For each member of the array variable \bvar\b, "
-       "poll examines the given file descriptor in the subscript \b.fd\b "
-       "for the event(s) specified in the subscript \b.events\b."
-       "The poll command identifies those file descriptors on which an "
-       "application can read or write data, or on which certain events have "
-       "occurred.]"
-"[+?The \bvar\b argument specifies the file descriptors to be examined "
-       "and the events of interest for each file descriptor. "
-       "It is a array of structured variables with one member for each open "
-       "file descriptor of interest. The array's members contain the following 
"
-       "subscripts:]{"
-               "[+?\b.fd\b       # file descriptor]"
-               "[+?\b.events\b   # requested events]"
-               "[+?\b.revents\b  # returned event]"
-       "}"
-"[+?The \bfd\b variable specifies an open file descriptor and the "
-       "\bevents\b and \brevents\b members are strings constructed from "
-       "a concaternation of the following event flags, seperated by '|':]"
-       "{ "
-       "[+POLLIN?Data other than high priority data may be "
-               "read without blocking. For STREAMS, this "
-               "flag is set in revents even if the message "
-               "is of zero length.]"
-       "[+POLLRDNORM?Normal data (priority band equals 0) may be "
-               "read without blocking. For STREAMS, this "
-               "flag is set in revents even if the message "
-               "is of zero length.]"
-       "[+POLLRDBAND?Data from a non-zero priority band may be "
-               "read without blocking. For STREAMS, this "
-               "flag is set in revents even if the message "
-               "is of zero length.]"
-       "[+POLLPRI?High priority data may be received without "
-               "blocking. For STREAMS, this flag is set in "
-               "revents even if the message is of zero "
-               "length.]"
-       "[+POLLOUT?Normal data (priority band equals 0) may be "
-               "written without blocking.]"
-       "[+POLLWRNORM?The same as POLLOUT.]"
-       "[+POLLWRBAND?Priority data (priority band > 0) may be "
-               "written.  This event only examines bands "
-               "that have been written to at least once.]"
-       "[+POLLERR?An error has occurred on the device or "
-               "stream.  This flag is only valid in the "
-               "revents bitmask; it is not used in the "
-               "events member.]"
-       "[+POLLHUP?A hangup has occurred on the stream. This "
-               "event and POLLOUT are mutually exclusive; a "
-               "stream can never be writable if a hangup has "
-               "occurred. However, this event and POLLIN, "
-               ", POLLRDBAND, or POLLPRI are not "
-               "mutually exclusive. This flag is only valid "
-               "in the revents bitmask; it is not used in "
-               "the events member.]"
-       "[+POLLNVAL?The specified fd value does not belong to an "
-               "open file. This flag is only valid in the "
-               "revents member; it is not used in the events "
-               "member.]"
-   "}"
-"]"
 
-"[+?If the value fd is less than 0, events is ignored and "
-       "revents is set to 0 in that entry on return from poll.]"
-
-"[+?The results of the poll query are stored in the revents "
-       "member in the \bvar\b structure. POLL*-strings are set in the 
\brevents\b "
-       "variable to indicate which of the requested events are true. "
-       "If none are true, the \brevents\b will be an empty string when "
-       "the poll command returns. The event flags "
-       "POLLHUP, POLLERR, and POLLNVAL are always set in \brevents\b "
-       "if the conditions they indicate are true; this occurs even "
-       "though these flags were not present in events.]"
-
-"[+?If none of the defined events have occurred on any selected "
-       "file descriptor, poll waits at least timeout milliseconds "
-       "for an event to occur on any of the selected file descriptors. "
-       "On a computer where millisecond timing accuracy is not "
-       "available, timeout is rounded up to the nearest legal value "
-       "available on that system. If the value timeout is 0, poll "
-       "returns immediately. If the value of timeout is -1, poll "
-       "blocks until a requested event occurs or until the call is "
-       "interrupted.]"
-
-"[+?The poll function supports regular files, terminal and "
-       "pseudo-terminal devices, STREAMS-based files, FIFOs and "
-       "pipes. The behavior of poll on elements of fds that refer "
-       "to other types of file is unspecified.]"
-
-"[+?The poll function supports sockets.]"
-
-"[+?A file descriptor for a socket that is listening for connections "
-       "will indicate that it is ready for reading, once connections "
-       "are available. A file descriptor for a socket that "
-       "is connecting asynchronously will indicate that it is ready "
-       "for writing, once a connection has been established.]"
- 
-"[+?Regular files always poll TRUE for reading and writing.]"
-
-"[c:fdcount]:[fdcount?Upon successful completion, a non-negative value is "
-       "returned. A positive value indicates the total number of "
-       "file descriptors that has been selected (that is, file "
-       "descriptors for which the revents member is non-zero). A "
-       "value of 0 indicates that the call timed out and no file "
-       "descriptors have been selected. Upon failure, -1 is returned.]"
-"[t:timeout]:[seconds?Timeout in seconds. If the value timeout is 0, "
-       "poll returns immediately. If the value of timeout is -1, poll "
-       "blocks until a requested event occurs or until the call is "
-       "interrupted.]"
-"[T:mtimeout]:[milliseconds?Timeout in milliseconds. If the value timeout is 
0, "
-       "poll returns immediately. If the value of timeout is -1, poll "
-       "blocks until a requested event occurs or until the call is "
-       "interrupted.]"
-"\n"
-"\nvar\n"
-"\n"
-"[+EXIT STATUS?]{"
-        "[+0?Success.]"
-        "[+>0?An error occurred.]"
-"}"
-"[+SEE ALSO?\bopen\b(1),\btmpfile\b(1),\bdup\b(1),\bclose\b(1),\bpoll\b(2)]"
-;
-
-/*
- * |mystpcpy| - like |strcpy()| but returns the end of the buffer
- *
- * Copy string s2 to s1.  s1 must be large enough.
- * return s1-1 (position of string terminator ('\0') in destnation buffer).
- */
-static
-char *mystpcpy(char *s1, const char *s2)
-{
-        while (*s1++ = *s2++)
-                ;
-        return (s1-1);
-}
-
-static
-Namval_t *nv_open_fmt(Dt_t *dict, int flags, const char *namefmt, ...)
-{
-       char    varnamebuff[PATH_MAX];
-       va_list ap;
-
-       va_start(ap, namefmt);
-       vsnprintf(varnamebuff, sizeof(varnamebuff), namefmt, ap);
-       va_end(ap);
-       
-       return nv_open(varnamebuff, dict, flags);
-}
-
-static
-int poll_strtoevents(const char *str)
-{
-       int events = 0;
-    
-       if (strstr(str, "POLLIN"))     events |= POLLIN;
-       if (strstr(str, "POLLRDNORM")) events |= POLLRDNORM;
-       if (strstr(str, "POLLRDBAND")) events |= POLLRDBAND;
-       if (strstr(str, "POLLPRI"))    events |= POLLPRI;
-       if (strstr(str, "POLLOUT"))    events |= POLLOUT;
-       if (strstr(str, "POLLWRNORM")) events |= POLLWRNORM;
-       if (strstr(str, "POLLWRBAND")) events |= POLLWRBAND;
-       if (strstr(str, "POLLERR"))    events |= POLLERR;
-       if (strstr(str, "POLLHUP"))    events |= POLLHUP;
-       if (strstr(str, "POLLNVAL"))   events |= POLLNVAL;
-
-       return events;
-}
-
-
-static
-void poll_eventstostr(char *s, int events)
-{
-       *s='\0';
-       if (!events)
-               return;
-       
-       if (events & POLLIN)            s=mystpcpy(s, "POLLIN|");
-       if (events & POLLRDNORM)        s=mystpcpy(s, "POLLRDNORM|");
-       if (events & POLLRDBAND)        s=mystpcpy(s, "POLLRDBAND|");
-       if (events & POLLPRI)           s=mystpcpy(s, "POLLPRI|");
-       if (events & POLLOUT)           s=mystpcpy(s, "POLLOUT|");
-       if (events & POLLWRNORM)        s=mystpcpy(s, "POLLWRNORM|");
-       if (events & POLLWRBAND)        s=mystpcpy(s, "POLLWRBAND|");
-       if (events & POLLERR)           s=mystpcpy(s, "POLLERR|");
-       if (events & POLLHUP)           s=mystpcpy(s, "POLLHUP|");
-       if (events & POLLNVAL)          s=mystpcpy(s, "POLLNVAL|");
-
-       /* Remove trailling '|' */
-       s--;
-       if(*s=='|')
-               *s='\0';
-}
-
-#undef  getconf
-#define getconf(x)      strtol(astconf(x,NiL,NiL),NiL,0)
-               
-extern int b_poll(int argc, char *argv[], void *extra)
-{
-       register Namval_t *np;
-       register int n;
-       Shell_t *shp = sh_contexttoshell(extra);
-       char *varname;
-       int fd;
-       unsigned int numpollfd = 0;
-       int i;
-       char *s;
-       double timeout = -1.;
-       char buff[256];
-       char *pollfdcountvarname = NULL;
-       long open_max,
-            bpoll_max;
-
-       if ((open_max = getconf("OPEN_MAX")) <= 0)
-               open_max = OPEN_MAX;
-       /* |bpoll_max| needs to be larger than |OPEN_MAX| to make sure we
-        * can listen to different sets of events per fd.
-        */
-       bpoll_max = open_max*2L;
-
-       while (n = optget(argv, sh_optpoll)) switch (n)
-       {
-           case 't':
-           case 'T':
-               errno = 0;
-               timeout = strtod(opt_info.arg, (char **)NULL);  
-               if (errno != 0)
-                       errormsg(SH_DICT, ERROR_system(1), "%s: invalid 
timeout", opt_info.arg);
-
-               /* -t uses seconds, -T milliseconds */
-               if (n == 't')
-                       timeout *= 1000.;
-               break;
-           case 'c':
-               pollfdcountvarname = opt_info.arg;
-               break;
-           case ':':
-               errormsg(SH_DICT, 2, "%s", opt_info.arg);
-               break;
-           case '?':
-               errormsg(SH_DICT, ERROR_usage(2), "%s", opt_info.arg);
-               break;
-       }
-       argc -= opt_info.index;
-       argv += opt_info.index;
-       if(argc!=1)
-               errormsg(SH_DICT, ERROR_usage(2), optusage((char*)0));
-
-        varname = argv[0];
-
-#ifdef __GNUC__
-        /*
-         * Allocate one extra array entry to keep ctfconvert+gcc builds
-         * happy until CR #6379193 is fixed.
-         */
-       struct pollfd pollfd[bpoll_max+1];
-#else
-       struct pollfd pollfd[bpoll_max];
-#endif
-       for(i=0 ; i < bpoll_max ; i++)
-       {       
-               np = nv_open_fmt(shp->var_tree, NV_VARNAME|NV_NOFAIL|NV_NOADD, 
"%s[%d].fd", varname, i);
-               if (!np)
-                       break;
-               fd = (int)nv_getnum(np);
-               if (fd < 0 || fd > OPEN_MAX)
-                       errormsg(SH_DICT, ERROR_system(1), "invalid pollfd fd");
-               nv_close(np);
-               pollfd[i].fd = fd;
-
-               np = nv_open_fmt(shp->var_tree, NV_VARNAME|NV_NOFAIL|NV_NOADD, 
"%s[%d].events", varname, i);
-               if (!np)
-                       errormsg(SH_DICT, ERROR_system(1), "missing pollfd 
events");
-
-               s = nv_getval(np);
-               if (!s)
-                       errormsg(SH_DICT, ERROR_system(1), "missing pollfd 
events value");
-               pollfd[i].events  = poll_strtoevents(s);
-               nv_close(np);
-
-               pollfd[i].revents = 0;
-                       
-               numpollfd++;
-        }
-       
-       if (i == bpoll_max)
-               errormsg(SH_DICT, ERROR_system(1), "cannot handle more than %d 
entries.", bpoll_max);
-
-       n = poll(pollfd, numpollfd, timeout);
-       /* FixMe: EGAIN and EINTR may require extra handling */
-       if (n < 0)
-               errormsg(SH_DICT, ERROR_system(1), "failure");
-
-       if (pollfdcountvarname)
-       {
-               int32_t v = n;
-
-               np = nv_open_fmt(shp->var_tree, NV_VARNAME|NV_NOFAIL, "%s", 
pollfdcountvarname);
-               if (!np)
-                       errormsg(SH_DICT, ERROR_system(1), "couldn't create 
poll count variable %s", pollfdcountvarname);
-               nv_putval(np, (char *)&v, NV_INTEGER);
-               nv_close(np);
-       }
-
-       for(i=0 ; i < numpollfd ; i++)
-       {       
-               np = nv_open_fmt(shp->var_tree, NV_VARNAME|NV_NOFAIL, 
"%s[%d].revents", varname, i);
-               if (!np)
-                       errormsg(SH_DICT, ERROR_system(1), "couldn't create 
pollfd %s[%d].revents", varname, i);
-
-               poll_eventstostr(buff, pollfd[i].revents);
-       
-               nv_putval(np, buff, 0);
-               nv_close(np);
-        }
-       
-       return(0);
-}
-
 static const char sh_optrewind[] =
 "[-?\n@(#)$Id: rewind (AT&T Labs Research) 2007-05-07 $\n]"
 "[-author?Roland Mainz <roland.mainz at nrubsig.org>]"
--- old/usr/src/lib/libshell/common/bltins/sleep.c      Fri Sep 25 06:31:33 2009
+++ new/usr/src/lib/libshell/common/bltins/sleep.c      Fri Sep 25 06:31:32 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -31,6 +31,7 @@
 #undef sleep
 #include       <error.h>
 #include       <errno.h>
+#include       <tmx.h>
 #include       "builtins.h"
 #include       "FEATURE/time"
 #include       "FEATURE/poll"
@@ -44,8 +45,9 @@
 int    b_sleep(register int argc,char *argv[],void *extra)
 {
        register char *cp;
-       register double d;
+       register double d=0;
        register Shell_t *shp = ((Shbltin_t*)extra)->shp;
+       int sflag=0;
        time_t tloc = 0;
        char *last;
        if(!(shp->sigflag[SIGALRM]&(SH_SIGFAULT|SH_SIGOFF)))
@@ -52,6 +54,9 @@
                sh_sigtrap(SIGALRM);
        while((argc = optget(argv,sh_optsleep))) switch(argc)
        {
+               case 's':
+                       sflag=1;
+                       break;
                case ':':
                        errormsg(SH_DICT,2, "%s", opt_info.arg);
                        break;
@@ -60,20 +65,47 @@
                        break;
        }
        argv += opt_info.index;
-       if(error_info.errors || !(cp= *argv) || ((d=strtod(cp, 
(char**)&last)),*last))
-               errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0));
+       if(cp = *argv)
+       {
+               d = strtod(cp, &last);
+               if(*last)
+               {
+                       Time_t now,ns;
+                       char* pp;
+                       now = TMX_NOW;
+                       if(*cp == 'P' || *cp == 'p')
+                               ns = tmxdate(cp, &last, now);
+                       else
+                       {
+                               if(pp = sfprints("exact %s", cp))
+                                       ns = tmxdate(pp, &last, now);
+                               if(*last && (pp = sfprints("p%s", cp)))
+                                       ns = tmxdate(pp, &last, now);
+                       }
+                       if(*last)
+                               errormsg(SH_DICT,ERROR_exit(1),e_number,*argv);
+                       d = ns - now;
+                       d /= TMX_RESOLUTION;
+               }
+               if(argv[1])
+                       errormsg(SH_DICT,ERROR_exit(1),e_oneoperand);
+       }
+       else if(!sflag)
+               errormsg(SH_DICT,ERROR_exit(1),e_oneoperand);
        if(d > .10)
        {
                time(&tloc);
                tloc += (time_t)(d+.5);
        }
-       while(1)
+       if(sflag && d==0)
+               pause();
+       else while(1)
        {
                time_t now;
                errno = 0;
                shp->lastsig=0;
                sh_delay(d);
-               if(tloc==0 || errno!=EINTR || shp->lastsig)
+               if(sflag || tloc==0 || errno!=EINTR || shp->lastsig)
                        break;
                sh_sigcheck();
                if(tloc < (now=time(NIL(time_t*))))
--- old/usr/src/lib/libshell/common/bltins/test.c       Fri Sep 25 06:31:36 2009
+++ new/usr/src/lib/libshell/common/bltins/test.c       Fri Sep 25 06:31:34 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -29,7 +29,6 @@
 
 
 #include       "defs.h"
-#include       <ctype.h>
 #include       <error.h>
 #include       <ls.h>
 #include       "io.h"
@@ -267,8 +266,11 @@
                goto skip;
        if(c2_eq(arg,'-','t'))
        {
-               if(cp && isdigit(*cp))
-                        return(*(cp+1)?0:tty_check(*cp-'0'));
+               if(cp)
+               {
+                       op = strtol(cp,&binop, 10);
+                       return(*binop?0:tty_check(op));
+               }
                else
                {
                /* test -t with no arguments */
@@ -300,7 +302,7 @@
                cp = nxtarg(tp,0);
        if(!op)
                errormsg(SH_DICT,ERROR_exit(2),e_badop,binop);
-       if(op==TEST_AND | op==TEST_OR)
+       if(op==TEST_AND || op==TEST_OR)
                tp->ap--;
        return(test_binop(op,arg,cp));
 }
@@ -415,9 +417,34 @@
                op = sh_lookopt(arg,&f);
                return(op && (f==(sh_isoption(op)!=0)));
            case 't':
-               if(isdigit(*arg) && arg[1]==0)
-                        return(tty_check(*arg-'0'));
-               return(0);
+           {
+               char *last;
+               op = strtol(arg,&last, 10);
+               return(*last?0:tty_check(op));
+           }
+           case 'v':
+           case 'R':
+           {
+               Namval_t *np;
+               Namarr_t *ap;
+               int isref;
+               if(!(np = 
nv_open(arg,sh.var_tree,NV_VARNAME|NV_NOFAIL|NV_NOADD|NV_NOREF)))
+                       return(0);
+               isref = nv_isref(np);
+               if(op=='R')
+                       return(isref);
+               if(isref)
+               {
+                       if(np->nvalue.cp)
+                               np = nv_refnode(np);
+                       else
+                               return(0);
+                       
+               }
+               if(ap = nv_arrayptr(np))
+                       return(nv_arrayisset(np,ap));
+               return(!nv_isnull(np) || nv_isattr(np,NV_INTEGER));
+           }
            default:
            {
                static char a[3] = "-?";
--- old/usr/src/lib/libshell/common/bltins/trap.c       Fri Sep 25 06:31:39 2009
+++ new/usr/src/lib/libshell/common/bltins/trap.c       Fri Sep 25 06:31:37 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -30,7 +30,6 @@
  */
 
 #include       "defs.h"
-#include       <ctype.h>
 #include       "jobs.h"
 #include       "builtins.h"
 
@@ -150,10 +149,11 @@
                        {
                                if(sig >= shp->st.trapmax)
                                        shp->st.trapmax = sig+1;
-                               if(arg=shp->st.trapcom[sig])
-                                       free(arg);
-                               shp->st.trapcom[sig] = strdup(action);
+                               arg = shp->st.trapcom[sig];
                                sh_sigtrap(sig);
+                               shp->st.trapcom[sig] = 
(shp->sigflag[sig]&SH_SIGOFF) ? Empty : strdup(action);
+                               if(arg && arg != Empty)
+                                       free(arg);
                        }
                }
        }
@@ -260,6 +260,12 @@
                {
                        sig = 1;
                        o += 3;
+                       if(isdigit(*stakptr(o)))
+                       {
+                               n = strtol(stakptr(o),&last,10);
+                               if(!*last)
+                                       return(n);
+                       }
                }
                tp = sh_locate(stakptr(o),(const 
Shtable_t*)shtab_signals,sizeof(*shtab_signals));
                n = tp->sh_number;
@@ -279,7 +285,7 @@
                        if(n < SH_TRAP)
                                n--;
                }
-               if(n<0 && (name=stakptr(o)) && *name++=='R' && *name++=='T')
+               if(n<0 && sh.sigruntime[1] && (name=stakptr(o)) && *name++=='R' 
&& *name++=='T')
                {
                        if(name[0]=='M' && name[1]=='I' && name[2]=='N' && 
name[3]=='+')
                        {
@@ -348,7 +354,7 @@
 static void sig_list(register Shell_t *shp,register int flag)
 {
        register const struct shtable2  *tp;
-       register int sig = shp->sigmax+1;
+       register int sig;
        register char *sname;
        char name[10];
        const char *names[SH_TRAP];
@@ -357,16 +363,16 @@
        if(flag<=0)
        {
                /* not all signals may be defined, so initialize */
-               while(--sig >= 0)
+               for(sig=shp->sigmax; sig>=0; sig--)
                        names[sig] = 0;
                for(sig=SH_DEBUGTRAP; sig>=0; sig--)
                        traps[sig] = 0;
        }
-       while(*tp->sh_name)
+       for(; *tp->sh_name; tp++)
        {
                sig = tp->sh_number&((1<<SH_SIGBITS)-1);
-               if ((tp->sh_number>>SH_SIGBITS) & SH_SIGRUNTIME)
-                       sig = sh.sigruntime[sig-1]+1;
+               if (((tp->sh_number>>SH_SIGBITS) & SH_SIGRUNTIME) && (sig = 
sh.sigruntime[sig-1]+1) == 1)
+                       continue;
                if(sig==flag)
                {
                        sfprintf(sfstdout,"%s\n",tp->sh_name);
@@ -374,9 +380,8 @@
                }
                else if(sig&SH_TRAP)
                        traps[sig&~SH_TRAP] = (char*)tp->sh_name;
-               else if(sig < sizeof(names)/sizeof(char*))
+               else if(sig-- && sig < elementsof(names))
                        names[sig] = (char*)tp->sh_name;
-               tp++;
        }
        if(flag > 0)
                sfputr(sfstdout, sig_name(flag-1,name,0), '\n');
@@ -391,7 +396,7 @@
                {
                        if(!(trap=trapcom[sig]))
                                continue;
-                       if(!(sname=(char*)names[sig+1]))
+                       if(sig > shp->sigmax || !(sname=(char*)names[sig]))
                                sname = sig_name(sig,name,1);
                        sfprintf(sfstdout,trapfmt,sh_fmtq(trap),sname);
                }
@@ -405,9 +410,9 @@
        else
        {
                /* print all the signal names */
-               for(sig=2; sig <= shp->sigmax; sig++)
+               for(sig=1; sig <= shp->sigmax; sig++)
                {
-                       if(!(sname=(char*)names[sig+1]))
+                       if(!(sname=(char*)names[sig]))
                                sname = sig_name(sig,name,1);
                        sfputr(sfstdout,sname,'\n');
                }
--- old/usr/src/lib/libshell/common/bltins/typeset.c    Fri Sep 25 06:31:42 2009
+++ new/usr/src/lib/libshell/common/bltins/typeset.c    Fri Sep 25 06:31:40 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -248,7 +248,7 @@
                        case 'F':
                        case 'X':
                                if(!opt_info.arg || (tdata.argnum = 
opt_info.num) <0)
-                                       tdata.argnum = 10;
+                                       tdata.argnum = 
(n=='X'?2*sizeof(Sfdouble_t):10);
                                isfloat = 1;
                                if(n=='E')
                                {
@@ -389,6 +389,8 @@
                stkseek(stkp,offset);
                if(!tdata.tp)
                        errormsg(SH_DICT,ERROR_exit(1),"%s: unknown 
type",tdata.prefix);
+               else if(nv_isnull(tdata.tp))
+                       nv_newtype(tdata.tp);
                tdata.tp->nvenv = tdata.help;
                flag &= ~NV_TYPE;
        }
@@ -402,11 +404,16 @@
 static void print_value(Sfio_t *iop, Namval_t *np, struct tdata *tp)
 {
        char     *name;
+       int     aflag=tp->aflag;
        if(nv_isnull(np))
+       {
+               if(!np->nvflag)
+                       return;
+               aflag = '+';
+       }
+       sfputr(iop,nv_name(np),aflag=='+'?'\n':'=');
+       if(aflag=='+')
                return;
-       sfputr(iop,nv_name(np),tp->aflag=='+'?'\n':'=');
-       if(tp->aflag=='+')
-               return;
        if(nv_isarray(np) && nv_arrayptr(np))
        {
                nv_outnode(np,iop,-1,0);
@@ -478,7 +485,7 @@
                                                
print_namval(sfstdout,np,tp->aflag=='+',tp);
                                                continue;
                                        }
-                                       if(shp->subshell)
+                                       if(shp->subshell && !shp->subshare)
                                                sh_subfork();
                                        if(tp->aflag=='-')
                                                nv_onattr(np,flag|NV_FUNCTION);
@@ -539,12 +546,18 @@
                                {
                                        if(comvar)
                                        {
-                                               _nv_unset(np,NV_RDONLY);
-                                               nv_onattr(np,NV_NOFREE);
+                                               Namarr_t *ap=nv_arrayptr(np);
+                                               if(ap)
+                                                       ap->nelem |= ARRAY_TREE;
+                                               else
+                                               {
+                                                       _nv_unset(np,NV_RDONLY);
+                                                       nv_onattr(np,NV_NOFREE);
+                                               }
                                        }
                                        nv_setarray(np,nv_associative);
                                }
-                               else if(comvar && !nv_rename(np,flag|NV_COMVAR))
+                               else if(comvar && !nv_isvtree(np) && 
!nv_rename(np,flag|NV_COMVAR))
                                        nv_setvtree(np);
                        }
                        if(flag&NV_MOVE)
@@ -553,7 +566,7 @@
                                nv_close(np);
                                continue;
                        }
-                       if(tp->tp)
+                       if(tp->tp && nv_type(np)!=tp->tp)
                        {
                                
nv_settype(np,tp->tp,tp->aflag=='-'?0:NV_APPEND);
                                flag = (np->nvflag&NV_NOCHANGE);
@@ -562,9 +575,11 @@
                        flag &= ~NV_ASSIGN;
                        if(last=strchr(name,'='))
                                *last = 0;
+                       if (shp->typeinit)
+                               continue;
                        if (tp->aflag == '-')
                        {
-                               if((flag&NV_EXPORT) && strchr(name,'.'))
+                               if((flag&NV_EXPORT) && (strchr(name,'.') || 
nv_isvtree(np)))
                                        
errormsg(SH_DICT,ERROR_exit(1),e_badexport,name);
 #if SHOPT_BSH
                                if(flag&NV_EXPORT)
@@ -769,6 +784,8 @@
        memset(&tdata,0,sizeof(tdata));
        tdata.sh = ((Shbltin_t*)extra)->shp;
        stkp = tdata.sh->stk;
+       if(!tdata.sh->pathlist)
+               path_absolute(argv[0],NIL(Pathcomp_t*));
        while (n = optget(argv,sh_optbuiltin)) switch (n)
        {
            case 's':
@@ -801,7 +818,7 @@
                        
errormsg(SH_DICT,ERROR_exit(1),e_restricted,argv[-opt_info.index]);
                if(sh_isoption(SH_PFSH))
                        
errormsg(SH_DICT,ERROR_exit(1),e_pfsh,argv[-opt_info.index]);
-               if(tdata.sh->subshell)
+               if(tdata.sh->subshell && !tdata.sh->subshare)
                        sh_subfork();
        }
 #if SHOPT_DYNAMIC
@@ -922,7 +939,8 @@
        register const char *name;
        register int r;
        Dt_t    *dp;
-       int nflag=0,all=0,isfun;
+       int nflag=0,all=0,isfun,jmpval;
+       struct checkpt buff;
        NOT_USED(argc);
        if(troot==shp->alias_tree)
        {
@@ -963,13 +981,28 @@
        else
                nflag = NV_NOSCOPE;
        if(all)
+       {
                dtclear(troot);
-       else while(name = *argv++)
+               return(r);
+       }
+       sh_pushcontext(&buff,1);
+       while(name = *argv++)
        {
-               if(np=nv_open(name,troot,NV_NOADD|NV_NOFAIL|nflag))
+               jmpval = sigsetjmp(buff.buff,0);
+               np = 0;
+               if(jmpval==0)
+                       np=nv_open(name,troot,NV_NOADD|nflag);
+               else
                {
-                       if(is_abuiltin(np))
+                       r = 1;
+                       continue;
+               }
+               if(np)
+               {
+                       if(is_abuiltin(np) || nv_isattr(np,NV_RDONLY))
                        {
+                               if(nv_isattr(np,NV_RDONLY))
+                                       
errormsg(SH_DICT,ERROR_warn(0),e_readonly, nv_name(np));
                                r = 1;
                                continue;
                        }
@@ -985,7 +1018,8 @@
                                if(shp->subshell)
                                        np=sh_assignok(np,0);
                        }
-                       nv_unset(np);
+                       if(!nv_isnull(np))
+                               nv_unset(np);
                        nv_close(np);
                        if(troot==shp->var_tree && shp->st.real_fun && 
(dp=shp->var_tree->walk) && dp==shp->st.real_fun->sdict)
                                nv_delete(np,dp,NV_NOFREE);
@@ -992,9 +1026,8 @@
                        else if(isfun)
                                nv_delete(np,troot,NV_NOFREE);
                }
-               else
-                       r = 1;
        }
+       sh_popcontext(&buff);
        return(r);
 }
 
--- old/usr/src/lib/libshell/common/bltins/ulimit.c     Fri Sep 25 06:31:45 2009
+++ new/usr/src/lib/libshell/common/bltins/ulimit.c     Fri Sep 25 06:31:43 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -29,7 +29,7 @@
 #include       <ast.h>
 #include       <sfio.h>
 #include       <error.h>
-#include       <shell.h>
+#include       "defs.h"
 #include       "builtins.h"
 #include       "name.h"
 #include       "ulimit.h"
@@ -132,7 +132,7 @@
                unit = shtab_units[tp->type];
                if(limit)
                {
-                       if(shp->subshell)
+                       if(shp->subshell && !shp->subshare)
                                sh_subfork();
                        if(strcmp(limit,e_unlimited)==0)
                                i = INFINITY;
--- old/usr/src/lib/libshell/common/bltins/umask.c      Fri Sep 25 06:31:48 2009
+++ new/usr/src/lib/libshell/common/bltins/umask.c      Fri Sep 25 06:31:46 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/bltins/whence.c     Fri Sep 25 06:31:51 2009
+++ new/usr/src/lib/libshell/common/bltins/whence.c     Fri Sep 25 06:31:49 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/data/aliases.c      Fri Sep 25 06:31:54 2009
+++ new/usr/src/lib/libshell/common/data/aliases.c      Fri Sep 25 06:31:52 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -36,6 +36,7 @@
 #endif /* SHOPT_FS_3D */
        "autoload",     NV_NOFREE,      "typeset -fu",
        "command",      NV_NOFREE,      "command ",
+       "compound",     NV_NOFREE,      "typeset -C",
        "fc",           NV_NOFREE,      "hist",
        "float",        NV_NOFREE,      "typeset -lE",
        "functions",    NV_NOFREE,      "typeset -f",
--- old/usr/src/lib/libshell/common/data/bash_pre_rc.sh Fri Sep 25 06:31:57 2009
+++ new/usr/src/lib/libshell/common/data/bash_pre_rc.sh Fri Sep 25 06:31:55 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
--- old/usr/src/lib/libshell/common/data/builtins.c     Fri Sep 25 06:32:00 2009
+++ new/usr/src/lib/libshell/common/data/builtins.c     Fri Sep 25 06:31:58 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -139,6 +139,9 @@
        CMDLIST(wc)
        CMDLIST(sync)
 #endif
+#if SHOPT_REGRESS
+       "__regress__",          NV_BLTIN|BLT_ENV,       bltin(__regress__),
+#endif
        "",             0, 0 
 };
 
@@ -677,6 +680,7 @@
     "\aflags\a with optional \anumber\a values may be specified to control "
     "option parsing. "
     "The flags are:]{"
+      "[++?Arguments beginning with + are considered options.]"
       "[+c?Cache this \aoptstring\a for multiple passes. Used to optimize "
        "builtins that may be called many times within the same process.]"
       "[+i?Ignore this \aoptstring\a when generating help. Used when "
@@ -737,9 +741,7 @@
   "[+8.?A group of the form [-\aname\a?\atext\a]] specifies entries "
     "for the \bIMPLEMENTATION\b section.]"
 "}"
-"[+?If the leading character of \aoptstring\a is +, then arguments "
-  "beginning with + will also be considered options.]"
-"[+?A leading : character or a : following a leading + in \aoptstring\a "
+"[+?A leading : character in \aoptstring\a "
   "affects the way errors are handled.  If an option character or longname "
   "argument not specified in \aoptstring\a is encountered when processing "
   "options, the shell variable whose name is \aname\a will be set to the ? "
@@ -750,6 +752,8 @@
   "Without the leading :, \aname\a will be set to the ? character, \bOPTARG\b "
   "will be unset, and an error message will be written to standard error "
   "when errors are encountered.]"
+"[+?A leading + character or a + following a leading : in \aoptstring\a "
+  "specifies that arguments beginning with + will also be considered options.]"
 "[+?The end of options occurs when:]{"
        "[+1.?The special argument \b--\b is encountered.]"
        "[+2.?An argument that does not begin with a \b-\b is encountered.]"
@@ -1060,7 +1064,7 @@
 ;
 
 const char sh_optprint[] =
-"[-1c?\n@(#)$Id: print (AT&T Research) 1999-04-07 $\n]"
+"[-1c?\n@(#)$Id: print (AT&T Research) 2008-11-26 $\n]"
 USAGE_LICENSE
 "[+NAME?print - write arguments to standard output]"
 "[+DESCRIPTION?By default, \bprint\b writes each \astring\a operand to "
@@ -1102,6 +1106,8 @@
 "[u]:[fd:=1?Write to file descriptor number \afd\a instead of standard 
output.]"
 "[v?Treat each \astring\a as a variable name and write the value in \b%B\b "
        "format.  Cannot be used with \b-f\b.]"
+"[C?Treat each \astring\a as a variable name and write the value in \b%#B\b "
+       "format.  Cannot be used with \b-f\b.]"
 "\n"
 "\n[string ...]\n"
 "\n"
@@ -1113,7 +1119,7 @@
 ;
 
 const char sh_optprintf[] =
-"[-1c?\n@(#)$Id: printf (AT&T Research) 2006-10-26 $\n]"
+"[-1c?\n@(#)$Id: printf (AT&T Research) 2009-02-02 $\n]"
 USAGE_LICENSE
 "[+NAME?printf - write formatted output]"
 "[+DESCRIPTION?\bprintf\b writes each \astring\a operand to "
@@ -1161,7 +1167,7 @@
        "in the underlying code set of the character following the "
        "\b\"\b or \b'\b.  Otherwise, \astring\a is treated like a shell "
        "arithmetic expression and evaluated.]"
-"[+?If a \astring\a operand cannot be completed converted into a value "
+"[+?If a \astring\a operand cannot be completely converted into a value "
        "appropriate for that format specifier, an error will occur, "
        "but remaining \astring\a operands will continue to be processed.]"
 "[+?In addition to the format specifier extensions, the following "
@@ -1174,8 +1180,10 @@
        "[+-?The escape sequence \b\\x{\b\ahex\a\b}\b expands to the "
                "character corresponding to the hexidecimal value \ahex\a.]"
        "[+-?The format modifier flag \b=\b can be used to center a field to "
-               "a specified width.  When the output is a terminal, the "
-               "character width is used rather than the number of bytes.]"
+               "a specified width.]"
+       "[+-?The format modifier flag \bL\b can be used with the \bc\b and "
+               "\bs\b formats to treat precision as character width instead "
+               "of byte count.]"
        "[+-?Each of the integral format specifiers can have a third "
                "modifier after width and precision that specifies the "
                "base of the conversion from 2 to 64.  In this case the "
@@ -1388,10 +1396,16 @@
        "in \afile\a that can be used a separate shell script browser.  The "
        "-R option requires a script to be specified as the first operand.]"
 #endif /* SHOPT_KIA */
+#if SHOPT_REGRESS
+"[I:regress]:[intercept?Enable the regression test \aintercept\a. Must be "
+       "the first command line option(s).]"
+#endif
 #if SHOPT_BASH
    "\fbash2\f"
 #endif
 "\fabc\f"
+"?"
+"[T?Enable implementation specific test code defined by mask.]#[mask]"
 "\n"
 "\n[arg ...]\n"
 "\n"
@@ -1475,23 +1489,37 @@
 ;
 
 const char sh_optsleep[] =
-"[-1c?\n@(#)$Id: sleep (AT&T Research) 1999-04-07 $\n]"
+"[-1c?\n@(#)$Id: sleep (AT&T Research) 2009-03-12 $\n]"
 USAGE_LICENSE
 "[+NAME?sleep - suspend execution for an interval]"
 "[+DESCRIPTION?\bsleep\b suspends execution for at least the time specified "
-       "by \aseconds\a or until a \bSIGALRM\b signal is received.  "
-       "\aseconds\a can be specified as a floating point number but the "
-       "actual granularity depends on the underlying system, normally "
-       "around 1 millisecond.]"
+       "by \aduration\a or until a \bSIGALRM\b signal is received. "
+       "\aduration\a may be one of the following:]"
+"{"
+       "[+integer?The number of seconds to sleep.]"
+       "[+floating point?The number of seconds to sleep. The actual "
+               "granularity depends on the underlying system, normally "
+               "around 1 millisecond.]"
+       "[+P\an\a\bY\b\an\a\bM\b\an\a\bDT\b\an\a\bH\b\an\a\bM\b\an\a\bS?An ISO 
8601 duration "
+               "where at least one of the duration parts must be specified.]"
+       "[+P\an\a\bW?An ISO 8601 duration specifying \an\a weeks.]"
+       "[+p\an\a\bY\b\an\a\bM\b\an\a\bDT\b\an\a\bH\b\an\a\bm\b\an\a\bS?A case 
insensitive "
+               "ISO 8601 duration except that \bM\b specifies months, \bm\b 
before \bs\b or \bS\b "
+               "specifies minutes and after specifies milliseconds, \bu\b or 
\bU\b specifies "
+               "microseconds, and \bn\b specifies nanoseconds.]"
+       "[+date/time?Sleep until the \bdate\b(1) compatible date/time.]"
+"}"
+"[s?Sleep until a signal or a timeout is received. If \aduration\a is omitted "
+       "or 0 then no timeout will be used.]"
 "\n"
-"\nseconds\n"
+"\n[ duration ]\n"
 "\n"
 "[+EXIT STATUS?]{"
-       "[+0?The execution was successfully suspended for at least \atime\a "
-       "seconds, or a \bSIGALRM\b signal was received.]"
+       "[+0?The execution was successfully suspended for at least \aduration\a 
"
+       "or a \bSIGALRM\b signal was received.]"
        "[+>0?An error occurred.]"
 "}"
-"[+SEE ALSO?\btime\b(1), \bwait\b(1)]"
+"[+SEE ALSO?\bdate\b(1), \btime\b(1), \bwait\b(1)]"
 ;
 
 const char sh_opttrap[] =
@@ -1566,9 +1594,10 @@
        "options \b-i\b, \b-E\b, and \b-F\b cannot be specified with "
        "the justification options \b-L\b, \b-R\b, and \b-Z\b.]"
 "[+?Note that the following preset aliases are set by the shell:]{"
-       "[+float?\b\f?\f -E\b.]"
+       "[+compound?\b\f?\f -C\b.]"
+       "[+float?\b\f?\f -lE\b.]"
        "[+functions?\b\f?\f -f\b.]"
-       "[+integer?\b\f?\f -i\b.]"
+       "[+integer?\b\f?\f -li\b.]"
        "[+nameref?\b\f?\f -n\b.]"
 "}"
 "[+?If no \aname\as are specified then variables that have the specified "
@@ -1640,8 +1669,8 @@
 "[R]#?[n?Right justify.  If \an\a is given it represents the field width.  If "
        "the \b-Z\b attribute is also specified, then zeros will "
        "be used as the fill character.  Otherwise, spaces are used.]"
-"[X]#?[n:=10?Floating point number represented in hexadecimal notation. "
-       "\an\a specifies the number of significant figures when the "
+"[X]#?[n:=2*sizeof(long long)?Floating point number represented in hexadecimal 
"
+       "notation.  \an\a specifies the number of significant figures when the "
        "value is expanded.]"
 
 #ifdef SHOPT_TYPEDEF
--- old/usr/src/lib/libshell/common/data/keywords.c     Fri Sep 25 06:32:03 2009
+++ new/usr/src/lib/libshell/common/data/keywords.c     Fri Sep 25 06:32:01 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/data/lexstates.c    Fri Sep 25 06:32:06 2009
+++ new/usr/src/lib/libshell/common/data/lexstates.c    Fri Sep 25 06:32:04 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -399,6 +399,7 @@
 const char e_lexobsolete4[]    = "line %d: %s within [[...]] obsolete, use 
((...))";
 const char e_lexobsolete5[]    = "line %d: set %s obsolete";
 const char e_lexobsolete6[]    = "line %d: `{' instead of `in' is obsolete";
+const char e_lexnonstandard[]  = "line %d: `&>file' is nonstandard -- 
interpreted as `>file 2>&1' for profile input only";
 const char e_lexusebrace[]     = "line %d: use braces to avoid ambiguities 
with $id[...]";
 const char e_lexusequote[]     = "line %d: %c within ${} should be quoted";
 const char e_lexescape[]       = "line %d: escape %c to avoid ambiguities";
--- old/usr/src/lib/libshell/common/data/limits.c       Fri Sep 25 06:32:09 2009
+++ new/usr/src/lib/libshell/common/data/limits.c       Fri Sep 25 06:32:07 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/data/math.tab       Fri Sep 25 06:32:12 2009
+++ new/usr/src/lib/libshell/common/data/math.tab       Fri Sep 25 06:32:10 2009
@@ -1,6 +1,6 @@
 # <return type: i:integer f:floating-point> <#floating-point-args> 
<function-name> [<alias> ...]
 # <function-name>l variants are handled by features/math.sh
-# @(#)math.tab (AT&T Research) 2008-05-22
+# @(#)math.tab (AT&T Research) 2009-08-18
 f 1 acos
 f 1 acosh
 f 1 asin
@@ -33,16 +33,21 @@
 i 2 isgreater
 i 2 isgreaterequal
 i 1 isinf
+i 1 isinfinite
 i 2 isless
 i 2 islessequal
 i 2 islessgreater
 i 1 isnan
 i 1 isnormal
-i 1 issubnormal
+i 1 issubnormal fpclassify=FP_SUBNORMAL
 i 2 isunordered
-i 1 iszero
+i 1 iszero fpclassify=FP_ZERO
+f 1 j0
+f 1 j1
+f 2 jn
 f 1 lgamma
 f 1 log
+f 1 log10
 f 1 log1p
 f 1 log2
 f 1 logb
@@ -63,3 +68,6 @@
 f 1 tanh
 f 1 tgamma
 f 1 trunc
+f 1 y0
+f 1 y1
+f 2 yn
--- old/usr/src/lib/libshell/common/data/msg.c  Fri Sep 25 06:32:14 2009
+++ new/usr/src/lib/libshell/common/data/msg.c  Fri Sep 25 06:32:13 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -50,6 +50,7 @@
 const char e_option[]          = "%s: bad option(s)";
 const char e_toomany[]         = "open file limit exceeded";
 const char e_argtype[]         = "invalid argument of type %c";
+const char e_oneoperand[]      = "one operand expected";
 const char e_formspec[]                = "%c: unknown format specifier";
 const char e_badregexp[]       = "%s: invalid regular expression";
 const char e_number[]          = "%s: bad number";
@@ -85,6 +86,7 @@
 #endif /* _cmd_universe */
 const char e_direct[]          = "bad directory";
 const char e_file[]            = "%s: bad file unit number";
+const char e_redirect[]                = "redirection failed";
 const char e_trap[]            = "%s: bad trap";
 const char e_readonly[]                = "%s: is read only";
 const char e_badfield[]                = "%d: negative field size";
@@ -93,12 +95,14 @@
 const char e_varname[]         = "%s: invalid variable name";
 const char e_badfun[]          = "%s: invalid function name";
 const char e_aliname[]         = "%s: invalid alias name";
-const char e_badexport[]       = "%s: invalid export name";
+const char e_badexport[]       = "%s: only simple variables can be exported";
 const char e_badref[]          = "%s: reference variable cannot be an array";
+const char e_badsubscript[]    = "%c: invalid subscript in assignment";
 const char e_noarray[]         = "%s: cannot be an array";
 const char e_badappend[]       = "%s: invalid append to associative array";
 const char e_noref[]           = "%s: no reference name";
 const char e_selfref[]         = "%s: invalid self reference";
+const char e_globalref[]       = "%s: global reference cannot refer to local 
variable";
 const char e_noalias[]         = "%s: alias not found\n";
 const char e_format[]          = "%s: bad format";
 const char e_redef[]           = "%s: type cannot be redefined";
--- old/usr/src/lib/libshell/common/data/options.c      Fri Sep 25 06:32:17 2009
+++ new/usr/src/lib/libshell/common/data/options.c      Fri Sep 25 06:32:15 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -127,6 +127,8 @@
        {"-xexport",    NV_EXPORT},
        {"-rreadonly",  NV_RDONLY},
        {"-ttagged",    NV_TAGGED},
+       {"-Aassociative array", NV_ARRAY},
+       {"-aindexed array",     NV_ARRAY},
        {"-llong",      (NV_DOUBLE|NV_LONG)},
        {"-Eexponential",(NV_DOUBLE|NV_EXPNOTE)},
        {"-Xhexfloat",  (NV_DOUBLE|NV_HEXFLOAT)},
@@ -142,8 +144,6 @@
        {"-Lleftjust",  NV_LJUST},
        {"-Rrightjust", NV_RJUST},
        {"-uuppercase", NV_LTOU},
-       {"-Aassociative array", NV_ARRAY},
-       {"-aindexed array",     NV_ARRAY},
        {"++namespace", NV_TABLE},
        {"",            0}
 };
--- old/usr/src/lib/libshell/common/data/signals.c      Fri Sep 25 06:32:20 2009
+++ new/usr/src/lib/libshell/common/data/signals.c      Fri Sep 25 06:32:18 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -34,180 +34,205 @@
 #define S(s)           ERROR_dictionary(s)
 
 /*
- * This is a table that gives numbers and default settings to each signal
- * The signal numbers go in the low bits and the attributes go in the high bits
+ * This is a table that gives numbers and default settings to each signal.
+ * The signal numbers go in the low bits and the attributes go in the high 
bits.
+ * The names must be ASCII sorted lo-hi.
  */
 
 const struct shtable2 shtab_signals[] =
 {
 #ifdef SIGABRT
-       "ABRT",         VAL(SIGABRT,SH_SIGDONE),        S("Abort"),
+       "ABRT",         VAL(SIGABRT,SH_SIGDONE),                        
S("Abort"),
 #endif /*SIGABRT */
 #ifdef SIGAIO
-       "AIO",          VAL(SIGAIO,SH_SIGIGNORE),       S("Asynchronous I/O"),
+       "AIO",          VAL(SIGAIO,SH_SIGIGNORE),                       
S("Asynchronous I/O"),
 #endif /*SIGAIO */
 #ifdef SIGALRM
-       "ALRM",         VAL(SIGALRM,SH_SIGDONE),        S("Alarm call"),
+       "ALRM",         VAL(SIGALRM,SH_SIGDONE),                        
S("Alarm call"),
 #endif /* SIGALRM */
+#ifdef SIGALRM1
+       "ALRM1",        VAL(SIGALRM1,SH_SIGDONE),                       
S("Scheduling - reserved"),
+#endif /* SIGALRM */
 #ifdef SIGAPOLLO
-       "APOLLO",       VAL(SIGAPOLLO,0),               "SIGAPOLLO"),
+       "APOLLO",       VAL(SIGAPOLLO,0),                               
S("SIGAPOLLO"),
 #endif /* SIGAPOLLO */
 #ifdef SIGBUS
-       "BUS",          VAL(SIGBUS,SH_SIGDONE),         S("Bus error"),
+       "BUS",          VAL(SIGBUS,SH_SIGDONE),                         S("Bus 
error"),
 #endif /* SIGBUS */
 #ifdef SIGCANCEL
-       "CANCEL",       VAL(SIGCANCEL,SH_SIGIGNORE),    S("Thread 
cancellation"),
+       "CANCEL",       VAL(SIGCANCEL,SH_SIGIGNORE),                    
S("Thread cancellation"),
 #endif /*SIGCANCEL */
 #ifdef SIGCHLD
-       "CHLD",         VAL(SIGCHLD,SH_SIGFAULT),       S("Death of Child"),
+       "CHLD",         VAL(SIGCHLD,SH_SIGFAULT),                       
S("Death of Child"),
 #   ifdef SIGCLD
 #      if SIGCLD!=SIGCHLD
-           "CLD",      VAL(SIGCLD,SH_SIGFAULT),        S("Death of Child"),
+           "CLD",      VAL(SIGCLD,SH_SIGFAULT),                        
S("Death of Child"),
 #      endif
 #   endif      /* SIGCLD */
 #else
 #   ifdef SIGCLD
-       "CLD",          VAL(SIGCLD,SH_SIGFAULT),        S("Death of Child"),
+       "CLD",          VAL(SIGCLD,SH_SIGFAULT),                        
S("Death of Child"),
 #   endif      /* SIGCLD */
 #endif /* SIGCHLD */
 #ifdef SIGCONT
-       "CONT",         VAL(SIGCONT,SH_SIGIGNORE),      S("Stopped process 
continued"),
+       "CONT",         VAL(SIGCONT,SH_SIGIGNORE),                      
S("Stopped process continued"),
 #endif /* SIGCONT */
-       "DEBUG",        VAL(TRAP(SH_DEBUGTRAP),0),      "",
+#ifdef SIGCPUFAIL
+       "CPUFAIL",      VAL(SIGCPUFAIL,0),                              
S("Predictive processor deconfiguration"),
+#endif /* SIGRETRACT */
+       "DEBUG",        VAL(TRAP(SH_DEBUGTRAP),0),                      "",
 #ifdef SIGDANGER
-       "DANGER",       VAL(SIGDANGER,0),       S("System crash soon"),
+       "DANGER",       VAL(SIGDANGER,0),                               
S("System crash soon"),
 #endif /* SIGDANGER */
 #ifdef SIGDIL
-       "DIL",          VAL(SIGDIL,0),                  S("DIL signal"),
+       "DIL",          VAL(SIGDIL,0),                                  S("DIL 
signal"),
 #endif /* SIGDIL */
 #ifdef SIGEMT
-       "EMT",          VAL(SIGEMT,SH_SIGDONE),         S("EMT trap"),
+       "EMT",          VAL(SIGEMT,SH_SIGDONE),                         S("EMT 
trap"),
 #endif /* SIGEMT */
-       "ERR",          VAL(TRAP(SH_ERRTRAP),0),        "",
+       "ERR",          VAL(TRAP(SH_ERRTRAP),0),                        "",
 #ifdef SIGERR
-       "ERR",          VAL(SIGERR,0),                  "",
+       "ERR",          VAL(SIGERR,0),                                  "",
 #endif /* SIGERR */
-       "EXIT",         VAL(0,0),                       "",
-       "FPE",          VAL(SIGFPE,SH_SIGDONE),         S("Floating exception"),
+       "EXIT",         VAL(0,0),                                       "",
+       "FPE",          VAL(SIGFPE,SH_SIGDONE),                         
S("Floating exception"),
 #ifdef SIGFREEZE
-       "FREEZE",       VAL(SIGFREEZE,SH_SIGIGNORE),    S("Special signal used 
by CPR"),
+       "FREEZE",       VAL(SIGFREEZE,SH_SIGIGNORE),                    
S("Special signal used by CPR"),
 #endif /* SIGFREEZE */
-       "HUP",          VAL(SIGHUP,SH_SIGDONE),         S("Hangup"),
-       "ILL",          VAL(SIGILL,SH_SIGDONE),         S("Illegal 
instruction"),
+#ifdef SIGGRANT
+       "GRANT",        VAL(SIGGRANT,0),                                
S("Grant monitor mode"),
+#endif /* SIGGRANT */
+       "HUP",          VAL(SIGHUP,SH_SIGDONE),                         
S("Hangup"),
+       "ILL",          VAL(SIGILL,SH_SIGDONE),                         
S("Illegal instruction"),
 #ifdef JOBS
-       "INT",          VAL(SIGINT,SH_SIGINTERACTIVE),  S("Interrupt"),
+       "INT",          VAL(SIGINT,SH_SIGINTERACTIVE),                  
S("Interrupt"),
 #else
-       "INT",          VAL(SIGINT,SH_SIGINTERACTIVE),  "",
+       "INT",          VAL(SIGINT,SH_SIGINTERACTIVE),                  "",
 #endif /* JOBS */
 #ifdef SIGIO
-       "IO",           VAL(SIGIO,SH_SIGIGNORE),        S("IO signal"),
+       "IO",           VAL(SIGIO,SH_SIGDONE),                          S("IO 
signal"),
 #endif /* SIGIO */
 #ifdef SIGIOT
-       "IOT",          VAL(SIGIOT,SH_SIGDONE),         S("Abort"),
+       "IOT",          VAL(SIGIOT,SH_SIGDONE),                         
S("Abort"),
 #endif /* SIGIOT */
 #ifdef SIGJVM1
-       "JVM1",         VAL(SIGJVM1,SH_SIGIGNORE),      S("Special signal used 
by Java Virtual Machine"),
+       "JVM1",         VAL(SIGJVM1,SH_SIGIGNORE),                      
S("Special signal used by Java Virtual Machine"),
 #endif /*SIGJVM1 */
 #ifdef SIGJVM2
-       "JVM2",         VAL(SIGJVM2,SH_SIGIGNORE),      S("Special signal used 
by Java Virtual Machine"),
+       "JVM2",         VAL(SIGJVM2,SH_SIGIGNORE),                      
S("Special signal used by Java Virtual Machine"),
 #endif /*SIGJVM2 */
-       "KEYBD",        VAL(TRAP(SH_KEYTRAP),0),        "",
+       "KEYBD",        VAL(TRAP(SH_KEYTRAP),0),                        "",
 #ifdef SIGKILL
-       "KILL",         VAL(SIGKILL,0),                 S("Killed"),
+       "KILL",         VAL(SIGKILL,0),                                 
S("Killed"),
 #endif /* SIGKILL */
 #ifdef SIGLAB
-       "LAB",          VAL(SIGLAB,0),                  S("Security label 
changed"),
+       "LAB",          VAL(SIGLAB,0),                                  
S("Security label changed"),
 #endif /* SIGLAB */
 #ifdef SIGLOST
-       "LOST",         VAL(SIGLOST,SH_SIGDONE),        S("Resources lost"),
+       "LOST",         VAL(SIGLOST,SH_SIGDONE),                        
S("Resources lost"),
 #endif /* SIGLOST */
 #ifdef SIGLWP
-       "LWP",          VAL(SIGLWP,SH_SIGIGNORE),       S("Special signal used 
by thread library"),
+       "LWP",          VAL(SIGLWP,SH_SIGIGNORE),                       
S("Special signal used by thread library"),
 #endif /* SIGLWP */
+#ifdef SIGMIGRATE
+       "MIGRATE",      VAL(SIGMIGRATE,0),                              
S("Migrate process"),
+#endif /* SIGMIGRATE */
+#ifdef SIGMSG
+       "MSG",          VAL(SIGMSG,0),                                  S("Ring 
buffer input data"),
+#endif /* SIGMSG */
 #ifdef SIGPHONE
-       "PHONE",        VAL(SIGPHONE,0),                S("Phone interrupt"),
+       "PHONE",        VAL(SIGPHONE,0),                                
S("Phone interrupt"),
 #endif /* SIGPHONE */
 #ifdef SIGPIPE
 #ifdef JOBS
-       "PIPE",         VAL(SIGPIPE,SH_SIGDONE),        S("Broken Pipe"),
+       "PIPE",         VAL(SIGPIPE,SH_SIGDONE),                        
S("Broken Pipe"),
 #else
-       "PIPE",         VAL(SIGPIPE,SH_SIGDONE),         "",
+       "PIPE",         VAL(SIGPIPE,SH_SIGDONE),                        "",
 #endif /* JOBS */
 #endif /* SIGPIPE */
 #ifdef SIGPOLL
-       "POLL",         VAL(SIGPOLL,SH_SIGDONE),        S("Polling alarm"),
+       "POLL",         VAL(SIGPOLL,SH_SIGDONE),                        
S("Polling alarm"),
 #endif /* SIGPOLL */
 #ifdef SIGPROF
-       "PROF",         VAL(SIGPROF,SH_SIGDONE),        S("Profiling time 
alarm"),
+       "PROF",         VAL(SIGPROF,SH_SIGDONE),                        
S("Profiling time alarm"),
 #endif /* SIGPROF */
+#ifdef SIGPRE
+       "PRE",          VAL(SIGPRE,SH_SIGDONE),                         
S("Programming exception"),
+#endif /* SIGPRE */
 #ifdef SIGPWR
 #   if SIGPWR>0
-       "PWR",          VAL(SIGPWR,SH_SIGIGNORE),       S("Power fail"),
+       "PWR",          VAL(SIGPWR,SH_SIGIGNORE),                       
S("Power fail"),
 #   endif
 #endif /* SIGPWR */
 #ifdef SIGQUIT
        "QUIT",         VAL(SIGQUIT,SH_SIGDONE|SH_SIGINTERACTIVE),      
S("Quit"),
 #endif /* SIGQUIT */
+#ifdef SIGRETRACT
+       "RETRACT",      VAL(SIGRETRACT,0),                              
S("Relinquish monitor mode"),
+#endif /* SIGRETRACT */
 #ifdef SIGRTMIN
-       "RTMIN",        VAL(SH_SIGRTMIN,SH_SIGRUNTIME), S("Lowest priority 
realtime signal"),
+       "RTMIN",        VAL(SH_SIGRTMIN,SH_SIGRUNTIME),                 
S("Lowest priority realtime signal"),
 #endif /* SIGRTMIN */
 #ifdef SIGRTMAX
-       "RTMAX",        VAL(SH_SIGRTMAX,SH_SIGRUNTIME), S("Highest priority 
realtime signal"),
+       "RTMAX",        VAL(SH_SIGRTMAX,SH_SIGRUNTIME),                 
S("Highest priority realtime signal"),
 #endif /* SIGRTMAX */
-       "SEGV",         VAL(SIGSEGV,0),                 S("Memory fault"),
+#ifdef SIGSAK
+       "SAK",          VAL(SIGSAK,0),                                  
S("Secure attention key"),
+#endif /* SIGSAK */
+       "SEGV",         VAL(SIGSEGV,0),                                 
S("Memory fault"),
+#ifdef SIGSOUND
+       "SOUND",        VAL(SIGSOUND,0),                                
S("Sound completed"),
+#endif /* SIGSOUND */
 #ifdef SIGSTOP
-       "STOP",         VAL(SIGSTOP,0),                 S("Stopped (SIGSTOP)"),
+       "STOP",         VAL(SIGSTOP,0),                                 
S("Stopped (SIGSTOP)"),
 #endif /* SIGSTOP */
 #ifdef SIGSYS
-       "SYS",          VAL(SIGSYS,SH_SIGDONE),         S("Bad system call"),
+       "SYS",          VAL(SIGSYS,SH_SIGDONE),                         S("Bad 
system call"),
 #endif /* SIGSYS */
        "TERM",         VAL(SIGTERM,SH_SIGDONE|SH_SIGINTERACTIVE),      
S("Terminated"),
+#ifdef SIGTHAW
+       "THAW",         VAL(SIGTHAW,SH_SIGIGNORE),                      
S("Special signal used by CPR"),
+#endif /* SIGTHAW */
 #ifdef SIGTINT
 #   ifdef JOBS
-       "TINT",         VAL(SIGTINT,0),                 S("Interrupt"),
+       "TINT",         VAL(SIGTINT,0),                                 
S("Interrupt"),
 #   else
-       "TINT",         VAL(SIGTINT,0),                 "".
+       "TINT",         VAL(SIGTINT,0),                                 "",
 #   endif /* JOBS */
 #endif /* SIGTINT */
 #ifdef SIGTRAP
-       "TRAP",         VAL(SIGTRAP,SH_SIGDONE),        S("Trace/BPT trap"),
+       "TRAP",         VAL(SIGTRAP,SH_SIGDONE),                        
S("Trace/BPT trap"),
 #endif /* SIGTRAP */
 #ifdef SIGTSTP
-       "TSTP",         VAL(SIGTSTP,0),                 S("Stopped"),
+       "TSTP",         VAL(SIGTSTP,0),                                 
S("Stopped"),
 #endif /* SIGTSTP */
 #ifdef SIGTTIN
-       "TTIN",         VAL(SIGTTIN,0),                 S("Stopped (SIGTTIN)"),
+       "TTIN",         VAL(SIGTTIN,0),                                 
S("Stopped (SIGTTIN)"),
 #endif /* SIGTTIN */
 #ifdef SIGTTOU
-       "TTOU",         VAL(SIGTTOU,0),                 S("Stopped(SIGTTOU)"),
+       "TTOU",         VAL(SIGTTOU,0),                                 
S("Stopped(SIGTTOU)"),
 #endif /* SIGTTOU */
 #ifdef SIGURG
-       "URG",          VAL(SIGURG,SH_SIGIGNORE),       S("Socket interrupt"),
+       "URG",          VAL(SIGURG,SH_SIGIGNORE),                       
S("Socket interrupt"),
 #endif /* SIGURG */
 #ifdef SIGUSR1
-       "USR1",         VAL(SIGUSR1,SH_SIGDONE),         S("User signal 1"),
+       "USR1",         VAL(SIGUSR1,SH_SIGDONE),                        S("User 
signal 1"),
 #endif /* SIGUSR1 */
 #ifdef SIGUSR2
-       "USR2",         VAL(SIGUSR2,SH_SIGDONE),         S("User signal 2"),
+       "USR2",         VAL(SIGUSR2,SH_SIGDONE),                        S("User 
signal 2"),
 #endif /* SIGUSR2 */
+#ifdef SIGVIRT
+       "VIRT",         VAL(SIGVIRT,0),                                 
S("Virtual timer alarm"),
+#endif /* SIGVIRT */
 #ifdef SIGVTALRM
-       "VTALRM",       VAL(SIGVTALRM,SH_SIGDONE),      S("Virtual time alarm"),
+       "VTALRM",       VAL(SIGVTALRM,SH_SIGDONE),                      
S("Virtual time alarm"),
 #endif /* SIGVTALRM */
-#ifdef SIGWINCH
-       "WINCH",        VAL(SIGWINCH,SH_SIGIGNORE),     S("Window size change"),
-#endif /* SIGWINCH */
-#ifdef SIGMIGRATE
-       "MIGRATE",              VAL(SIGMIGRATE,0),      S("Migrate process"),
-#endif /* SIGMIGRATE */
-#ifdef SIGSOUND
-       "SOUND",                VAL(SIGSOUND,0),        S("Sound completed"),
-#endif /* SIGSOUND */
-#ifdef SIGTHAW
-       "THAW",                 VAL(SIGTHAW,SH_SIGIGNORE),      S("Special 
signal used by CPR"),
-#endif /* SIGTHAW */
 #ifdef SIGWAITING
-       "WAITING",              VAL(SIGWAITING,SH_SIGIGNORE),   S("All threads 
blocked"),
+       "WAITING",      VAL(SIGWAITING,SH_SIGIGNORE),                   S("All 
threads blocked"),
 #endif /* SIGWAITING */
+#ifdef SIGWINCH
+       "WINCH",        VAL(SIGWINCH,SH_SIGIGNORE),                     
S("Window size change"),
+#endif /* SIGWINCH */
 #ifdef SIGXCPU
        "XCPU",         VAL(SIGXCPU,SH_SIGDONE|SH_SIGINTERACTIVE),      
S("Exceeded CPU time limit"),
 #endif /* SIGXCPU */
--- old/usr/src/lib/libshell/common/data/solaris_cmdlist.h      Fri Sep 25 
06:32:23 2009
+++ new/usr/src/lib/libshell/common/data/solaris_cmdlist.h      Fri Sep 25 
06:32:21 2009
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -70,6 +70,7 @@
 /* undo ast_map.h #defines to avoid collision */
 #undef basename
 #undef dirname
+#undef mktemp
 
 /* Generated data, do not edit. */
 XPG4CMDLIST(basename)
@@ -82,36 +83,49 @@
 XPG4CMDLIST(chown)
 BINCMDLIST(chown)
 ASTCMDLIST(chown)
+BINCMDLIST(cksum)
+ASTCMDLIST(cksum)
+BINCMDLIST(cmp)
 ASTCMDLIST(cmp)
+BINCMDLIST(comm)
 ASTCMDLIST(comm)
 XPG4CMDLIST(cp)
 ASTCMDLIST(cp)
+BINCMDLIST(cut)
 ASTCMDLIST(cut)
 XPG4CMDLIST(date)
 ASTCMDLIST(date)
 ASTCMDLIST(dirname)
+ASTCMDLIST(egrep)
 XPG4CMDLIST(expr)
 ASTCMDLIST(expr)
 ASTCMDLIST(fds)
+ASTCMDLIST(fgrep)
 ASTCMDLIST(fmt)
 ASTCMDLIST(fold)
+ASTCMDLIST(grep)
 BINCMDLIST(head)
 ASTCMDLIST(head)
 XPG4CMDLIST(id)
 ASTCMDLIST(id)
+BINCMDLIST(join)
 ASTCMDLIST(join)
 XPG4CMDLIST(ln)
 ASTCMDLIST(ln)
 BINCMDLIST(logname)
 ASTCMDLIST(logname)
+ASTCMDLIST(md5sum)
 BINCMDLIST(mkdir)
 ASTCMDLIST(mkdir)
 BINCMDLIST(mkfifo)
 ASTCMDLIST(mkfifo)
+ASTCMDLIST(mktemp)
 XPG4CMDLIST(mv)
 ASTCMDLIST(mv)
+BINCMDLIST(paste)
 ASTCMDLIST(paste)
 ASTCMDLIST(pathchk)
+ASTCMDLIST(readlink)
 BINCMDLIST(rev)
 ASTCMDLIST(rev)
 XPG4CMDLIST(rm)
@@ -127,6 +141,7 @@
 BINCMDLIST(sync)
 ASTCMDLIST(sync)
 XPG4CMDLIST(tail)
+BINCMDLIST(tail)
 ASTCMDLIST(tail)
 BINCMDLIST(tee)
 ASTCMDLIST(tee)
@@ -137,6 +152,7 @@
 ASTCMDLIST(uniq)
 BINCMDLIST(wc)
 ASTCMDLIST(wc)
+ASTCMDLIST(xgrep)
 
 /* Mandatory for ksh93 test suite and AST scripts */
 BINCMDLIST(getconf)
--- old/usr/src/lib/libshell/common/data/strdata.c      Fri Sep 25 06:32:26 2009
+++ new/usr/src/lib/libshell/common/data/strdata.c      Fri Sep 25 06:32:24 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/data/testops.c      Fri Sep 25 06:32:29 2009
+++ new/usr/src/lib/libshell/common/data/testops.c      Fri Sep 25 06:32:27 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -104,6 +104,7 @@
                "open and is associated with a terminal device.]"
        "[+-u \afile\a?True if \afile\a exists and has its set-user-id bit "
                "set.]"
+       "[+-v \avarname\a?True if \avarname\a is a valid variable name that is 
set.]"
        "[+-w \afile\a?True if \afile\a exists and is writable.]"
        "[+-x \afile\a?True if \afile\a exists and is executable.  For a "
                "directory it means that it can be searched.]"
@@ -115,7 +116,12 @@
                "it was last read.]"
        "[+-O \afile\a?True if \afile\a exists and owner is the effective "
                "user id of the current process.]"
+       "[+-R \avarname\a?True if \avarname\a is a name reference.]"
        "[+-S \afile\a?True if \afile\a exists and is a socket.]"
+#if SHOPT_FS_3D
+       "[+-V \afile\a?True if \afile\a exists and is a version "
+               "directory.]"
+#endif /* SHOPT_FS_3D */
 "}"
 "[+?Binary expressions can be one of the following:]{"
        "[+\astring1\a = \astring2\a?True if \astring1\a is equal to "
@@ -156,7 +162,7 @@
 "[+SEE ALSO?\blet\b(1), \bexpr\b(1)]"
 ;
 
-const char test_opchars[]      = "HLNSVOGCaeohrwxdcbfugk"
+const char test_opchars[]      = "HLNRSVOGCaeohrwxdcbfugkv"
 #if SHOPT_TEST_L
        "l"
 #endif
--- old/usr/src/lib/libshell/common/data/variables.c    Fri Sep 25 06:32:32 2009
+++ new/usr/src/lib/libshell/common/data/variables.c    Fri Sep 25 06:32:30 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -47,7 +47,7 @@
        "EDITOR",       0,                              (char*)0,
        "MAILCHECK",    NV_NOFREE|NV_INTEGER,           (char*)0,
        "RANDOM",       NV_NOFREE|NV_INTEGER,           (char*)0,
-       "ENV",          NV_NOFREE,                      "$HOME/.kshrc",
+       "ENV",          NV_NOFREE,                      (char*)0,
        "HISTFILE",     0,                              (char*)0,
        "HISTSIZE",     0,                              (char*)0,
        "HISTEDIT",     NV_NOFREE,                      (char*)0,
@@ -77,6 +77,7 @@
        "LC_NUMERIC",   0,                              (char*)0,
        "FIGNORE",      0,                              (char*)0,
        "KSH_VERSION",  0,                              (char*)0,
+       "JOBMAX",       NV_NOFREE|NV_INTEGER,           (char*)0,
        ".sh",          NV_TABLE|NV_RDONLY|NV_NOFREE|NV_NOPRINT,(char*)0,
        ".sh.edchar",   0,                              (char*)0,
        ".sh.edcol",    0,                              (char*)0,
@@ -108,7 +109,7 @@
        "",     0,                                      (char*)0
 };
 
-const char *nv_discnames[] = { "get", "set", "append", "unset", 0 };
+const char *nv_discnames[] = { "get", "set", "append", "unset", "getn", 0 };
 
 #ifdef SHOPT_STATS
 const Shtable_t shtab_stats[] =
--- old/usr/src/lib/libshell/common/edit/completion.c   Fri Sep 25 06:32:35 2009
+++ new/usr/src/lib/libshell/common/edit/completion.c   Fri Sep 25 06:32:33 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -24,7 +24,6 @@
  */
 
 #include       "defs.h"
-#include       <ctype.h>
 #include       <ast_wchar.h>
 #include       "lexstates.h"
 #include       "path.h"
@@ -32,6 +31,31 @@
 #include       "edit.h"
 #include       "history.h"
 
+#if !SHOPT_MULTIBYTE
+#define mbchar(p)       (*(unsigned char*)p++)
+#endif
+
+static char *fmtx(const char *string)
+{
+       register const char     *cp = string;
+       register int            n,c;
+       unsigned char           *state = (unsigned char*)sh_lexstates[2]; 
+       int offset;
+       while((c=mbchar(cp)),(c>UCHAR_MAX)||(n=state[c])==0);
+       if(n==S_EOF)
+               return((char*)string);
+       offset = staktell();
+       stakwrite(string,--cp-string);
+       while(c=mbchar(cp))
+       {
+               if(state[c])
+                       stakputc('\\');
+               stakputc(c);
+       }
+       stakputc(0);
+       return(stakptr(offset));
+}
+
 static int charcmp(int a, int b, int nocase)
 {
        if(nocase)
@@ -337,7 +361,7 @@
                        {
                                char **savcom = com;
                                while (*com)
-                                       size += strlen(cp=sh_fmtq(*com++));
+                                       size += strlen(cp=fmtx(*com++));
                                com = savcom;
                        }
                }
@@ -364,7 +388,7 @@
                                var = 0;
                        }
                        else
-                               out = strcopy(begin,sh_fmtq(*com));
+                               out = strcopy(begin,fmtx(*com));
                        com++;
                }
                else
@@ -394,7 +418,7 @@
                                        out = strcopy(begin,cp);
                                }
                                /* add quotes if necessary */
-                               if((cp=sh_fmtq(begin))!=begin)
+                               if((cp=fmtx(begin))!=begin)
                                        out = strcopy(begin,cp);
                                if(var=='$' && begin[-1]=='{')
                                        *out = '}';
@@ -402,7 +426,7 @@
                                        *out = ' ';
                                *++out = 0;
                        }
-                       else if(out[-1]=='/' && (cp=sh_fmtq(begin))!=begin)
+                       else if(out[-1]=='/' && (cp=fmtx(begin))!=begin)
                        {
                                out = strcopy(begin,cp);
                                if(out[-1] =='"' || out[-1]=='\'')
@@ -416,7 +440,7 @@
                        while (*com)
                        {
                                *out++  = ' ';
-                               out = strcopy(out,sh_fmtq(*com++));
+                               out = strcopy(out,fmtx(*com++));
                        }
                }
                if(ep->e_nlist)
--- old/usr/src/lib/libshell/common/edit/edit.c Fri Sep 25 06:32:38 2009
+++ new/usr/src/lib/libshell/common/edit/edit.c Fri Sep 25 06:32:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -30,7 +30,6 @@
 #include       <ast.h>
 #include       <errno.h>
 #include       <ccode.h>
-#include       <ctype.h>
 #include       "FEATURE/options"
 #include       "FEATURE/time"
 #include       "FEATURE/cmds"
@@ -43,6 +42,7 @@
 #   include    "defs.h"
 #   include    "variables.h"
 #else
+#   include    <ctype.h>
     extern char ed_errbuf[];
     char e_version[] = "\n@(#)$Id: Editlib version 1993-12-28 r $\0\n";
 #endif /* KSHELL */
@@ -818,7 +818,7 @@
        {
                if(shp->trapnote&(SH_SIGSET|SH_SIGTRAP))
                        goto done;
-               if(ep->sh->winch)
+               if(ep->sh->winch && sh_isstate(SH_INTERACTIVE) && 
(sh_isoption(SH_VI) || sh_isoption(SH_EMACS)))
                {
                        Edpos_t lastpos;
                        int     n, rows, newsize;
@@ -857,9 +857,12 @@
                                buff[2] = 'a';
                                return(3);
                        }
-                       buff[0] = cntl('L');
+                       if(sh_isoption(SH_EMACS) || sh_isoption(SH_VI))
+                               buff[0] = cntl('L');
                        return(1);
                }
+               else
+                       ep->sh->winch = 0;
                /* an interrupt that should be ignored */
                errno = 0;
                if(!waitevent || (rv=(*waitevent)(fd,-1L,0))>=0)
--- old/usr/src/lib/libshell/common/edit/emacs.c        Fri Sep 25 06:32:41 2009
+++ new/usr/src/lib/libshell/common/edit/emacs.c        Fri Sep 25 06:32:39 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -62,10 +62,11 @@
  */
 
 #include       <ast.h>
-#include       <ctype.h>
 #include       "FEATURE/cmds"
 #if KSHELL
 #   include    "defs.h"
+#else
+#   include    <ctype.h>
 #endif /* KSHELL */
 #include       "io.h"
 
@@ -207,7 +208,9 @@
        ed_setup(ep->ed,fd,reedit);
        out = (genchar*)buff;
 #if SHOPT_MULTIBYTE
-       out = (genchar*)roundof((char*)out-(char*)0,sizeof(genchar));
+       out = (genchar*)roundof(buff-(char*)0,sizeof(genchar));
+       if(reedit)
+               ed_internal(buff,out);
 #endif /* SHOPT_MULTIBYTE */
        if(!kstack)
        {
@@ -907,13 +910,11 @@
                        char buf[MAXLINE];
                        char *ptr;
                        ptr = hist_word(buf,MAXLINE,(count?count:-1));
-#if !KSHELL
                        if(ptr==0)
                        {
                                beep();
                                break;
                        }
-#endif /* KSHELL */
                        if ((eol - cur) >= sizeof(name))
                        {
                                beep();
@@ -1072,6 +1073,7 @@
                beep();
                return(-1);
        }
+       return(-1);
 }
 
 
--- old/usr/src/lib/libshell/common/edit/hexpand.c      Fri Sep 25 06:32:44 2009
+++ new/usr/src/lib/libshell/common/edit/hexpand.c      Fri Sep 25 06:32:42 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -41,8 +41,6 @@
 
 #else
 
-#include <ctype.h>
-
 static char *modifiers = "htrepqxs&";
 static int mod_flags[] = { 0, 0, 0, 0, HIST_PRINT, HIST_QUOTE, 
HIST_QUOTE|HIST_QUOTE_BR, 0, 0 };
 
--- old/usr/src/lib/libshell/common/edit/history.c      Fri Sep 25 06:32:47 2009
+++ new/usr/src/lib/libshell/common/edit/history.c      Fri Sep 25 06:32:45 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -74,7 +74,6 @@
 #include       <sfio.h>
 #include       "FEATURE/time"
 #include       <error.h>
-#include       <ctype.h>
 #include       <ls.h>
 #if KSHELL
 #   include    "defs.h"
@@ -82,6 +81,8 @@
 #   include    "path.h"
 #   include    "builtins.h"
 #   include    "io.h"
+#else
+#   include    <ctype.h>
 #endif /* KSHELL */
 #include       "history.h"
 
@@ -1071,14 +1072,7 @@
        register int flag = 0;
        History_t *hp = hist_ptr;
        if(!hp)
-#if KSHELL
-       {
-               strncpy(string,((Shell_t*)hp->histshell)->lastarg,size);
-               return(string);
-       }
-#else
                return(NIL(char*));
-#endif /* KSHELL */
        hist_copy(string,size,(int)hp->histind-1,-1);
        for(;c = *cp;cp++)
        {
--- old/usr/src/lib/libshell/common/edit/vi.c   Fri Sep 25 06:32:50 2009
+++ new/usr/src/lib/libshell/common/edit/vi.c   Fri Sep 25 06:32:48 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -34,8 +34,8 @@
 #else
 #   include    <ast.h>
 #   include    "FEATURE/options"
+#   include    <ctype.h>
 #endif /* KSHELL */
-#include       <ctype.h>
 #include       "io.h"
 
 #include       "history.h"
@@ -581,7 +581,11 @@
 
        vp->U_saved = 0;
        if(reedit)
+       {
+               cur_phys = vp->first_wind;
+               vp->ofirst_wind = INVALID;
                refresh(vp,INPUT);
+       }
        if(viraw)
                getline(vp,APPEND);
        else if(last_virt>=0 && virtual[last_virt]==term_char)
@@ -1566,9 +1570,10 @@
                        if(cur_virt>=0  && cur_virt<(SEARCHSIZE-2) && cur_virt 
== last_virt)
                        {
                                virtual[last_virt + 1] = '\0';
-                               gencpy(&((genchar*)lsearch)[1], virtual);
 #if SHOPT_MULTIBYTE
-                               ed_external(&((genchar*)lsearch)[1],lsearch+1);
+                               ed_external(virtual,lsearch+1);
+#else
+                               strcpy(lsearch+1,virtual);
 #endif /* SHOPT_MULTIBYTE */
                                *lsearch = '^';
                                vp->direction = -2;
@@ -2381,13 +2386,11 @@
                        if(vp->repeat_set==0)
                                vp->repeat = -1;
                        p = 
(genchar*)hist_word((char*)tmpbuf,MAXLINE,vp->repeat);
-#if !KSHELL
                        if(p==0)
                        {
                                ed_ringbell();
                                break;
                        }
-#endif /* KSHELL */
 #if SHOPT_MULTIBYTE
                        ed_internal((char*)p,tmpbuf);
                        p = tmpbuf;
--- old/usr/src/lib/libshell/common/features/math.sh    Fri Sep 25 06:32:53 2009
+++ new/usr/src/lib/libshell/common/features/math.sh    Fri Sep 25 06:32:51 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -20,10 +20,10 @@
 : generate the ksh math builtin table
 : include math.tab
 
-# @(#)math.sh (AT&T Research) 2008-08-29
+# @(#)math.sh (AT&T Research) 2009-08-18
 
 command=$0
-iffeflags="-n -v -F ast_standards.h"
+iffeflags="-n -v"
 iffehdrs="math.h ieeefp.h"
 iffelibs="-lm"
 table=/dev/null
@@ -39,6 +39,13 @@
 
 eval `iffe $iffeflags -c "$cc" - typ long.double 2>&$stderr`
 
+: check ast_standards.h
+
+eval `iffe $iffeflags -F ast_standards.h -c "$cc" - tst use_ast_standards -lm 
'note{' 'math.h needs ast_standards.h' '}end' 'link{' '#include <math.h>' 
'#ifndef isgreater' '#define isgreater(a,b) 0' '#endif' 'int main() { return 
isgreater(0.0,1.0); }' '}end'`
+case $_use_ast_standards in
+1)     iffeflags="$iffeflags -F ast_standards.h" ;;
+esac
+
 : read the table
 
 exec < $table
@@ -80,13 +87,14 @@
 typedef Sfdouble_t (*Math_f)(Sfdouble_t,...);
 
 !
-echo "#include <ast_standards.h>"
+case $_use_ast_standards in
+1)     echo "#include <ast_standards.h>" ;;
+esac
 echo "#include <math.h>"
 case $_hdr_ieeefp in
-1)     echo "#include <ieeefp.h>"
-       echo
-       ;;
+1)     echo "#include <ieeefp.h>" ;;
 esac
+echo
 
 : generate the intercept functions and table entries
 
@@ -105,7 +113,23 @@
                t=double
                local=$_typ_long_double
                ;;
-       *)      continue
+       *)      case $aka in
+               *=*)    f=${aka%%=*}
+                       v=${aka#*=}
+                       eval x='$'_lib_${f}l y='$'_lib_${f}
+                       case $x:$y in
+                       1:*)    f=${f}l
+                               ;;
+                       *:1)    ;;
+                       *)      continue
+                               ;;
+                       esac
+                       L=local_$name r=int R=1
+                       echo "#ifdef $v${nl}static $r $L(Sfdouble_t x) { return 
$f(x) == $v; }${nl}#endif"
+                       tab="$tab$nl#ifdef 
$v$nl$ht\"\\0${R}${a}${name}\",$ht(Math_f)${L},${nl}#endif"
+                       ;;
+               esac
+               continue
                ;;
        esac
        eval n='$'_npt_$f m='$'_mac_$f d='$'_dat_$f
--- old/usr/src/lib/libshell/common/include/argnod.h    Fri Sep 25 06:32:56 2009
+++ new/usr/src/lib/libshell/common/include/argnod.h    Fri Sep 25 06:32:54 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -61,6 +61,8 @@
        struct slnod    *slnext;
        struct slnod    *slchild;
        Stak_t          *slptr;
+       /* slpad aligns struct functnod = struct slnod + 1 on some 
architectures */
+       struct slnod    *slpad; 
 };
 
 /*
--- old/usr/src/lib/libshell/common/include/builtins.h  Fri Sep 25 06:32:59 2009
+++ new/usr/src/lib/libshell/common/include/builtins.h  Fri Sep 25 06:32:57 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -124,6 +124,7 @@
 extern const char      e_overlimit[];
 
 extern const char      e_eneedsarg[];
+extern const char      e_oneoperand[];
 extern const char      e_toodeep[];
 extern const char      e_badname[];
 extern const char      e_badsyntax[];
--- old/usr/src/lib/libshell/common/include/defs.h      Fri Sep 25 06:33:02 2009
+++ new/usr/src/lib/libshell/common/include/defs.h      Fri Sep 25 06:33:00 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -37,6 +37,7 @@
 #include       "fault.h"
 #include       "argnod.h"
 #include       "name.h"
+#include       <ctype.h>
 #define _SH_PRIVATE
 #include       <shcmd.h>
 #undef _SH_PRIVATE
@@ -149,6 +150,7 @@
        pid_t           bckpid;         /* background process id */ \
        pid_t           cpid; \
        pid_t           spid;           /* subshell process id */ \
+       pid_t           pipepid; \
        int32_t         ppid;           /* parent process id of shell */ \
        int             topfd; \
        int             sigmax;         /* maximum number of signals */ \
@@ -167,6 +169,7 @@
        char            indebug;        /* set when in debug trap */ \
        unsigned char   lastsig;        /* last signal received */ \
        char            subshare;       /* set when in ${..} comsub */ \
+       char            toomany;        /* set when out of fd's */ \
        char            *readscript;    /* set before reading a script */ \
        int             *inpipe;        /* input pipe pointer */ \
        int             *outpipe;       /* output pipe pointer */ \
@@ -226,10 +229,12 @@
        Shopt_t         glob_options; \
        Namval_t        *typeinit; \
        int             *stats; \
-       Namfun_t        nvfun;
+       Namfun_t        nvfun; \
+       struct Regress_s*regress;
 
 #include       <shell.h>
 
+#include       "regress.h"
 
 /* error exits from various parts of shell */
 #define        NIL(type)       ((type)0)
@@ -248,8 +253,7 @@
 
 /* states */
 /* low numbered states are same as options */
-#define SH_NOFORK      0       /* set when fork not necessary, not a state */
-#define SH_COMPLETE    0       /* set for command completion */
+#define SH_NOFORK      0       /* set when fork not necessary */
 #define        SH_FORKED       7       /* set when process has been forked */
 #define        SH_PROFILE      8       /* set when processing profiles */
 #define SH_NOALIAS     9       /* do not expand non-exported aliases */
@@ -262,6 +266,7 @@
 #define SH_TTYWAIT     16      /* waiting for keyboard input */ 
 #define        SH_FCOMPLETE    17      /* set for filename completion */
 #define        SH_PREINIT      18      /* set with SH_INIT before parsing 
options */
+#define SH_COMPLETE    19      /* set for command completion */
 
 #define SH_BASH                        41
 #define SH_BRACEEXPAND         42
@@ -335,6 +340,7 @@
 #define MATCH_MAX              64
 
 #define SH_READEVAL            0x4000  /* for sh_eval */
+#define SH_FUNEVAL             0x10000 /* for sh_eval for function load */
 
 extern Shell_t         *nv_shell(Namval_t*);
 extern int             sh_addlib(void*);
@@ -343,6 +349,7 @@
 extern struct dolnod   *sh_argfree(Shell_t *, struct dolnod*,int);
 extern struct dolnod   *sh_argnew(Shell_t*,char*[],struct dolnod**);
 extern void            *sh_argopen(Shell_t*);
+extern struct argnod   *sh_argprocsub(Shell_t*,struct argnod*);
 extern void            sh_argreset(Shell_t*,struct dolnod*,struct dolnod*);
 extern Namval_t                *sh_assignok(Namval_t*,int);
 extern struct dolnod   *sh_arguse(Shell_t*);
--- old/usr/src/lib/libshell/common/include/edit.h      Fri Sep 25 06:33:05 2009
+++ new/usr/src/lib/libshell/common/include/edit.h      Fri Sep 25 06:33:03 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/include/env.h       Fri Sep 25 06:33:08 2009
+++ new/usr/src/lib/libshell/common/include/env.h       Fri Sep 25 06:33:06 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/include/fault.h     Fri Sep 25 06:33:11 2009
+++ new/usr/src/lib/libshell/common/include/fault.h     Fri Sep 25 06:33:09 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/include/fcin.h      Fri Sep 25 06:33:14 2009
+++ new/usr/src/lib/libshell/common/include/fcin.h      Fri Sep 25 06:33:12 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/include/history.h   Fri Sep 25 06:33:17 2009
+++ new/usr/src/lib/libshell/common/include/history.h   Fri Sep 25 06:33:15 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/include/io.h        Fri Sep 25 06:33:19 2009
+++ new/usr/src/lib/libshell/common/include/io.h        Fri Sep 25 06:33:18 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -92,6 +92,7 @@
 extern const char      e_tmpcreate[];
 extern const char      e_exists[];
 extern const char      e_file[];
+extern const char      e_redirect[];
 extern const char      e_formspec[];
 extern const char      e_badregexp[];
 extern const char      e_open[];
--- old/usr/src/lib/libshell/common/include/jobs.h      Fri Sep 25 06:33:22 2009
+++ new/usr/src/lib/libshell/common/include/jobs.h      Fri Sep 25 06:33:20 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -84,6 +84,9 @@
        unsigned int    in_critical;    /* >0 => in critical region */
        int             savesig;        /* active signal */
        int             numpost;        /* number of posted jobs */
+#ifdef SHOPT_BGX
+       int             numbjob;        /* number of background jobs */
+#endif /* SHOPT_BGX */
        short           fd;             /* tty descriptor number */
 #ifdef JOBS
        int             suspend;        /* suspend character */
@@ -116,9 +119,17 @@
 #define vmbusy()       0
 #endif
 
-
 #define job_lock()     (job.in_critical++)
-#define job_unlock()   
do{if(!--job.in_critical&&job.savesig&&!vmbusy())job_reap(job.savesig);}while(0)
+#define job_unlock()   \
+       do { \
+               int     sig; \
+               if (!--job.in_critical && (sig = job.savesig)) \
+               { \
+                       if (!job.in_critical++ && !vmbusy()) \
+                               job_reap(sig); \
+                       job.in_critical--; \
+               } \
+       } while(0)
 
 extern const char      e_jobusage[];
 extern const char      e_done[];
@@ -153,6 +164,9 @@
 extern int     job_post(pid_t,pid_t);
 extern void    *job_subsave(void);
 extern void    job_subrestore(void*);
+#ifdef SHOPT_BGX
+extern void    job_chldtrap(Shell_t*, const char*,int);
+#endif /* SHOPT_BGX */
 #ifdef JOBS
        extern void     job_init(Shell_t*,int);
        extern int      job_close(Shell_t*);
--- old/usr/src/lib/libshell/common/include/lexstates.h Fri Sep 25 06:33:25 2009
+++ new/usr/src/lib/libshell/common/include/lexstates.h Fri Sep 25 06:33:23 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -138,6 +138,7 @@
 extern const char e_lexobsolete4[];
 extern const char e_lexobsolete5[];
 extern const char e_lexobsolete6[];
+extern const char e_lexnonstandard[];
 extern const char e_lexusebrace[];
 extern const char e_lexusequote[];
 extern const char e_lexescape[];
--- old/usr/src/lib/libshell/common/include/name.h      Fri Sep 25 06:33:28 2009
+++ new/usr/src/lib/libshell/common/include/name.h      Fri Sep 25 06:33:26 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -107,7 +107,7 @@
 /* attributes of Namval_t items */
 
 /* The following attributes are for internal use */
-#define NV_NOCHANGE    (NV_EXPORT|NV_IMPORT|NV_RDONLY|NV_TAGGED|NV_NOFREE)
+#define NV_NOCHANGE    
(NV_EXPORT|NV_IMPORT|NV_RDONLY|NV_TAGGED|NV_NOFREE|NV_ARRAY)
 #define NV_ATTRIBUTES  
(~(NV_NOSCOPE|NV_ARRAY|NV_NOARRAY|NV_IDENT|NV_ASSIGN|NV_REF|NV_VARNAME|NV_STATIC))
 #define NV_PARAM       NV_NODISC       /* expansion use positional params */
 
@@ -115,6 +115,7 @@
 #define NV_TYPE                0x1000000
 #define NV_STATIC      0x2000000
 #define NV_COMVAR      0x4000000
+#define NV_UNJUST      0x8000000               /* clear justify attributes */
 #define NV_FUNCTION    (NV_RJUST|NV_FUNCT)     /* value is shell function */
 #define NV_FPOSIX      NV_LJUST                /* posix function semantics */
 #define NV_FTMP                NV_ZFILL                /* function source in 
tmpfile */
@@ -166,12 +167,13 @@
 extern char            *nv_endsubscript(Namval_t*, char*, int);
 extern Namfun_t        *nv_cover(Namval_t*);
 extern Namarr_t        *nv_arrayptr(Namval_t*);
+extern int             nv_arrayisset(Namval_t*, Namarr_t*);
 extern int             nv_arraysettype(Namval_t*, Namval_t*,const char*,int);
 extern int             nv_aimax(Namval_t*);
 extern int             nv_atypeindex(Namval_t*, const char*);
 extern int             nv_setnotify(Namval_t*,char **);
 extern int             nv_unsetnotify(Namval_t*,char **);
-extern void            nv_setlist(struct argnod*, int);
+extern void            nv_setlist(struct argnod*, int, Namval_t*);
 extern struct argnod*  nv_onlist(struct argnod*, const char*);
 extern void            nv_optimize(Namval_t*);
 extern void            nv_outname(Sfio_t*,char*, int);
@@ -197,6 +199,7 @@
 extern void            nv_outnode(Namval_t*,Sfio_t*, int, int);
 extern int             nv_subsaved(Namval_t*);
 extern void            nv_typename(Namval_t*, Sfio_t*);
+extern void            nv_newtype(Namval_t*);
 
 extern const Namdisc_t RESTRICTED_disc;
 extern const Namdisc_t ENUM_disc;
@@ -219,6 +222,7 @@
 extern const char      e_aliname[];
 extern const char      e_badexport[];
 extern const char      e_badref[];
+extern const char      e_badsubscript[];
 extern const char      e_noref[];
 extern const char      e_selfref[];
 extern const char      e_envmarker[];
@@ -228,4 +232,5 @@
 extern const char      e_required[];
 extern const char      e_badappend[];
 extern const char      e_unknowntype[];
+extern const char      e_globalref[];
 #endif /* _NV_PRIVATE */
--- old/usr/src/lib/libshell/common/include/national.h  Fri Sep 25 06:33:31 2009
+++ new/usr/src/lib/libshell/common/include/national.h  Fri Sep 25 06:33:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/include/nval.h      Fri Sep 25 06:33:34 2009
+++ new/usr/src/lib/libshell/common/include/nval.h      Fri Sep 25 06:33:32 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -265,6 +265,7 @@
 extern Namval_t                *nv_lastdict(void);
 extern Namval_t                *nv_mkinttype(char*, size_t, int, const char*, 
Namdisc_t*);
 extern void            nv_newattr(Namval_t*,unsigned,int);
+extern void            nv_newtype(Namval_t*);
 extern Namval_t                *nv_open(const char*,Dt_t*,int);
 extern void            nv_putval(Namval_t*,const char*,int);
 extern void            nv_putv(Namval_t*,const char*,int,Namfun_t*);
--- old/usr/src/lib/libshell/common/include/path.h      Fri Sep 25 06:33:37 2009
+++ new/usr/src/lib/libshell/common/include/path.h      Fri Sep 25 06:33:35 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -44,7 +44,7 @@
 #define PATH_STD_DIR           0100    /* directory is on  $(getconf PATH) */
 
 #define PATH_OFFSET    2               /* path offset for path_join */
-#define MAXDEPTH       (sizeof(char*)==2?64:2048) /* maximum recursion depth*/
+#define MAXDEPTH       (sizeof(char*)==2?64:1024) /* maximum recursion depth*/
 
 /*
  * path component structure for path searching
--- /dev/null   Fri Sep 25 06:33:40 2009
+++ new/usr/src/lib/libshell/common/include/regress.h   Fri Sep 25 06:33:38 2009
@@ -0,0 +1,66 @@
+/***********************************************************************
+*                                                                      *
+*               This software is part of the ast package               *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
+*                      and is licensed under the                       *
+*                  Common Public License, Version 1.0                  *
+*                    by AT&T Intellectual Property                     *
+*                                                                      *
+*                A copy of the License is available at                 *
+*            http://www.opensource.org/licenses/cpl1.0.txt             *
+*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
+*                                                                      *
+*              Information and Software Systems Research               *
+*                            AT&T Research                             *
+*                           Florham Park NJ                            *
+*                                                                      *
+*                  David Korn <dgk at research.att.com>                   *
+*                                                                      *
+***********************************************************************/
+#pragma prototyped
+/*
+ * David Korn
+ * AT&T Labs
+ *
+ * Shell interface private definitions
+ *
+ */
+
+#ifndef _REGRESS_H
+#define _REGRESS_H             1
+
+#if SHOPT_REGRESS
+
+typedef struct Regress_s
+{
+       Shopt_t options;
+} Regress_t;
+
+#define sh_isregress(r)                is_option(&sh.regress->options,r)
+#define sh_onregress(r)                on_option(&sh.regress->options,r)
+#define sh_offregress(r)       off_option(&sh.regress->options,r)
+
+#define REGRESS(r,i,f)         do { if (sh_isregress(REGRESS_##r)) 
sh_regress(REGRESS_##r, i, sfprints f, __LINE__, __FILE__); } while (0)
+
+#define REGRESS_egid           1
+#define REGRESS_euid           2
+#define REGRESS_p_suid         3
+#define REGRESS_source         4
+#define REGRESS_etc            5
+
+#undef SHOPT_P_SUID
+#define SHOPT_P_SUID           sh_regress_p_suid(__LINE__, __FILE__)
+
+extern int                     b___regress__(int, char**, void*);
+extern void                    sh_regress_init(Shell_t*);
+extern void                    sh_regress(unsigned int, const char*, const 
char*, unsigned int, const char*);
+extern uid_t                   sh_regress_p_suid(unsigned int, const char*);
+extern char*                   sh_regress_etc(const char*, unsigned int, const 
char*);
+
+#else
+
+#define REGRESS(r,i,f)
+
+#endif /* SHOPT_REGRESS */
+
+#endif /* _REGRESS_H */
--- old/usr/src/lib/libshell/common/include/shell.h     Fri Sep 25 06:33:42 2009
+++ new/usr/src/lib/libshell/common/include/shell.h     Fri Sep 25 06:33:41 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -137,8 +137,8 @@
        int             inlineno;       /* line number of current input file */
        int             exitval;        /* most recent exit value */
        unsigned char   trapnote;       /* set when trap/signal is pending */
-       char            subshell;       /* set for virtual subshell */
        char            shcomp;         /* set when runing shcomp */
+       short           subshell;       /* set for virtual subshell */
 #ifdef _SH_PRIVATE
        _SH_PRIVATE
 #endif /* _SH_PRIVATE */
--- old/usr/src/lib/libshell/common/include/shlex.h     Fri Sep 25 06:33:45 2009
+++ new/usr/src/lib/libshell/common/include/shlex.h     Fri Sep 25 06:33:43 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -41,6 +41,7 @@
        int             lastline;       /* last line number */
        int             lasttok;        /* previous token number */
        int             digits;         /* numerical value with word token */
+       int             nonstandard;    /* nonstandard construct in profile */
        char            aliasok;        /* on when alias is legal */
        char            assignok;       /* on when name=value is legal */
        char            inexec;         /* on when processing exec */
@@ -110,6 +111,7 @@
 #define FALLTHRUSYM    (SYMAMP|';')
 #define COOPSYM                (SYMAMP|'|')
 #define IORDWRSYM      (SYMGT|'<')
+#define IORDWRSYMT     (SYMSEMI|'<')
 #define IOCLOBSYM      (SYMPIPE|'>')
 #define IPROCSYM       (SYMLPAR|'<')
 #define OPROCSYM       (SYMLPAR|'>')
--- old/usr/src/lib/libshell/common/include/shnodes.h   Fri Sep 25 06:33:48 2009
+++ new/usr/src/lib/libshell/common/include/shnodes.h   Fri Sep 25 06:33:46 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -186,6 +186,7 @@
 #define IOARITH                0x40000 /* arithmetic seek <# ((expr))  */
 #define IOREWRITE      0x80000 /* arithmetic seek <# ((expr))  */
 #define IOCOPY         IOCLOB  /* copy skipped lines onto standard output */
+#define IOPROCSUB      IOARITH /* process substitution redirection */
 
 union Shnode_u
 {
--- old/usr/src/lib/libshell/common/include/shtable.h   Fri Sep 25 06:33:51 2009
+++ new/usr/src/lib/libshell/common/include/shtable.h   Fri Sep 25 06:33:49 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/include/streval.h   Fri Sep 25 06:33:54 2009
+++ new/usr/src/lib/libshell/common/include/streval.h   Fri Sep 25 06:33:52 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -151,13 +151,14 @@
 #define A_JMPZ         44
 #define A_JMPNZ                45
 #define A_JMP          46
-#define A_CALL0                47
-#define A_CALL1                48
-#define A_CALL2                49
-#define A_CALL3                50
-#define A_DOT          51
-#define A_LIT          52
-#define A_NOTNOT        53
+#define A_CALL1F       47
+#define A_CALL2F       48
+#define A_CALL3F       49
+#define A_CALL1I       50
+#define A_CALL2I       51
+#define A_DOT          52
+#define A_LIT          53
+#define A_NOTNOT        54
 
 
 /* define error messages */
--- old/usr/src/lib/libshell/common/include/terminal.h  Fri Sep 25 06:33:57 2009
+++ new/usr/src/lib/libshell/common/include/terminal.h  Fri Sep 25 06:33:55 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/include/test.h      Fri Sep 25 06:34:00 2009
+++ new/usr/src/lib/libshell/common/include/test.h      Fri Sep 25 06:33:58 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -51,8 +51,8 @@
 #define TEST_EF                3
 #define TEST_NT                10
 #define TEST_OT                12
-#define TEST_SLT       15
-#define TEST_SGT       16
+#define TEST_SLT       16
+#define TEST_SGT       17
 #define TEST_END       8
 #define TEST_REP       20
 
--- old/usr/src/lib/libshell/common/include/timeout.h   Fri Sep 25 06:34:03 2009
+++ new/usr/src/lib/libshell/common/include/timeout.h   Fri Sep 25 06:34:01 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/include/ulimit.h    Fri Sep 25 06:34:05 2009
+++ new/usr/src/lib/libshell/common/include/ulimit.h    Fri Sep 25 06:34:04 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/include/variables.h Fri Sep 25 06:34:08 2009
+++ new/usr/src/lib/libshell/common/include/variables.h Fri Sep 25 06:34:06 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -69,40 +69,41 @@
 #define LCNUMNOD       (sh.bltin_nodes+39)
 #define FIGNORENOD     (sh.bltin_nodes+40)
 #define VERSIONNOD     (sh.bltin_nodes+41)
-#define DOTSHNOD       (sh.bltin_nodes+42)
-#define ED_CHRNOD      (sh.bltin_nodes+43)
-#define ED_COLNOD      (sh.bltin_nodes+44)
-#define ED_TXTNOD      (sh.bltin_nodes+45)
-#define ED_MODENOD     (sh.bltin_nodes+46)
-#define SH_NAMENOD     (sh.bltin_nodes+47)
-#define SH_SUBSCRNOD   (sh.bltin_nodes+48)
-#define SH_VALNOD      (sh.bltin_nodes+49)
-#define SH_VERSIONNOD  (sh.bltin_nodes+50)
-#define SH_DOLLARNOD   (sh.bltin_nodes+51)
-#define SH_MATCHNOD    (sh.bltin_nodes+52)
-#define SH_COMMANDNOD  (sh.bltin_nodes+53)
-#define SH_PATHNAMENOD (sh.bltin_nodes+54)
-#define SH_FUNNAMENOD  (sh.bltin_nodes+55)
-#define SH_SUBSHELLNOD (sh.bltin_nodes+56)
-#define SH_LEVELNOD    (sh.bltin_nodes+57)
-#define SH_LINENO      (sh.bltin_nodes+58)
-#define SH_STATS       (sh.bltin_nodes+59)
-#define SHLVL          (sh.bltin_nodes+60)
+#define JOBMAXNOD      (sh.bltin_nodes+42)
+#define DOTSHNOD       (sh.bltin_nodes+43)
+#define ED_CHRNOD      (sh.bltin_nodes+44)
+#define ED_COLNOD      (sh.bltin_nodes+45)
+#define ED_TXTNOD      (sh.bltin_nodes+46)
+#define ED_MODENOD     (sh.bltin_nodes+47)
+#define SH_NAMENOD     (sh.bltin_nodes+48)
+#define SH_SUBSCRNOD   (sh.bltin_nodes+49)
+#define SH_VALNOD      (sh.bltin_nodes+50)
+#define SH_VERSIONNOD  (sh.bltin_nodes+51)
+#define SH_DOLLARNOD   (sh.bltin_nodes+52)
+#define SH_MATCHNOD    (sh.bltin_nodes+53)
+#define SH_COMMANDNOD  (sh.bltin_nodes+54)
+#define SH_PATHNAMENOD (sh.bltin_nodes+55)
+#define SH_FUNNAMENOD  (sh.bltin_nodes+56)
+#define SH_SUBSHELLNOD (sh.bltin_nodes+57)
+#define SH_LEVELNOD    (sh.bltin_nodes+58)
+#define SH_LINENO      (sh.bltin_nodes+59)
+#define SH_STATS       (sh.bltin_nodes+60)
+#define SHLVL          (sh.bltin_nodes+61)
 #if SHOPT_FS_3D
-#   define VPATHNOD    (sh.bltin_nodes+61)
+#   define VPATHNOD    (sh.bltin_nodes+62)
 #   define NFS_3D      1
 #else
 #   define NFS_3D      0
 #endif /* SHOPT_FS_3D */
 #if SHOPT_VPIX
-#   define DOSPATHNOD  (sh.bltin_nodes+61+NFS_3D)
-#   define VPIXNOD     (sh.bltin_nodes+62+NFS_3D)
+#   define DOSPATHNOD  (sh.bltin_nodes+62+NFS_3D)
+#   define VPIXNOD     (sh.bltin_nodes+63+NFS_3D)
 #   define NVPIX       (NFS_3D+2)
 #else
 #   define NVPIX       NFS_3D
 #endif /* SHOPT_VPIX */
 #ifdef apollo
-#   define SYSTYPENOD  (sh.bltin_nodes+61+NVPIX)
+#   define SYSTYPENOD  (sh.bltin_nodes+62+NVPIX)
 #endif /* apollo */
 
 #endif /* SH_VALNOD */
--- old/usr/src/lib/libshell/common/include/version.h   Fri Sep 25 06:34:11 2009
+++ new/usr/src/lib/libshell/common/include/version.h   Fri Sep 25 06:34:09 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -17,4 +17,4 @@
 *                  David Korn <dgk at research.att.com>                   *
 *                                                                      *
 ***********************************************************************/
-#define SH_RELEASE     "93t 2008-11-04"
+#define SH_RELEASE     "93t+ 2009-09-09"
--- /dev/null   Fri Sep 25 06:34:14 2009
+++ new/usr/src/lib/libshell/common/scripts/cpvprint.sh Fri Sep 25 06:34:12 2009
@@ -0,0 +1,185 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# cpvprint - compound variable pretty printer
+#
+
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are 
not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+# Make sure all math stuff runs in the "C" locale to avoid problems
+# with alternative # radix point representations (e.g. ',' instead of
+# '.' in de_DE.*-locales). This needs to be set _before_ any
+# floating-point constants are defined in this script).
+if [[ "${LC_ALL}" != "" ]] ; then
+    export \
+        LC_MONETARY="${LC_ALL}" \
+        LC_MESSAGES="${LC_ALL}" \
+        LC_COLLATE="${LC_ALL}" \
+        LC_CTYPE="${LC_ALL}"
+        unset LC_ALL
+fi
+export LC_NUMERIC=C
+
+function fatal_error
+{
+       print -u2 "${progname}: $*"
+       exit 1
+}
+
+function prettyprint_compoundvar
+{
+       nameref var=$1
+
+       # print tree
+       str="${ print -v var ; }"
+       # do some "pretty-printing" for human users (the output is still a
+       # valid compound variable value)
+       # (note: This does not scale well with large files)
+       str="${str//$'\t'typeset -l -E /$'\t'float }"
+       str="${str//$'\t'typeset -l -i /$'\t'integer }"
+       str="${str//$'\t'typeset -C /$'\t'compound }"
+       print -r -- "${str}"
+
+       return 0
+}
+
+function usage
+{
+       OPTIND=0
+       getopts -a "${progname}" "${cpvprint_usage}" OPT '-?'
+       exit 2
+}
+
+# HTML constants
+compound -r hc=(
+       compound -r doctype=(
+               compound -r xhtml=(
+                       typeset -r transitional=$'<!DOCTYPE html\n\tPUBLIC 
"-//W3C//DTD XHTML 1.0 
Transitional//EN"\n\t"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>\n'
+               )
+       )
+       compound -r namespace=(
+               typeset -r xhtml=$'http://www.w3.org/1999/xhtml'
+       )
+       typeset -r xml_head=$'<?xml version="1.0" encoding="UTF-8"?>\n'
+)
+
+# main
+builtin basename
+
+set -o noglob
+set -o errexit
+set -o nounset
+
+# tree variable
+compound tree
+
+typeset progname="${ basename "${0}" ; }"
+
+typeset -r cpvprint_usage=$'+
+[-?\n@(#)\$Id: cpvprint (Roland Mainz) 2009-06-15 \$\n]
+[-author?Roland Mainz <roland.mainz at nrubsig.org>]
+[+NAME?cpvprint - render compound variable trees in various formats]
+[+DESCRIPTION?\bcpvprint\b is converter which reads a ksh compound
+       variable and prints it on a different format. Supported
+       formats are \'default\', \'altdefault\',
+       \'tree\', \'alttree\',
+       \'pretty\', \'pretty.html\', \'list\' and \'fulllist\']
+
+format [ arguments ]
+
+[+SEE ALSO?\bksh93\b(1), \bcpvlint\b(1)]
+'
+
+while getopts -a "${progname}" "${cpvprint_usage}" OPT ; do 
+#      printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
+       case ${OPT} in
+               *) usage ;;
+       esac
+done
+shift $((OPTIND-1))
+
+# prechecks
+(( $# > 0 )) || usage
+
+printformat="$1"
+shift
+
+# read variable
+case $# in
+       0)
+               read -C tree || fatal_error $"Read error."
+               ;;
+       1)
+               integer fd
+
+               redirect {fd}<> "$1" || fatal_error $"Cannot open file."
+               read -u${fd} -C tree || fatal_error $"Read error."
+               redirect {fd}<&- || fatal_error $"Close error."
+               ;;
+       2)
+               print -u2 -f $"%s: Unsupported number of arguments.\n" "$0"
+               exit 1
+               ;;
+esac
+
+# print variable
+case ${printformat} in
+       'default' | 'tree')
+               print -v tree
+               ;;
+       'altdefault' | 'alttree')
+               print -C tree
+               ;;
+       'pretty')
+               # print variable tree (same as $ print -v filetree # except 
that it "looks better")
+               prettyprint_compoundvar tree
+               ;;
+       'pretty.html')
+               printf '%s%s<html xmlns="%s" xml:lang="en" 
lang="en">\n<head><meta name="generator" content="%H" 
/><title>%H</title></head>\n<body><pre>%H\n</pre></body></html>\n' \
+                       "${hc.xml_head}" \
+                       "${hc.doctype.xhtml.transitional}" \
+                       "${hc.namespace.xhtml}" \
+                       "ksh Compound Variable Pretty Printer (cpvprint)" \
+                       "" \
+                       "$(prettyprint_compoundvar tree)" | iconv -f "UTF-8" - -
+               ;;
+       'list')
+               set | egrep '^tree.' | sed 's/^tree\.//' | egrep -v 
'^[[:alnum:]]+(\.([[:alnum:]\.]+)(\[.*\])*)*=\('
+               ;;
+       'fulllist')
+               set | egrep "^tree."
+               ;;
+       *)
+               fatal_error $"Unsupported format."
+               ;;
+esac
+
+exit 0
+# EOF.
--- old/usr/src/lib/libshell/common/scripts/crawlsrccomments.sh Fri Sep 25 
06:34:17 2009
+++ new/usr/src/lib/libshell/common/scripts/crawlsrccomments.sh Fri Sep 25 
06:34:15 2009
@@ -22,7 +22,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -44,7 +44,7 @@
 export LC_NUMERIC=C
 
 # constants values for tokenizer/parser stuff
-typeset -r ch=(
+compound -r ch=(
        newline=$'\n'
        tab=$'\t'
        formfeed=$'\f'
@@ -317,7 +317,7 @@
        integer content_length
 
        integer file_pos # file position
-       typeset line_pos=(
+       compound line_pos=(
                integer x=0 # X position in line
                integer y=0 # Y position in line (line number)
        )
@@ -325,20 +325,20 @@
 
        typeset comment
 
-       typeset state=(
+       compound state=(
                # C comment state
                typeset in_c_comment=false
                # C++ comment state
-               typeset cxx=(
+               compound cxx=(
                        typeset in_comment=false
                        typeset comment_continued=false
                        # position of current //-pos
-                       typeset comment_pos=(
+                       compound comment_pos=(
                                integer x=-1 
                                integer y=-1
                        )
                        # position of previous //-pos
-                       typeset comment_prev_pos=(
+                       compound comment_prev_pos=(
                                integer x=-1
                                integer y=-1
                        )
@@ -708,56 +708,99 @@
        return 0
 }
 
-function cat_http
+function cat_url
 {
        typeset protocol="${1%://*}"
        typeset path1="${1#*://}" # "http://foo.bat.net/x/y.html"; ----> 
"foo.bat.net/x/y.html"
-
-       typeset host="${path1%%/*}"
-       typeset path="${path1#*/}"
-       typeset port="${host##*:}"
+       
+       if [[ "${protocol}" == "file" ]] ; then
+               cat "${path1}"
+               return $?
+       elif [[ "${protocol}" == ~(Elr)http(|s) ]] ; then
+               typeset host="${path1%%/*}"
+               typeset path="${path1#*/}"
+               typeset port="${host##*:}"
     
-       integer netfd
-       typeset -C httpresponse # http response
+               integer netfd
+               compound httpresponse # http response
 
-       # If URL did not contain a port number in the host part then look at the
-       # protocol to get the port number
-       if [[ "${port}" == "${host}" ]] ; then
-               case "${protocol}" in
-                       "http") port=80 ;;
-                       *)      port="$(getent services "${protocol}" | sed 
's/[^0-9]*//;s/\/.*//')" ;;
-               esac
-       else
-               host="${host%:*}"
-       fi
+               # If URL did not contain a port number in the host part then 
look at the
+               # protocol to get the port number
+               if [[ "${port}" == "${host}" ]] ; then
+                       case "${protocol}" in
+                               "http")  port=80 ;;
+                               "https") port=443 ;;
+                               *)       port="$(getent services "${protocol}" 
| sed 's/[^0-9]*//;s/\/.*//')" ;;
+                       esac
+               else
+                       host="${host%:*}"
+               fi
     
-       printmsg "protocol=${protocol} port=${port} host=${host} path=${path}"
+               printmsg "protocol=${protocol} port=${port} host=${host} 
path=${path}"
     
-       # prechecks
-       [[ "${protocol}" == "" ]] && { print -u2 -f "%s: protocol not set.\n" 
"$0" ; return 1 ; }
-       [[ "${port}"     == "" ]] && { print -u2 -f "%s: port not set.\n"     
"$0" ; return 1 ; }
-       [[ "${host}"     == "" ]] && { print -u2 -f "%s: host not set.\n"     
"$0" ; return 1 ; }
-       [[ "${path}"     == "" ]] && { print -u2 -f "%s: path not set.\n"     
"$0" ; return 1 ; }
+               # prechecks
+               [[ "${protocol}" != "" ]] || { print -u2 -f "%s: protocol not 
set.\n" "$0" ; return 1 ; }
+               [[ "${port}"     != "" ]] || { print -u2 -f "%s: port not 
set.\n"     "$0" ; return 1 ; }
+               [[ "${host}"     != "" ]] || { print -u2 -f "%s: host not 
set.\n"     "$0" ; return 1 ; }
+               [[ "${path}"     != "" ]] || { print -u2 -f "%s: path not 
set.\n"     "$0" ; return 1 ; }
 
-       # open TCP channel
-       redirect {netfd}<>"/dev/tcp/${host}/${port}"
-       (( $? != 0 )) && { print -u2 -f "%s: Couldn't open %s\n" "$0" "${1}" ; 
return 1 ; }
+               # open TCP channel
+               if [[ "${protocol}" == "https" ]] ; then
+                       compound sslfifo
+                       sslfifo.dir="$(mktemp -d)"
+                       sslfifo.in="${sslfifo.dir}/in"
+                       sslfifo.out="${sslfifo.dir}/out"
+                       
+                       # register an EXIT trap and use "errexit" to leave it 
at the first error
+                       # (this saves lots of if/fi tests for error checking)
+                       trap "rm -r \"${sslfifo.dir}\"" EXIT 
+                       set -o errexit
+                               
+                       mkfifo "${sslfifo.in}" "${sslfifo.out}"
 
-       # send HTTP request    
-       request="GET /${path} HTTP/1.1\r\n"
-       request+="Host: ${host}\r\n"
-       request+="User-Agent: crawlsrccomments/ksh93 (2008-06-14; $(uname -s -r 
-p))\r\n"
-       request+="Connection: close\r\n"
-       print -n -- "${request}\r\n" >&${netfd}
+                       # create async openssl child to handle https
+                       openssl s_client -quiet -connect "${host}:${port}" 
<"${sslfifo.in}" >>"${sslfifo.out}" &
+
+                       # send HTTP request    
+                       request="GET /${path} HTTP/1.1\r\n"
+                       request+="Host: ${host}\r\n"
+                       request+="User-Agent: crawlsrccomments/ksh93(ssl) 
(2009-05-08; $(uname -s -r -p))\r\n"
+                       request+="Connection: close\r\n"
+                       print -n -- "${request}\r\n" >> "${sslfifo.in}"
+                       
+                       # collect response and send it to stdout
+                       {
+                               parse_http_response httpresponse
+                               cat_http_body 
"${httpresponse.transfer_encoding}"
+                       } <"${sslfifo.out}"
+                       
+                       wait || { print -u2 -f "%s: openssl failed.\n" ; exit 1 
; }
+                                       
+                       return 0
+               else
+                       redirect {netfd}<> "/dev/tcp/${host}/${port}"
+                       (( $? != 0 )) && { print -u2 -f "%s: Could not open 
%s\n" "$0" "${1}" ; return 1 ; }
+
+                       # send HTTP request    
+                       request="GET /${path} HTTP/1.1\r\n"
+                       request+="Host: ${host}\r\n"
+                       request+="User-Agent: crawlsrccomments/ksh93 
(2009-05-08; $(uname -s -r -p))\r\n"
+                       request+="Connection: close\r\n"
+                       print -n -- "${request}\r\n" >&${netfd}
     
-       # collect response and send it to stdout
-       parse_http_response httpresponse <&${netfd}
-       cat_http_body "${httpresponse.transfer_encoding}" <&${netfd}
+                       # collect response and send it to stdout
+                       parse_http_response httpresponse <&${netfd}
+                       cat_http_body "${httpresponse.transfer_encoding}" 
<&${netfd}
     
-       # close connection
-       redirect {netfd}<&-
-       
-       return 0
+                       # close connection
+                       redirect {netfd}<&-
+                       
+                       return 0
+               fi
+       else
+               return 1
+       fi
+       # notreached
 }
 
 function print_stats
@@ -765,7 +808,7 @@
        set -o errexit
 
        # gather some statistics
-       typeset stats=(
+       compound stats=(
                integer files_with_comments=0
                integer files_without_comments=0
 
@@ -797,7 +840,7 @@
                (( stats.total_num_files++ ))
        done
 
-       printf "%B\n" stats
+       print -v stats
        return 0
 }
 
@@ -951,7 +994,7 @@
 {
        set -o errexit
 
-       typeset options=(
+       compound options=(
                integer max_filesize_for_scan=$((256*1024))
                integer max_num_comments=$((2**62)) # FIXME: This should be 
"+Inf" (=Infinite)
        )
@@ -967,7 +1010,7 @@
        done
        shift $((OPTIND-1))
        
-       typeset scan=(
+       compound scan=(
                typeset -A records
        )
 
@@ -978,8 +1021,7 @@
        done
 
        # print compound variable array (we strip the "typeset -A records" for 
now)
-       printf "%B\n" scan | 
-               sed $'s/^#.*$//;s/^\(//;s/^\)//;s/^\ttypeset -A 
records=\(//;s/^\t\)//' >"crawlsrccomments_extracted_comments.cpv"
+       print -v scan >"crawlsrccomments_extracted_comments.cpv"
                
        print "# Wrote results to crawlsrccomments_extracted_comments.cpv"
 
@@ -991,22 +1033,20 @@
        set -o errexit
 
        # vars
-       typeset scan=(
-               typeset -A records
-       )
+       compound scan
        typeset database
        typeset tmp
 
-       typeset options=(
+       compound options=(
                typeset database="crawlsrccomments_extracted_comments.cpv"
 
                typeset print_stats=false
                typeset zapduplicates=false
-               typeset filepattern=(
+               compound filepattern=(
                        typeset accept="*"
                        typeset reject=""
                )
-               typeset commentpattern=(
+               compound commentpattern=(
                        typeset accept="~(Ei)(license|copyright)"
                        typeset reject=""
                )
@@ -1035,11 +1075,11 @@
        trap 'set -o errexit ; print -u2 "# Cleaning up..." ; ((${#tmpfil...@]} 
> 0)) && rm -- "${tmpfil...@]}" ; print -u2 "# Done."' EXIT
 
        # Support for HTTP URLs
-       if [[ "${options.database}" == ~(El)http://.* ]] ; then
-               database="/tmp/extract_license_cat_http_${PPID}_$$.tmp"
+       if [[ "${options.database}" == ~(El)(http|https)://.* ]] ; then
+               database="/tmp/extract_license_cat_url_${PPID}_$$.tmp"
                tmpfiles+=( "${database}" )
                print -u2 "# Loading URL..."
-               cat_http "${options.database}" >"${database}"
+               cat_url "${options.database}" >"${database}"
                print -u2 "# Loading URL done."
        else
                database="${options.database}"
@@ -1071,11 +1111,7 @@
 
        # Read compound variable which contain all recorded comments
        print -u2 "# reading records..."
-       {
-               printf "("
-               cat "${database}"
-               printf ")\n"
-       } | read -C scan.records || fatal_error 'Error reading data.'
+       read -C scan <"${database}" || fatal_error 'Error reading data.'
        print -u2 -f "# reading %d records done.\n" "${#scan.recor...@]}"
 
        # print comments
@@ -1105,7 +1141,7 @@
 }
 
 typeset -r do_getcomments_usage=$'+
-[-?\n@(#)\$Id: getcomments (Roland Mainz) 2008-10-14 \$\n]
+[-?\n@(#)\$Id: getcomments (Roland Mainz) 2009-05-09 \$\n]
 [-author?Roland Mainz <roland.mainz at sun.com>]
 [+NAME?getcomments - extract license information from source files]
 [+DESCRIPTION?\bgetcomments\b is a small utilty script which extracts
@@ -1117,7 +1153,7 @@
        the comments and stores this information in a "database" file called
        "crawlsrccomments_extracted_comments.cpv" and then \bextract_license\b 
allows
        queries on this database.]
-[D:database?Database file for input (either file or http://-URL).]:[database]
+[D:database?Database file for input (either file, http:// or 
https://-URL).]:[database]
 [l:acceptfilepattern?Process only files which match pattern.]:[pattern]
 [L:rejectfilepattern?Process only files which do not match pattern.]:[pattern]
 [c:acceptcommentpattern?Match comments which match pattern. Defaults to 
~(Ei)(license|copyright)]:[pattern]
@@ -1128,7 +1164,7 @@
 '
 
 typeset -r do_crawl_usage=$'+
-[-?\n@(#)\$Id: crawl (Roland Mainz) 2008-10-14 \$\n]
+[-?\n@(#)\$Id: crawl (Roland Mainz) 2009-05-09 \$\n]
 [-author?Roland Mainz <roland.mainz at sun.com>]
 [+NAME?crawl - crawl comment information from source files]
 [+DESCRIPTION?\bcrawl\b is a small utilty script which reads
@@ -1144,7 +1180,7 @@
 '
 
 typeset -r crawlsrccomments_usage=$'+
-[-?\n@(#)\$Id: crawlsrccomments (Roland Mainz) 2008-10-14 \$\n]
+[-?\n@(#)\$Id: crawlsrccomments (Roland Mainz) 2009-05-09 \$\n]
 [-author?Roland Mainz <roland.mainz at sun.com>]
 [+NAME?crawlsrccomments - extract and filter comment information from source 
files]
 [+DESCRIPTION?\bcrawlsrccomments\b is a small utilty script which reads
--- old/usr/src/lib/libshell/common/scripts/filetree1.sh        Fri Sep 25 
06:34:20 2009
+++ new/usr/src/lib/libshell/common/scripts/filetree1.sh        Fri Sep 25 
06:34:18 2009
@@ -60,8 +60,8 @@
        typeset i
        typeset dummy
        
-       typeset -A tree.files
-       typeset -A tree.dirs
+       typeset -C -A tree.files
+       typeset -C -A tree.dirs
 
        find "${basedir}"/* -prune 2>/dev/null | while read i ; do
                dirname="$(dirname "$i")"
@@ -169,7 +169,7 @@
 typeset progname="${ basename "${0}" ; }"
 
 typeset -r filetree1_usage=$'+
-[-?\n@(#)\$Id: filetree1 (Roland Mainz) 2008-10-14 \$\n]
+[-?\n@(#)\$Id: filetree1 (Roland Mainz) 2009-05-06 \$\n]
 [-author?Roland Mainz <roland.mainz at sun.com>]
 [-author?Roland Mainz <roland.mainz at nrubsig.org>]
 [+NAME?filetree1 - file tree demo]
@@ -177,7 +177,7 @@
        which accepts a directory name as input, and then builds tree
        nodes for all files+directories and stores all file attributes
        in these notes and then outputs the tree in the format
-       specified by viewmode (either "list", "namelist" or "tree")..]
+       specified by viewmode (either "list", "namelist", "tree" or 
"compacttree")..]
 
 viewmode dirs
 
@@ -195,7 +195,7 @@
 typeset viewmode="$1"
 shift
 
-if [[ "${viewmode}" != ~(Elr)(list|namelist|tree) ]] ; then
+if [[ "${viewmode}" != ~(Elr)(list|namelist|tree|compacttree) ]] ; then
        fatal_error $"Invalid view mode \"${viewmode}\"."
 fi
 
@@ -216,8 +216,11 @@
                typeset + | egrep "^myfiletree\["
                ;;
        tree)
-               printf "%B\n" myfiletree
+               print -v myfiletree
                ;;
+       compacttree)
+               print -C myfiletree
+               ;;
        *)
                fatal_error $"Invalid view mode \"${viewmode}\"."
                ;;
--- old/usr/src/lib/libshell/common/scripts/gnaw.sh     Fri Sep 25 06:34:23 2009
+++ new/usr/src/lib/libshell/common/scripts/gnaw.sh     Fri Sep 25 06:34:21 2009
@@ -22,7 +22,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -926,7 +926,7 @@
 typeset progname="${ basename "${0}" ; }"
 
 # terminal size rect
-typeset -C termsize=(
+compound termsize=(
     integer columns=-1
     integer lines=-1
 )
@@ -942,7 +942,7 @@
 integer game_use_unicode=0
 
 typeset -r gnaw_usage=$'+
-[-?\n@(#)\$Id: gnaw (Roland Mainz) 2008-11-04 \$\n]
+[-?\n@(#)\$Id: gnaw (Roland Mainz) 2009-05-09 \$\n]
 [-author?Roland Mainz <roland.mainz at nrubsig.org>]
 [+NAME?gnaw - maze game written in ksh93]
 [+DESCRIPTION?\bgnaw\b is a maze game.
--- old/usr/src/lib/libshell/common/scripts/mandelbrotset1.sh   Fri Sep 25 
06:34:26 2009
+++ new/usr/src/lib/libshell/common/scripts/mandelbrotset1.sh   Fri Sep 25 
06:34:24 2009
@@ -22,7 +22,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -71,12 +71,6 @@
        return 0
 }
 
-function print_color
-{
-       print -r -n -- "${symbollist:${1}:1}"
-       return 0
-}
-
 function mandelbrot
 {
        nameref result=$1
@@ -109,16 +103,19 @@
 function loop_serial
 {
        integer value
+       typeset line=""
 
        for (( y=y_min ; y < y_max ; y+=stepwidth )) ; do
                for (( x=x_min ; x < x_max ; x+=stepwidth )) ; do
                        mandelbrot value ${x} ${y} ${x} ${y} 1 ${symbollistlen}
-                       print_color ${value}
+                       line+="${symbollist:value:1}"
                done
 
-               print
+               line+=$'\n'
        done
-
+       
+       print -r -- "${line}"
+       
        return 0
 }
 
@@ -128,6 +125,7 @@
        integer numjobs=0
        # the following calculation suffers from rounding errors
        integer lines_per_job=$(( ((m_height+(numcpus-1)) / numcpus) ))
+       typeset tmpjobdir
 
        printmsg $"# lines_per_job=${lines_per_job}"
        printmsg $"# numcpus=${numcpus}"
@@ -135,9 +133,8 @@
        # "renice" worker jobs
        set -o bgnice
 
-       if [[ "${TMPDIR}" == "" ]] ; then
-               TMPDIR="/tmp"
-       fi
+       tmpjobdir="$(mktemp --default=/tmp --directory 
"mandelbrotset1${PPID}_$$_XXXXXX")" || fatal_error $"Could not create temporary 
directory."
+       trap "rm -r ${tmpjobdir}" EXIT # cleanup
 
        # try to generate a job identifer prefix which is unique across 
multiple hosts
        jobident="job_host_$(uname -n)pid_$$_ppid${PPID}"
@@ -144,7 +141,7 @@
 
        printmsg $"## prepare..."
        for (( y=y_min ; y < y_max ; y+=(stepwidth*lines_per_job) )) ; do
-               rm -f "${TMPDIR}/mandelbrot_${jobident}_child_$y.joboutput"
+               rm -f "${tmpjobdir}/${jobident}_child_$y.joboutput"
 
                (( numjobs++ ))
        done
@@ -153,15 +150,21 @@
        for (( y=y_min ; y < y_max ; y+=(stepwidth*lines_per_job) )) ; do
                (
                        integer value
+                       typeset line=""
+                       # save file name since we're going to modify "y"
+                       typeset 
filename="${tmpjobdir}/${jobident}_child_$y.joboutput"
 
                        for (( ; y < y_max && lines_per_job-- > 0 ; 
y+=stepwidth )) ; do
                                for (( x=x_min ; x < x_max ; x+=stepwidth )) ; 
do
                                        mandelbrot value ${x} ${y} ${x} ${y} 1 
${symbollistlen}
-                                       print_color ${value}
+                                       line+="${symbollist:value:1}"
                                done
 
-                               print
-                       done 
>"${TMPDIR}/mandelbrot_${jobident}_child_$y.joboutput"
+                               line+=$'\n'
+                       done
+                       print -r -- "${line}" >"${filename}"
+                       
+                       exit 0
                ) &
        done
 
@@ -170,8 +173,8 @@
 
        printmsg $"## output:"
        for (( y=y_min ; y < y_max ; y+=(stepwidth*lines_per_job) )) ; do
-               print -- "$( < 
"${TMPDIR}/mandelbrot_${jobident}_child_$y.joboutput")"
-               rm "${TMPDIR}/mandelbrot_${jobident}_child_$y.joboutput"
+               print -r -- "$( < 
"${tmpjobdir}/${jobident}_child_$y.joboutput")"
+               # EXIT trap will cleanup temporary files
        done
 
        return 0
@@ -189,7 +192,11 @@
 builtin cat
 builtin rm
 builtin uname # loop_parallel needs the ksh93 builtin version to generate 
unique job file names
+builtin mktemp
 
+set -o noglob
+set -o nounset
+
 typeset progname="${ basename "${0}" ; }"
 
 float x_max
@@ -203,7 +210,7 @@
 integer numcpus
 
 # terminal size rect
-typeset -C termsize=(
+compound termsize=(
        integer columns=-1
        integer lines=-1
 )
@@ -221,7 +228,7 @@
 (( m_width=termsize.columns-1 , m_height=termsize.lines-2 ))
 
 typeset -r mandelbrotset1_usage=$'+
-[-?\n@(#)\$Id: mandelbrotset1 (Roland Mainz) 2008-11-04 \$\n]
+[-?\n@(#)\$Id: mandelbrotset1 (Roland Mainz) 2009-06-14 \$\n]
 [-author?Roland Mainz <roland.mainz at nrubsig.org>]
 [+NAME?mandelbrotset1 - generate mandelbrot set fractals with ksh93]
 [+DESCRIPTION?\bmandelbrotset1\b mandelbrot set fractal generator
@@ -247,7 +254,9 @@
                m)      max_mag="${OPTARG}"     ;;
                p)      stepwidth="${OPTARG}"   ;;
                S)      mode="serial"           ;;
+               +S)     mode="parallel"         ;;
                P)      mode="parallel"         ;;
+               +P)     mode="serial"           ;;
                M)      mode="${OPTARG}"        ;;
                C)      numcpus="${OPTARG}"     ;;
                *)      usage                   ;;
--- old/usr/src/lib/libshell/common/scripts/multifollow.sh      Fri Sep 25 
06:34:29 2009
+++ new/usr/src/lib/libshell/common/scripts/multifollow.sh      Fri Sep 25 
06:34:27 2009
@@ -22,7 +22,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -64,7 +64,7 @@
 typeset progname="$(basename "${0}")"
 
 typeset -r multifollow_usage=$'+
-[-?\n@(#)\$Id: multifollow (Roland Mainz) 2008-10-14 \$\n]
+[-?\n@(#)\$Id: multifollow (Roland Mainz) 2009-04-08 \$\n]
 [-author?Roland Mainz <roland.mainz at nrubsig.org>]
 [+NAME?multifollow - use tail -f on multiple files]
 [+DESCRIPTION?\bmultifollow\b is a small utilty which can "follow" multiple
@@ -109,7 +109,7 @@
     )
 
     mkfifo "${files[${numfiles}].pipename}"
-    redirect {files[numfiles].fd}<>"${files[numfiles].pipename}"
+    redirect {files[numfiles].fd}<> "${files[numfiles].pipename}"
 
     tail -f "${files[${numfiles}].name}" >"${files[${numfiles}].pipename}" &
     files[${numfiles}].childpid=$!
--- /dev/null   Fri Sep 25 06:34:32 2009
+++ new/usr/src/lib/libshell/common/scripts/numtree1.sh Fri Sep 25 06:34:30 2009
@@ -0,0 +1,219 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# numtree1 - basic compound variable tree demo+benchmark
+#
+
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are 
not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+# Make sure all math stuff runs in the "C" locale to avoid problems
+# with alternative # radix point representations (e.g. ',' instead of
+# '.' in de_DE.*-locales). This needs to be set _before_ any
+# floating-point constants are defined in this script).
+if [[ "${LC_ALL}" != "" ]] ; then
+    export \
+        LC_MONETARY="${LC_ALL}" \
+        LC_MESSAGES="${LC_ALL}" \
+        LC_COLLATE="${LC_ALL}" \
+        LC_CTYPE="${LC_ALL}"
+        unset LC_ALL
+fi
+export LC_NUMERIC=C
+
+function fatal_error
+{
+       print -u2 "${progname}: $*"
+       exit 1
+}
+
+function add_number_to_tree
+{
+       typeset treename=$1
+       integer num=$2
+       integer i
+       typeset nodepath # full name of compound variable
+       integer -a pe # path elements
+
+       # first built an array containing the names of each path element
+       # (e.g. "135" results in an array containing "( 1 3 5 )")
+       for (( i=$(rev <<<$num) ; i > 0 ; i=i/10 )) ; do
+               pe+=( $((i % 10)) )
+       done
+
+       # walk path described via the "pe" array and build nodes if
+       # there aren't any nodes yet
+       nodepath="${treename}"
+       for (( i=0 ; i < ${#...@]} ; i++ )) ; do
+               nameref x="${nodepath}"
+               [[ ! -v x.node ]] && compound -C -a x.nodes
+       
+               nodepath+=".nodes[${pe[i]}]"
+       done
+       
+       # insert element
+       nameref node="${nodepath}"
+       [[ ! -v node.elements ]] && integer -a node.elements
+       node.elements+=( ${num} )
+       
+       return 0
+}
+
+
+# floating-point version of "seq"
+function floatseq
+{
+       float i
+       float arg1=$1
+       float arg2=$2
+       float arg3=$3
+
+       case $# in
+               1)
+                       for (( i=1. ; i <= arg1 ; i=i+1. )) ; do
+                               printf "%a\n" i
+                       done
+                       ;;
+               2)
+                       for (( i=arg1 ; i <= arg2 ; i=i+1. )) ; do
+                               printf "%a\n" i
+                       done
+                       ;;
+               3)
+                       for (( i=arg1 ; i <= arg3 ; i+=arg2 )) ; do
+                               printf "%a\n" i
+                       done
+                       ;;
+               *)
+                       print -u2 -f "%s: Illegal number of arguments %d\n" 
"$0" $#
+                       return 1
+                       ;;
+       esac
+       
+       return 0
+}
+
+
+function usage
+{
+       OPTIND=0
+       getopts -a "${progname}" "${numtree1_usage}" OPT '-?'
+       exit 2
+}
+
+# main
+builtin basename
+builtin rev
+
+set -o noglob
+set -o errexit
+set -o nounset
+
+compound base
+
+compound bench=(
+       float start
+       float stop
+)
+
+integer i
+
+typeset progname="${ basename "${0}" ; }"
+
+typeset -r numtree1_usage=$'+
+[-?\n@(#)\$Id: numtree1 (Roland Mainz) 2009-08-17 \$\n]
+[-author?Roland Mainz <roland.mainz at nrubsig.org>]
+[+NAME?numtree1 - generate sorted variable tree containing numbers]
+[+DESCRIPTION?\bnumtree1\b is a simple variable tree generator
+       sorts a given set of numbers into a ksh compound variable tree).
+       the application supports two different modes: \'seq\' takes
+       1-3 arguments to specify the set of numbers via seq(1) and
+       \'stdin\' reads the numbers from stdin (one per line)]
+
+method [ arguments ]
+
+[+SEE ALSO?\bksh93\b(1), \bseq\b(1)]
+'
+
+while getopts -a "${progname}" "${numtree1_usage}" OPT ; do 
+#      printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
+       case ${OPT} in
+               *) usage ;;
+       esac
+done
+shift $((OPTIND-1))
+
+# prechecks
+(( $# > 0 )) || usage
+
+cmd=$1
+shift
+
+# Read numbers from stdin outside benchmark loop
+if [[ ${cmd} == 'stdin' ]] ; then
+       stdin_numbers="$( cat /dev/stdin )" || fatal_error "stdin read error"
+fi
+
+(( bench.start=SECONDS ))
+
+case ${cmd} in
+       "seq")
+               for i in ${ floatseq "$@" ; } ; do
+                       add_number_to_tree base "${i}"
+               done
+               ;;
+       "stdin")
+               for i in ${stdin_numbers} ; do
+                       add_number_to_tree base "${i}"
+               done
+               ;;
+       "demo1")
+               for i in 1 32 33 34 34 38 90 ; do
+                       add_number_to_tree base "${i}"
+               done
+               ;;
+       "demo2")
+               for (( i=1000000000 ; i < 1000000000+10 ; i++ )) ; do
+                       add_number_to_tree base "$i"
+               done
+               ;;
+       *)
+               fatal_error "Invalid command ${cmd}."
+               ;;
+esac
+
+(( bench.stop=SECONDS ))
+
+print -u2 -f "# time used: %f\n" $((bench.stop - bench.start))
+
+# print tree
+print -v base
+
+exit 0
+# EOF.
--- old/usr/src/lib/libshell/common/scripts/rssread.sh  Fri Sep 25 06:34:35 2009
+++ new/usr/src/lib/libshell/common/scripts/rssread.sh  Fri Sep 25 06:34:33 2009
@@ -22,7 +22,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -51,113 +51,224 @@
        exit 1
 }
 
-# parse HTTP return code, cookies etc.
-function parse_http_response
-{
-       nameref response="$1"
-       typeset h statuscode statusmsg i
-    
-       # we use '\r' as additional IFS to filter the final '\r'
-       IFS=$' \t\r' read -r h statuscode statusmsg  # read HTTP/1.[01] <code>
-       [[ "$h" != ~(Eil)HTTP/.* ]]         && { print -u2 -f $"%s: HTTP/ 
header missing\n" "$0" ; return 1 ; }
-       [[ "$statuscode" != ~(Elr)[0-9]* ]] && { print -u2 -f $"%s: invalid 
status code\n"  "$0" ; return 1 ; }
-       response.statuscode="$statuscode"
-       response.statusmsg="$statusmsg"
-    
-       # skip remaining headers
-       while IFS='' read -r i ; do
-               [[ "$i" == $'\r' ]] && break
+typeset -T urlconnection_t=(
+       # public
+       typeset user_agent="ksh93/urlconnection_t"
 
-               # strip '\r' at the end
-               i="${i/~(Er)$'\r'/}"
+       # private variables
+       typeset protocol
+       typeset path1
+       typeset host
+       typeset path
+       typeset port
+       
+       compound netfd=(
+               integer in=-1  # incoming traffic
+               integer out=-1 # outgoing traffic
+       )
 
-               case "$i" in
-                       ~(Eli)Content-Type:.*)
-                               
response.content_type="${i/~(El).*:[[:blank:]]*/}"
-                               ;;
-                       ~(Eli)Content-Length:[[:blank:]]*[0-9]*)
-                               integer 
response.content_length="${i/~(El).*:[[:blank:]]*/}"
-                               ;;
-                       ~(Eli)Transfer-Encoding:.*)
-                               
response.transfer_encoding="${i/~(El).*:[[:blank:]]*/}"
-                               ;;
-               esac
-       done
+       # only used for https
+       compound ssl=(
+               compound fifo=(
+                       typeset dir=""
+                       typeset in=""
+                       typeset out=""
+               )
+               integer openssl_client_pid=-1
+       )
+                               
+       # parse HTTP return code, cookies etc.
+       function parse_http_response
+       {
+               nameref response="$1"
+               typeset h statuscode statusmsg i
 
-       return 0
-}
+               # we use '\r' as additional IFS to filter the final '\r'
+               IFS=$' \t\r' read -r h statuscode statusmsg # read HTTP/1.[01] 
<code>
+               [[ "$h" != ~(Eil)HTTP/.* ]]         && { print -u2 -f $"%s: 
HTTP/ header missing\n" "$0" ; return 1 ; }
+               [[ "$statuscode" != ~(Elr)[0-9]* ]] && { print -u2 -f $"%s: 
invalid status code\n"  "$0" ; return 1 ; }
+               response.statuscode="$statuscode"
+               response.statusmsg="$statusmsg"
 
-function cat_http_body
-{
-       typeset emode="$1"
-       typeset hexchunksize="0"
-       integer chunksize=0 
-    
-       if [[ "${emode}" == "chunked" ]] ; then
-               while IFS=$'\r' read hexchunksize &&
-                       [[ "${hexchunksize}" == ~(Elri)[0-9abcdef]* ]] &&
-                       (( chunksize=16#${hexchunksize} )) && (( chunksize > 0 
)) ; do
-                       dd bs=1 count="${chunksize}" 2>/dev/null
-               done
-       else
-               cat
-       fi
+               # skip remaining headers
+               while IFS='' read -r i ; do
+                       [[ "$i" == $'\r' ]] && break
 
-       return 0
-}
+                       # strip '\r' at the end
+                       i="${i/~(Er)$'\r'/}"
 
-function cat_http
-{
-       typeset protocol="${1%://*}"
-       typeset path1="${1#*://}" # "http://foo.bat.net/x/y.html"; ----> 
"foo.bat.net/x/y.html"
+                       case "$i" in
+                               ~(Eli)Content-Type:.*)
+                                       
response.content_type="${i/~(El).*:[[:blank:]]*/}"
+                                       ;;
+                               ~(Eli)Content-Length:[[:blank:]]*[0-9]*)
+                                       integer 
response.content_length="${i/~(El).*:[[:blank:]]*/}"
+                                       ;;
+                               ~(Eli)Transfer-Encoding:.*)
+                                       
response.transfer_encoding="${i/~(El).*:[[:blank:]]*/}"
+                                       ;;
+                       esac
+               done
 
-       typeset host="${path1%%/*}"
-       typeset path="${path1#*/}"
-       typeset port="${host##*:}"
-    
-       integer netfd
-       typeset -C httpresponse # http response
+               return 0
+       }
 
-       # If URL did not contain a port number in the host part then look at the
-       # protocol to get the port number
-       if [[ "${port}" == "${host}" ]] ; then
-               case "${protocol}" in
-                       "http") port=80 ;;
-                       *)      port="$(getent services "${protocol}" | sed 
's/[^0-9]*//;s/\/.*//')" ;;
-               esac
-       else
-               host="${host%:*}"
-       fi
-    
-       printmsg "protocol=${protocol} port=${port} host=${host} path=${path}"
-    
-       # prechecks
-       [[ "${protocol}" == "" ]] && { print -u2 -f "%s: protocol not set.\n" 
"$0" ; return 1 ; }
-       [[ "${port}"     == "" ]] && { print -u2 -f "%s: port not set.\n"     
"$0" ; return 1 ; }
-       [[ "${host}"     == "" ]] && { print -u2 -f "%s: host not set.\n"     
"$0" ; return 1 ; }
-       [[ "${path}"     == "" ]] && { print -u2 -f "%s: path not set.\n"     
"$0" ; return 1 ; }
+       function cat_http_body
+       {
+               typeset emode="$1"
+               typeset hexchunksize="0"
+               integer chunksize=0 
 
-       # open TCP channel
-       redirect {netfd}<>"/dev/tcp/${host}/${port}"
-       (( $? != 0 )) && { print -u2 -f "%s: Couldn't open %s\n" "$0" "${1}" ; 
return 1 ; }
+               if [[ "${emode}" == "chunked" ]] ; then
+                       while IFS=$'\n' read hexchunksize ; do
+                               hexchunksize="${hexchunksize//$'\r'/}"
+                               [[ "${hexchunksize}" != "" ]] || continue
+                               [[ "${hexchunksize}" == ~(Elri)[0-9abcdef]+ ]] 
|| break
+                               (( chunksize=16#${hexchunksize} ))
+                               (( chunksize > 0 )) || break
+                               dd bs=1 count="${chunksize}" 2>/dev/null
+                       done
+               else
+                       cat
+               fi
 
-       # send HTTP request    
-       request="GET /${path} HTTP/1.1\r\n"
-       request+="Host: ${host}\r\n"
-       request+="User-Agent: rssread/ksh93 (2008-10-14; $(uname -s -r -p))\r\n"
-       request+="Connection: close\r\n"
-       print -n -- "${request}\r\n" >&${netfd}
-    
-       # collect response and send it to stdout
-       parse_http_response httpresponse <&${netfd}
-       cat_http_body "${httpresponse.transfer_encoding}" <&${netfd}
-    
+               return 0
+       }
+       
+       function init_url
+       {
+               _.protocol="${1%://*}"
+               _.path1="${1#*://}" # "http://foo.bat.net/x/y.html"; ----> 
"foo.bat.net/x/y.html"
+
+               if  [[ "${_.protocol}" == ~(Elr)http(|s) ]] ; then
+                       _.host="${_.path1%%/*}"
+                       _.path="${_.path1#*/}"
+                       _.port="${_.host##*:}"
+               fi
+               
+               return 0
+       }
+       
        # close connection
-       redirect {netfd}<&-
+       function close_connection
+       {
+               integer ret
+               
+               if (( _.netfd.in != -1 )) ; then
+                       redirect {_.netfd.in}<&-
+                       (( _.netfd.in=-1 ))
+               fi
+               
+               if (( _.netfd.in != _.netfd.out && _.netfd.out != -1 )) ; then
+                       redirect {_.netfd.out}<&-
+                       ((  _.netfd.out=-1 ))
+               fi
+
+               if [[ "${_.protocol}" == "https" ]] ; then
+                       wait ${_.ssl.openssl_client_pid} || { print -u2 -f "%s: 
openssl failed.\n" ; return 1 ; }
+                       (( _.ssl.openssl_client_pid=-1 ))
+                               
+                       rm -r \"${_.ssl.fifo.dir}\"
+                       _.ssl.fifo.dir=""
+               fi
+                                               
+               return 0
+       }
        
-       return 0
-}
+       function open_connection
+       {
+               if [[ "${_.protocol}" == "https" ]] ; then
+                       _.ssl.fifo.dir="$(mktemp -d)"
+                       _.ssl.fifo.in="${_.ssl.fifo.dir}/in"
+                       _.ssl.fifo.out="${_.ssl.fifo.dir}/out"
 
+                       # Use "errexit" to leave it at the first error
+                       # (this saves lots of if/fi tests for error checking)
+                       set -o errexit
+
+                       mkfifo "${_.ssl.fifo.in}" "${_.ssl.fifo.out}"
+
+                       # create async openssl child to handle https
+                       openssl s_client -quiet -connect "${_.host}:${_.port}" 
<"${_.ssl.fifo.in}" >>"${_.ssl.fifo.out}" &
+                       
+                       _.ssl.openssl_client_pid=$!
+               else
+                       redirect {_.netfd.in}<> "/dev/tcp/${_.host}/${_.port}"
+                       (( $? != 0 )) && { print -u2 -f "%s: Could not open 
%s\n" "$0" "${1}" ; return 1 ; }
+                       (( _.netfd.out=_.netfd.in ))
+               fi
+               return 0
+       }
+
+       function send_request
+       {
+               typeset request="$1"
+               
+               set -o errexit
+               
+               if [[ "${_.protocol}" == "https" ]] ; then
+                               print -n -- "${request}\r\n" >> 
"${_.ssl.fifo.in}"
+
+                               redirect {_.netfd.in}< "${_.ssl.fifo.out}"
+               else
+                               print -n -- "${request}\r\n" >&${_.netfd.out}
+               fi
+               return 0
+       }
+       
+       function cat_url
+       {       
+               if [[ "${_.protocol}" == "file" ]] ; then
+                       cat "${_.path1}"
+                       return $?
+               elif [[ "${_.protocol}" == ~(Elr)http(|s) ]] ; then
+                       compound httpresponse # http response
+
+                       # If URL did not contain a port number in the host part 
then look at the
+                       # protocol to get the port number
+                       if [[ "${_.port}" == "${_.host}" ]] ; then
+                               case "${_.protocol}" in
+                                       "http")  _.port=80 ;;
+                                       "https") _.port=443 ;;
+                                       *)       _.port="$(getent services 
"${_.protocol}" | sed 's/[^0-9]*//;s/\/.*//')" ;;
+                               esac
+                       else
+                               _.host="${_.host%:*}"
+                       fi
+
+                       printmsg "protocol=${_.protocol} port=${_.port} 
host=${_.host} path=${_.path}"
+
+                       # prechecks
+                       [[ "${_.protocol}" != "" ]] || { print -u2 -f "%s: 
protocol not set.\n" "$0" ; return 1 ; }
+                       [[ "${_.port}"     != "" ]] || { print -u2 -f "%s: port 
not set.\n"     "$0" ; return 1 ; }
+                       [[ "${_.host}"     != "" ]] || { print -u2 -f "%s: host 
not set.\n"     "$0" ; return 1 ; }
+                       [[ "${_.path}"     != "" ]] || { print -u2 -f "%s: path 
not set.\n"     "$0" ; return 1 ; }
+
+                       _.open_connection
+
+                       # send HTTP request    
+                       request="GET /${_.path} HTTP/1.1\r\n"
+                       request+="Host: ${_.host}\r\n"
+                       request+="User-Agent: ${_.user_agent}\r\n"
+                       request+="Connection: close\r\n"
+                       _.send_request "${request}\r\n"
+
+                       # collect response and send it to stdout
+                       {
+                               _.parse_http_response httpresponse
+                               _.cat_http_body 
"${httpresponse.transfer_encoding}"
+                       } <&${_.netfd.in}
+                       
+                       _.close_connection
+                       
+                       return 0
+               else
+                       return 1
+               fi
+               # notreached
+       }
+)
+
 function html_entity_to_ascii
 {
        typeset buf
@@ -448,10 +559,21 @@
                LC_TIME="en_US.UTF-8" \
                LANG="en_US.UTF-8"
 
-       # need extra newline after cat_http to terminate line with $'\n'
+       # return non-zero exit code for this function if the rss processing 
below fails
+       set -o errexit
+
+       urlconnection_t hc
+       hc.user_agent="rssread/ksh93(ssl) (2009-08-14; $(uname -s -r -p))"
+       hc.init_url "$1"
+       
+       # need extra newline after cat_url to terminate line with $'\n'
        # to make "xml_tok" happy
-       { cat_http "$1" ; print ; } |
-               xml_tok "rsstok_cb"
+       data="${ hc.cat_url ; print ; }"
+       
+       print -u2 -f "# Got %d lines of RSS data, processing...\n" "${ wc -l 
<<< "${data}" ; }"
+       
+       xml_tok "rsstok_cb" <<< "${data}"
+
        return 0
 }
 
@@ -465,6 +587,7 @@
 # make sure we use the ksh93 builtin versions
 builtin basename
 builtin cat
+builtin mkfifo
 
 typeset -A rsstok_cb # callbacks for xml_tok
 rsstok_cb["tag_begin"]="handle_rss"
@@ -488,11 +611,14 @@
        
["google_blogs_ksh"]="http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&q=(%22ksh93%22%7C%22ksh+93%22+%7C+%22korn93%22+%7C+%22korn+93%22)&ie=utf-8&num=100&output=rss"
        # OpenSolaris.org sites
        
["ksh93_integration"]="http://www.opensolaris.org/rss/os/project/ksh93-integration/announcements/rss2.xml";
+       
["ksh93_integration_ssl"]="https://www.opensolaris.org/rss/os/project/ksh93-integration/announcements/rss2.xml";
        
["shell"]="http://www.opensolaris.org/rss/os/project/shell/announcements/rss2.xml";
        
["systemz"]="http://www.opensolaris.org/rss/os/project/systemz/announcements/rss2.xml";
+       
["systemz_ssl"]="https://www.opensolaris.org/rss/os/project/systemz/announcements/rss2.xml";
        # some Sun staff/sites
        ["blogs_sun_com"]="http://blogs.sun.com/main/feed/entries/rss";
        ["bigadmin"]="http://www.sun.com/bigadmin/content/rss/motd.xml";
+       
["bigadmin_scripts"]="https://www.sun.com/bigadmin/content/rss/scripts.xml";
        ["jmcp"]="http://www.jmcp.homeunix.com/roller/jmcp/feed/entries/rss";
        ["katakai"]="http://blogs.sun.com/katakai/feed/entries/rss";
        ["alanc"]="http://blogs.sun.com/alanc/feed/entries/rss";
@@ -502,12 +628,13 @@
        ["theregister_uk"]="http://www.theregister.co.uk/headlines.rss";
        ["heise"]="http://www.heise.de/newsticker/heise.rdf";
        ["slashdot"]="http://rss.slashdot.org/Slashdot/slashdot";
+       
["wikipedia_command_shells"]="http://en.wikipedia.org/w/index.php?title=Comparison_of_command_shells&feed=rss&action=history";
 )
 
 typeset progname="${ basename "${0}" ; }"
 
 typeset -r rssread_usage=$'+
-[-?\n@(#)\$Id: rssread (Roland Mainz) 2008-11-10 \$\n]
+[-?\n@(#)\$Id: rssread (Roland Mainz) 2009-08-14 \$\n]
 [-author?Roland Mainz <roland.mainz at sun.com>]
 [-author?Roland Mainz <roland.mainz at nrubsig.org>]
 [+NAME?rssread - fetch RSS messages and convert them to plain text]
--- old/usr/src/lib/libshell/common/scripts/shircbot.sh Fri Sep 25 06:34:38 2009
+++ new/usr/src/lib/libshell/common/scripts/shircbot.sh Fri Sep 25 06:34:36 2009
@@ -22,7 +22,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -55,7 +55,7 @@
 
 # Definition for a IRC session class
 typeset -T ircsession_t=(
-       typeset -C server=(
+       compound server=(
                typeset name
                integer port
        )
@@ -74,7 +74,7 @@
                _.server.port=$2
                _.nick=$3
                
-               redirect {_.fd}<>"/dev/tcp/${_.server.name}/${_.server.port}"
+               redirect {_.fd}<> "/dev/tcp/${_.server.name}/${_.server.port}"
                (( $? == 0 )) || { print -n2 $"Could not open server 
connection." ; return 1 ; }
                
                printf "fd=%d\n" _.fd
@@ -111,9 +111,7 @@
                linebuf_t serverbuf
                linebuf_t clientbuf
                integer fd=${_.fd}
-
-               set -o xtrace
-               
+       
                _.login
                
                while ${_.running} ; do
@@ -148,13 +146,13 @@
                
                case "${line}" in
                        ~(El)PING)
-                               typeset -C ping_args=(
+                               compound ping_args=(
                                        line="$line"
                                )
                                _.serverevent_ping "ping_args"
                                ;;
                        ~(El):.*\ PRIVMSG)
-                               typeset -C privmsg_args=(
+                               compound privmsg_args=(
                                        typeset line="$line"
                                        typeset msguser="${line/~(Elr)([^ ]+) 
([^ ]+) ([^ ]+) (.*)/\1}"
                                        typeset msgchannel="${line/~(Elr)([^ 
]+) ([^ ]+) ([^ ]+) (.*)/\3}"
@@ -163,7 +161,7 @@
                                _.serverevent_privmsg "privmsg_args"
                                ;;
                        ~(El):.*\ INVITE)
-                               typeset -C invite_args=(
+                               compound invite_args=(
                                        typeset line="$line"
                                        typeset inviteuser="${line/~(Elr)([^ 
]+) ([^ ]+) ([^ ]+) (.*)/\1}"
                                        typeset invitenick="${line/~(Elr)([^ 
]+) ([^ ]+) ([^ ]+) (.*)/\3}"
@@ -270,7 +268,7 @@
 typeset progname="${ basename "${0}" ; }"
 
 typeset -r shircbot_usage=$'+
-[-?\n@(#)\$Id: shircbot (Roland Mainz) 2008-10-31 \$\n]
+[-?\n@(#)\$Id: shircbot (Roland Mainz) 2009-09-09 \$\n]
 [-author?Roland Mainz <roland.mainz at sun.com>]
 [-author?Roland Mainz <roland.mainz at nrubsig.org>]
 [+NAME?shircbot - simple IRC bot demo]
@@ -282,7 +280,7 @@
 [+SEE ALSO?\bksh93\b(1)]
 '
 
-typeset -C config=(
+compound config=(
        typeset nickname="${LOGNAME}bot"
        typeset servername="irc.freenode.net"
        integer port=6667
@@ -306,6 +304,8 @@
                config.join_channels+=( "#opensolaris" )
                config.join_channels+=( "#opensolaris-dev" )
                config.join_channels+=( "#opensolaris-arc" )
+               config.join_channels+=( "#opensolaris-meeting" )
+               config.join_channels+=( "#ospkg" )
                config.join_channels+=( "#ksh" )
        elif [[ "${config.servername}" == ~(E)irc.(sfbay|sweden) ]] ; then
                config.join_channels+=( "#onnv" )
@@ -344,9 +344,9 @@
        
        case "$msg" in
                ~(Eli)date)
-                       _.send_privmsg "$msgchannel" "$(
-                               ( printf "%(%Y-%m-%d, %Th/%Z)T\n"  )
-                       )"
+                       _.send_privmsg "$msgchannel" "${
+                               printf "%(%Y-%m-%d, %Th/%Z)T\n"
+                       }"
                        ;;
                ~(Eli)echo)
                        _.send_privmsg "$msgchannel" "${msg#*echo}"
@@ -358,10 +358,10 @@
                        fi
                        ;;
                ~(Eli)help)
-                       _.send_privmsg "$msgchannel" "$(
+                       _.send_privmsg "$msgchannel" "${
                                printf "Hello, this is shircbot, written in 
ksh93 (%s). " "${.sh.version}"
                                printf "Subcommands are 'say hello', 'math 
<math-expr>', 'stocks', 'uuid', 'date' and 'echo'."
-                               )"
+                               }"
                        ;;
                ~(Eli)math)
                        if [[ "${msg}" == ~(E)[\`\$] ]] ; then
@@ -371,9 +371,9 @@
                                typeset mathexpr="${msg#*math}"
 
                                printf "Calculating '%s'\n" "${mathexpr}"
-                               _.send_privmsg "$msgchannel" "$(
-                                       ( printf 'export PATH=/usr/$RANDOM/foo 
; set -o restricted ; printf "%%s = %%.40g\n" "%s" $(( %s ))\n' "${mathexpr}" 
"${mathexpr}" | source /dev/stdin 2>&1 )
-                               )"
+                               _.send_privmsg "$msgchannel" "${
+                                       ( printf 'export 
PATH=/usr/${RANDOM}/$$/${RANDOM}/foo ; set -o restricted ; printf "%%s = 
%%.40g\n" "%s" $(( %s ))\n' "${mathexpr}" "${mathexpr}" | source /dev/stdin 
2>&1 )
+                               }"
                        fi
                        ;;
                ~(Eli)say\ hello)
@@ -381,15 +381,15 @@
                        ;;
                ~(Eli)stocks)
                        typeset stockmsg tickersymbol
-                       for tickersymbol in "JAVA" "IBM" "AAPL" "HPQ" ; do
+                       for tickersymbol in "JAVA" "ORCL" "IBM" "AAPL" "HPQ" ; 
do
                                stockmsg="$( /usr/sfw/bin/wget -q -O 
/dev/stdout 
"http://quote.yahoo.com/d/quotes.csv?f=sl1d1t1c1ohgv&e=.csv&s=${tickersymbol}"; 
2>&1 )"
                                _.send_privmsg "$msgchannel" "${tickersymbol}: 
${stockmsg//,/ }"
                        done
                        ;;
                ~(Eli)uuid)
-                       _.send_privmsg "$msgchannel" "$(
-                               ( print "%(%Y%M%D%S%N)T$((RANDOM))%s\n" 
"${msguser}" | sum -x sha256 )
-                       )"
+                       _.send_privmsg "$msgchannel" "${
+                               print "%(%Y%M%D%S%N)T$((RANDOM))%s\n" 
"${msguser}" | sum -x sha256
+                       }"
                        ;;
        esac
        
--- old/usr/src/lib/libshell/common/scripts/shlint.sh   Fri Sep 25 06:34:41 2009
+++ new/usr/src/lib/libshell/common/scripts/shlint.sh   Fri Sep 25 06:34:39 2009
@@ -66,7 +66,7 @@
 typeset progname="${ basename "${0}" ; }"
 
 typeset -r shlint_usage=$'+
-[-?\n@(#)\$Id: shlint (Roland Mainz) 2008-10-14 \$\n]
+[-?\n@(#)\$Id: shlint (Roland Mainz) 2009-03-15 \$\n]
 [-author?Roland Mainz <roland.mainz at sun.com>]
 [-author?Roland Mainz <roland.mainz at nrubsig.org>]
 [+NAME?shlint - lint for POSIX shell scripts]
@@ -82,13 +82,15 @@
 done
 shift $((OPTIND-1))
 
+(( $# > 0 )) || usage
+
 file="$1"
 [[ ! -f "$file" ]] && fatal_error $"File ${file} not found."
 [[ ! -r "$file" ]] && fatal_error $"File ${file} not readable."
 
-x="$( /usr/bin/ksh93 -n "${file}" 2>&1 1>/dev/null  )"
+x="$( /usr/bin/shcomp -n "${file}" /dev/null 2>&1 1>/dev/null  )"
 
-printf "%s" "$x"
+printf "%s\n" "$x"
 
 [[ "$x" != "" ]] && exit 1 || exit 0
 # EOF.
--- old/usr/src/lib/libshell/common/scripts/shman.sh    Fri Sep 25 06:34:43 2009
+++ new/usr/src/lib/libshell/common/scripts/shman.sh    Fri Sep 25 06:34:42 2009
@@ -22,7 +22,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -174,7 +174,7 @@
 # /usr/bin/man <keyword>
 function show_manpage
 {
-       typeset -a -C mandirs
+       compound -a mandirs
        integer i
        integer j
 
@@ -236,7 +236,7 @@
 # /usr/bin/man -l <keyword>
 function list_manpages
 {
-       typeset -a -C mandirs
+       compound -a mandirs
 
        enumerate_mandirs mandirs
        #debug_print -- "${mandi...@]}"
@@ -320,7 +320,7 @@
 typeset progname="$(basename "${0}")"
 
 typeset -r man_usage=$'+
-[-?\n@(#)\$Id: shman (Roland Mainz) 2008-10-14 \$\n]
+[-?\n@(#)\$Id: shman (Roland Mainz) 2009-06-26 \$\n]
 [-author?Roland Mainz <roland.mainz at nrubsig.org>]
 [-author?Roland Mainz <roland.mainz at sun.com>]
 [+NAME?man - find and display reference manual pages]
@@ -372,17 +372,25 @@
 
 # cd /usr/man; LC_MESSAGES=C /usr/lib/sgml/sgml2roff 
/usr/man/sman1as/asadmin-list-timers.1as  | tbl | eqn | nroff -u0 -Tlp -man -  
| col -x > /tmp/mpLQaqac
 
-typeset manname="$1"
-debug_print -f "# searching for %s ...\n" "${manname}"
+# prechecks
+(( $# > 0 )) || usage
 
-if ${do_keyword} ; then
-       list_keywords
-elif ${do_list} ; then
-       list_manpages
-else
-       show_manpage
-fi
+# process arguments
+while (( $# > 0 )) ; do
+       typeset manname="$1"
+       shift
 
+       debug_print -f "# searching for %s ...\n" "${manname}"
+
+       if ${do_keyword} ; then
+               list_keywords
+       elif ${do_list} ; then
+               list_manpages
+       else
+               show_manpage
+       fi
+done
+
 # todo: better exit codes
 exit 0
 # EOF.
--- old/usr/src/lib/libshell/common/scripts/shnote.sh   Fri Sep 25 06:34:46 2009
+++ new/usr/src/lib/libshell/common/scripts/shnote.sh   Fri Sep 25 06:34:45 2009
@@ -22,7 +22,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -181,11 +181,11 @@
        fi
 
        # open history file
-       redirect {histfd}<>"${history_file}"
-       (( $? != 0 )) && { print -u2 "Couldn't open history file." ;  return 1 
; }
+       redirect {histfd}<> "${history_file}"
+       (( $? != 0 )) && { print -u2 "Could not open history file." ;  return 1 
; }
     
        while read -u${histfd} line ; do
-               typeset -C rec
+               compound rec
        
                printf "( %s )\n" "${line}"  | read -C rec
        
@@ -213,13 +213,13 @@
        typeset url_path="/quiet-paste.php?api=${pastebin_ca_key}"
        typeset url="http://${url_host}${url_path}";
        integer netfd # http stream number
-       typeset -C httpresponse
+       compound httpresponse
        
        (( $# != 1 )) && { print -u2 -f $"%s: Wrong number of arguments.\n" 
"$0" ; return 1 ; }
        (( ${#1} == 0 )) && { print -u2 -f $"%s: No data.\n" "$0" ; return 1 ; }
 
        # argument for "encode_multipart_form_data"
-       typeset mimeform=(
+       compound mimeform=(
                # input
                typeset boundary
                typeset -a form
@@ -252,8 +252,8 @@
        request+="Content-Type: multipart/form-data; boundary=${boundary}\r\n"
        request+="Content-Length: $(( mimeform.content_length ))\r\n"
 
-       redirect {netfd}<>"/dev/tcp/${url_host}/80" 
-       (( $? != 0 )) && { print -u2 -f $"$0: Couldn't open connection to 
%s.\n" "$0" "${url_host}" ;  return 1 ; }
+       redirect {netfd}<> "/dev/tcp/${url_host}/80" 
+       (( $? != 0 )) && { print -u2 -f $"%s: Could not open connection to 
%s.\n" "$0" "${url_host}" ;  return 1 ; }
 
        # send http post
        {
@@ -274,7 +274,7 @@
                printf "SUCCESS: http://opensolaris.pastebin.ca/%s\n"; 
"${response_token}"
        
                # write history entry
-               typeset histrec=(
+               compound histrec=(
                        title="${mimeform.form[0].data}"
                        description="${mimeform.form[3].data}"
                        providertoken="${response_token}"
@@ -321,8 +321,8 @@
        # I hereby curse Solaris for not having an entry for "http" in 
/etc/services
 
        # open TCP channel
-       redirect {netfd}<>"/dev/tcp/${url_host}/80"
-       (( $? != 0 )) && { print -u2 -f $"%s: Couldn't open connection to 
%s.\n" "$0" "${url_host}" ; return 1 ; }
+       redirect {netfd}<> "/dev/tcp/${url_host}/80"
+       (( $? != 0 )) && { print -u2 -f $"%s: Could not open connection to 
%s.\n" "$0" "${url_host}" ; return 1 ; }
 
        # send HTTP request    
        request="GET ${url_path} HTTP/1.1\r\n"
@@ -359,7 +359,7 @@
 typeset progname="${ basename "${0}" ; }"
 
 # HTTP protocol client identifer
-typeset -r http_user_agent="shnote/ksh93 (2008-10-14; $(uname -s -r -p))"
+typeset -r http_user_agent="shnote/ksh93 (2009-05-09; $(uname -s -r -p))"
 
 # name of history log (the number after "history" is some kind of version
 # counter to handle incompatible changes to the history file format)
@@ -366,7 +366,7 @@
 typeset -r history_file="${HOME}/.shnote/history0.txt"
 
 typeset -r shnote_usage=$'+
-[-?\n@(#)\$Id: shnote (Roland Mainz) 2008-10-14 \$\n]
+[-?\n@(#)\$Id: shnote (Roland Mainz) 2009-05-09 \$\n]
 [-author?Roland Mainz <roland.mainz at nrubsig.org>]
 [+NAME?shnote - read/write text data to internet clipboards]
 [+DESCRIPTION?\bshnote\b is a small utilty which can read and write text
--- old/usr/src/lib/libshell/common/scripts/shpiano.sh  Fri Sep 25 06:34:49 2009
+++ new/usr/src/lib/libshell/common/scripts/shpiano.sh  Fri Sep 25 06:34:48 2009
@@ -22,7 +22,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -58,7 +58,7 @@
 # array which holds frequency and sample data 
 # (the data are created on demand, "sample_set" indicates whether the "sample" 
variable
 # needs to be filled or not)
-typeset -A tones=(
+compound -A tones=(
        ["C3"]=(  float freq=261.63  ; typeset sample_set="false" ; typeset -b 
sample )
        ["C#3"]=( float freq=277.18  ; typeset sample_set="false" ; typeset -b 
sample )
        ["D3"]=(  float freq=293.66  ; typeset sample_set="false" ; typeset -b 
sample )
@@ -91,7 +91,7 @@
 
 # alias table which translates the various names of "notes" to the matching 
entry
 # in the "tones" table
-typeset -r -A notes=(
+compound -r -A notes=(
        ["C3"]=(  val=tones["C3"]   ) ["key_d"]=(  val=tones["C3"]   )
        ["C#3"]=( val=tones["C#3"]  ) ["key_r"]=(  val=tones["C#3"]  )
        ["D3"]=(  val=tones["D3"]   ) ["key_f"]=(  val=tones["D3"]   )
@@ -1278,18 +1278,24 @@
 typeset progname="${ basename "${0}" ; }"
 
 typeset -r shpiano_usage=$'+
-[-?\n@(#)\$Id: shpiano (Roland Mainz) 2008-11-03 \$\n]
+[-?\n@(#)\$Id: shpiano (Roland Mainz) 2009-05-09 \$\n]
 [-author?Roland Mainz <roland.mainz at nrubsig.org>]
+[-author?Valeria Elisabeth Mainz <valeria.mainz at no.such.email.toddler>]
 [+NAME?shpiano - simple audio demo]
 [+DESCRIPTION?\bshpiano\b is a small demo application which converts
         keyboard input into 8bit Mu-law audio samples which are
         send to /dev/audio.]
+[b:babymode?Mode to entertain toddlers. Plays a sound for any key
+       and ignores SIGINT. Requires ESC to quit the application.]
 [+SEE ALSO?\bksh93\b(1), \bau\b(4), \baudio\b(7i)]
 '
+typeset babymode=false
 
 while getopts -a "${progname}" "${shpiano_usage}" OPT ; do 
 #      printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
        case ${OPT} in
+               b)      babymode=true ;;
+               +b)     babymode=false ;;
                *)      usage ;;
        esac
 done
@@ -1304,19 +1310,30 @@
 integer i
 integer audiofd # audio device file descriptor
 typeset key
-typeset audio=( typeset -i currpos=0 ; typeset -a -i data=( [0]=0 ) ) # stack 
object
+compound audio=( integer currpos=0 ; integer -a data=( [0]=0 ) ) # stack object
 
 clear
 print_piano_layout
 
+if ${babymode} ; then
+       [[ -x /usr/bin/banner ]] || fatal_error "-n requires /usr/bin/banner"
+
+       typeset lastkeys
+
+       nameref curr_note=tones["A#4"]
+       (( freq=curr_note.freq ))
+       
+       trap "" INT
+fi
+
 if [[ "${AUDIODEV}" == "" ]] ; then
        AUDIODEV="/dev/audio"
 fi
-print -u2 -f $"Playing sound to device\n" "${AUDIODEV}"
+print -u2 -f $"Playing sound to device %s\n" "${AUDIODEV}"
 
 # open channel to audio device
-redirect {audiofd}<>"${AUDIODEV}"
-(( $? != 0 )) && fatal_error $"Couldn't open audio device."
+redirect {audiofd}<> "${AUDIODEV}"
+(( $? != 0 )) && fatal_error $"Could not open audio device."
 
 # build pause sample
 stack_init audio
@@ -1332,21 +1349,33 @@
 # begin playing
 printf "%B" au_header >&${audiofd}
 
+
 # warning: the math used here is so wrong that your head may
 # explode when you continue reading this
 while read -r -N 1 key?$'\r > ' ; do
-       if [[ ${key} == ~(E)($'\E'|'q'|'Q') ]] ; then
+       if [[ ${key} == $'\E' ]] || [[ ${babymode} != "true" && ${key} == 
~(E)($'\E'|'q'|'Q') ]] ; then
                break # quit
        fi
 
        printf "\r"
-       if [[ -z "${notes[key_${key}]}" ]] ; then
-               nameref curr_note=tones["p"]
-               (( freq=1.*(1./duration) ))
-       else
+       if [[ -v notes[key_${key}] ]] ; then
                nameref curr_note="${notes[key_${key}].val}"
                (( freq=curr_note.freq ))
+       else
+               if ${babymode} ; then
+                       nameref curr_note=tones["A#4"]
+                       (( freq=curr_note.freq ))
+               else
+                       nameref curr_note=tones["p"]
+                       (( freq=1.*(1./duration) ))
+               fi
        fi
+       
+       # babymode: print "keys" to screen via /usr/bin/banner
+       if ${babymode} ; then
+               lastkeys="${lastkeys/~(Er).*(........)/\1}${key}"
+               banner "${lastkeys}"
+       fi
 
 #      printf "note=%s sample_rate=%f, freq=%f\n" "${!curr_note}" sample_rate 
freq >&2
 
--- old/usr/src/lib/libshell/common/scripts/shtinyurl.sh        Fri Sep 25 
06:34:53 2009
+++ new/usr/src/lib/libshell/common/scripts/shtinyurl.sh        Fri Sep 25 
06:34:51 2009
@@ -22,7 +22,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -112,7 +112,7 @@
        typeset url="http://${url_host}${url_path}";
        integer netfd # http stream number
        typeset inputurl="$1"
-       typeset -C httpresponse # http response
+       compound httpresponse # http response
        typeset request=""
 
        # we assume "inputurl" is a correctly encoded URL which doesn't
@@ -124,8 +124,8 @@
        request+="User-Agent: ${http_user_agent}\r\n"
        request+="Connection: close\r\n"
 
-       redirect {netfd}<>"/dev/tcp/${url_host}/80" 
-       (( $? != 0 )) && { print -u2 -f $"%s: Couldn't open connection to 
%s.\n" "$0" "${url_host}" ;  return 1 ; }
+       redirect {netfd}<> "/dev/tcp/${url_host}/80" 
+       (( $? != 0 )) && { print -u2 -f $"%s: Could not open connection to 
%s.\n" "$0" "${url_host}" ;  return 1 ; }
 
        # send http post
        {
@@ -150,6 +150,53 @@
        # not reached
 }
 
+function request_trimurl
+{
+       # site setup
+       typeset url_host="api.tr.im"
+       typeset url_path="/api/trim_url.xml"
+       typeset url="http://${url_host}${url_path}";
+       integer netfd # http stream number
+       typeset inputurl="$1"
+       compound httpresponse # http response
+       typeset request=""
+
+       # we assume "inputurl" is a correctly encoded URL which doesn't
+       # require any further mangling
+       url_path+="?url=${inputurl}"
+
+       request="GET ${url_path} HTTP/1.1\r\n"
+       request+="Host: ${url_host}\r\n"
+       request+="User-Agent: ${http_user_agent}\r\n"
+       request+="Connection: close\r\n"
+
+       redirect {netfd}<> "/dev/tcp/${url_host}/80" 
+       (( $? != 0 )) && { print -u2 -f $"%s: Could not open connection to 
%s.\n" "$0" "${url_host}" ;  return 1 ; }
+
+       # send http post
+       {
+               print -n -- "${request}\r\n"
+       }  >&${netfd}
+
+       # process reply
+       parse_http_response httpresponse <&${netfd}
+       response="${ cat_http_body "${httpresponse.transfer_encoding}" 
<&${netfd} ; }"
+
+       # close connection
+       redirect {netfd}<&-
+        
+       if (( httpresponse.statuscode >= 200 && httpresponse.statuscode <= 299 
)) ; then
+               # the statement below should really parse the XML...
+               print -r -- "${response/~(Elr).*(\<url\>)(.*)(\<\/url\>).*/\2}"
+               return 0
+       else
+               print -u2 -f $"tr.im response was (%s,%s):\n%s\n" 
"${httpresponse.statuscode}" "${httpresponse.statusmsg}" "${response}"
+               return 1
+       fi
+       
+       # not reached
+}
+
 function usage
 {
        OPTIND=0
@@ -166,26 +213,30 @@
 typeset progname="${ basename "${0}" ; }"
 
 # HTTP protocol client identifer
-typeset -r http_user_agent="shtinyurl/ksh93 (2008-10-14; ${ uname -s -r -p ; 
})"
+typeset -r http_user_agent="shtinyurl/ksh93 (2009-08-12; ${ uname -s -r -p ; 
})"
 
 typeset -r shtinyurl_usage=$'+
-[-?\n@(#)\$Id: shtinyurl (Roland Mainz) 2008-10-14 \$\n]
+[-?\n@(#)\$Id: shtinyurl (Roland Mainz) 2009-08-12 \$\n]
 [-author?Roland Mainz <roland.mainz at nrubsig.org>]
-[+NAME?shtinyurl - create short tinyurl.com alias URL from long URL]
+[+NAME?shtinyurl - create short alias URL from long URL]
 [+DESCRIPTION?\bshtinyurl\b is a small utility which passes a given URL
-       to the tinyurl.com service which creates short aliases in the
-       form of http://tinyurl.com/XXXXXXXX to redirect long URLs.]
+       to internet service which creates short aliases in the
+       form of http://<servicename>/XXXXXXXX to redirect long URLs.]
 [+?The first arg \burl\b describes a long URL which is transformed into
        a tinyurl.com short alias.]
+[P:provider?Service provider (either \'tinyurl.com\' or \'tr.im\').]:[mode]
 
 url
 
-[+SEE ALSO?\bksh93\b(1), \brssread\b(1), \bshtwitter\b(1), 
http://www.tinyurl.com]
+[+SEE ALSO?\bksh93\b(1), \brssread\b(1), \bshtwitter\b(1), 
http://www.tinyurl.com, http://tr.im]
 '
 
+typeset service_provider="tr.im"
+
 while getopts -a "${progname}" "${shtinyurl_usage}" OPT ; do 
 #      printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
        case ${OPT} in
+               P)      service_provider="${OPTARG}" ;;
                *)      usage ;;
        esac
 done
@@ -192,11 +243,24 @@
 shift $((OPTIND-1))
 
 # expecting at least one more argument
-(($# >= 1)) || usage
+(( $# >= 1 )) || usage
 
 typeset url="$1"
 shift
 
-request_tinyurl "${url}"
-exit $?
+case "${service_provider}" in
+       "tinyurl.com")
+               request_tinyurl "${url}"
+               exit $?
+               ;;
+       "tr.im")
+               request_trimurl "${url}"
+               exit $?
+               ;;
+       *)
+               fatal_error "Unsupported service provider."
+esac
+
+# not reached
+
 # EOF.
--- old/usr/src/lib/libshell/common/scripts/shtwitter.sh        Fri Sep 25 
06:34:56 2009
+++ new/usr/src/lib/libshell/common/scripts/shtwitter.sh        Fri Sep 25 
06:34:54 2009
@@ -22,7 +22,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -192,12 +192,14 @@
        typeset url="http://${url_host}${url_path}";
        integer netfd # http stream number
        typeset msgtext="$1"
-       typeset -C httpresponse # http response
+       compound httpresponse # http response
 
        # argument for "encode_x_www_form_urlencoded"
-       typeset urlform=(
+       compound urlform=(
                # input
-               typeset -a form
+               compound -a form=(
+                       ( name="status" data="${msgtext}" )
+               )
                # output
                typeset content
                integer content_length
@@ -206,10 +208,6 @@
        typeset request=""
        typeset content=""
 
-       urlform.form=(
-               ( name="status" data="${msgtext}" )
-       )
-  
        encode_x_www_form_urlencoded urlform
           
        content="${urlform.content}"
@@ -222,7 +220,7 @@
        request+="Content-Type: application/x-www-form-urlencoded\r\n"
        request+="Content-Length: $(( urlform.content_length ))\r\n"
 
-       redirect {netfd}<>"/dev/tcp/${url_host}/80" 
+       redirect {netfd}<> "/dev/tcp/${url_host}/80" 
        (( $? != 0 )) && { print -u2 -f "%s: Could not open connection to 
%s\n." "$0" "${url_host}" ;  return 1 ; }
 
        # send http post
@@ -261,7 +259,7 @@
        typeset url_path="/account/verify_credentials.xml"
        typeset url="http://${url_host}${url_path}";
        integer netfd # http stream number
-       typeset -C httpresponse # http response
+       compound httpresponse # http response
 
        typeset request=""
 
@@ -273,7 +271,7 @@
        request+="Content-Type: application/x-www-form-urlencoded\r\n"
        request+="Content-Length: 0\r\n" # dummy
 
-       redirect {netfd}<>"/dev/tcp/${url_host}/80" 
+       redirect {netfd}<> "/dev/tcp/${url_host}/80" 
        (( $? != 0 )) && { print -u2 -f $"%s: Could not open connection to 
%s.\n" "$0" "${url_host}" ;  return 1 ; }
 
        # send http post
@@ -315,10 +313,10 @@
 typeset progname="${ basename "${0}" ; }"
 
 # HTTP protocol client identifer
-typeset -r http_user_agent="shtwitter/ksh93 (2008-10-14; ${ uname -s -r -p ; 
})"
+typeset -r http_user_agent="shtwitter/ksh93 (2009-06-15; ${ uname -s -r -p ; 
})"
 
 typeset -r shtwitter_usage=$'+
-[-?\n@(#)\$Id: shtwitter (Roland Mainz) 2008-10-14 \$\n]
+[-?\n@(#)\$Id: shtwitter (Roland Mainz) 2009-06-15 \$\n]
 [-author?Roland Mainz <roland.mainz at nrubsig.org>]
 [+NAME?shtwitter - read/write text data to internet clipboards]
 [+DESCRIPTION?\bshtwitter\b is a small utility which can read and write text
--- /dev/null   Fri Sep 25 06:34:59 2009
+++ new/usr/src/lib/libshell/common/scripts/simplefileattributetree1.sh Fri Sep 
25 06:34:57 2009
@@ -0,0 +1,273 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# simplefileattributetree1 - build a simple file tree (including file 
attributes)
+#
+
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are 
not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+# Make sure all math stuff runs in the "C" locale to avoid problems
+# with alternative # radix point representations (e.g. ',' instead of
+# '.' in de_DE.*-locales). This needs to be set _before_ any
+# floating-point constants are defined in this script).
+if [[ "${LC_ALL}" != "" ]] ; then
+    export \
+        LC_MONETARY="${LC_ALL}" \
+        LC_MESSAGES="${LC_ALL}" \
+        LC_COLLATE="${LC_ALL}" \
+        LC_CTYPE="${LC_ALL}"
+        unset LC_ALL
+fi
+export LC_NUMERIC=C
+
+
+function add_file_to_tree
+{
+       typeset treename=$1
+       typeset filename=$2
+       nameref destnodename=$3
+       integer i
+       typeset nodepath # full name of compound variable
+       typeset -a pe # path elements
+
+       # first built an array containing the names of each path element
+       # (e.g. "foo/var/baz"" results in an array containing "( 'foo' 'bar' 
'baz' )")
+       typeset IFS='/'
+       pe+=( ${filename} )
+       
+       [[ ${pe[0]} == '' ]] && pe[0]='/'
+
+       # walk path described via the "pe" array and build nodes if
+       # there aren't any nodes yet
+       nodepath="${treename}"
+       for (( i=0 ; i < (${#...@]}-1) ; i++ )) ; do
+               nameref x="${nodepath}"
+               [[ ! -v x.node ]] && compound -A x.nodes
+       
+               nodepath+=".nodes[${pe[i]}]"
+       done
+       
+       # insert element
+       nameref node="${nodepath}"
+       [[ ! -v node.elements ]] && compound -A node.elements
+       node.elements[${pe[i]}]=(
+               filepath="${filename}"
+       )
+       
+       destnodename="${!node}.elements[${pe[i]}]"
+       
+       return 0
+}
+
+function parse_findls
+{
+       nameref out=$1
+       typeset str="$2"
+       
+       # find -ls on Solaris uses the following output format by default:
+       #604302    3 -rw-r--r--   1 test001  users        2678 May  9 00:46 
./httpsresdump
+
+       integer 
out.inodenum="${str/~(Elr)[[:space:]]*([[:digit:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alpha:]-]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alnum:]]+)[[:space:]]+([[:alnum:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alpha:]]*[[:space:]]+[[:digit:]]*[[:space:]]+[[:digit:]:]+)[[:space:]]+(.+)/\1}"
+       integer 
out.kbblocks="${str/~(Elr)[[:space:]]*([[:digit:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alpha:]-]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alnum:]]+)[[:space:]]+([[:alnum:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alpha:]]*[[:space:]]+[[:digit:]]*[[:space:]]+[[:digit:]:]+)[[:space:]]+(.+)/\2}"
+       typeset 
out.mode="${str/~(Elr)[[:space:]]*([[:digit:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alpha:]-]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alnum:]]+)[[:space:]]+([[:alnum:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alpha:]]*[[:space:]]+[[:digit:]]*[[:space:]]+[[:digit:]:]+)[[:space:]]+(.+)/\3}"
+       integer 
out.numlinks="${str/~(Elr)[[:space:]]*([[:digit:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alpha:]-]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alnum:]]+)[[:space:]]+([[:alnum:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alpha:]]*[[:space:]]+[[:digit:]]*[[:space:]]+[[:digit:]:]+)[[:space:]]+(.+)/\4}"
+       compound out.owner=(
+               typeset 
user="${str/~(Elr)[[:space:]]*([[:digit:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alpha:]-]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alnum:]]+)[[:space:]]+([[:alnum:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alpha:]]*[[:space:]]+[[:digit:]]*[[:space:]]+[[:digit:]:]+)[[:space:]]+(.+)/\5}"
+               typeset 
group="${str/~(Elr)[[:space:]]*([[:digit:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alpha:]-]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alnum:]]+)[[:space:]]+([[:alnum:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alpha:]]*[[:space:]]+[[:digit:]]*[[:space:]]+[[:digit:]:]+)[[:space:]]+(.+)/\6}"
+       )
+       integer 
out.filesize="${str/~(Elr)[[:space:]]*([[:digit:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alpha:]-]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alnum:]]+)[[:space:]]+([[:alnum:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alpha:]]*[[:space:]]+[[:digit:]]*[[:space:]]+[[:digit:]:]+)[[:space:]]+(.+)/\7}"
+       typeset 
out.date="${str/~(Elr)[[:space:]]*([[:digit:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alpha:]-]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alnum:]]+)[[:space:]]+([[:alnum:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alpha:]]*[[:space:]]+[[:digit:]]*[[:space:]]+[[:digit:]:]+)[[:space:]]+(.+)/\8}"
+       typeset 
out.filepath="${str/~(Elr)[[:space:]]*([[:digit:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alpha:]-]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alnum:]]+)[[:space:]]+([[:alnum:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:alpha:]]*[[:space:]]+[[:digit:]]*[[:space:]]+[[:digit:]:]+)[[:space:]]+(.+)/\9}"
+
+       return 0
+}
+
+function usage
+{
+       OPTIND=0
+       getopts -a "${progname}" "${simplefileattributetree1_usage}" OPT '-?'
+       exit 2
+}
+
+# main
+builtin basename
+builtin dirname
+
+set -o noglob
+set -o nounset
+
+# tree base
+compound filetree
+
+# benchmark data
+compound bench=(
+       float start
+       float stop
+)
+
+compound appconfig=(
+       typeset do_benchmarking=false
+       compound do_record=(
+               typeset content=false
+               typeset filetype=false
+       )
+)
+
+
+integer i
+
+typeset progname="${ basename "${0}" ; }"
+
+typeset -r simplefileattributetree1_usage=$'+
+[-?\n@(#)\$Id: simplefileattributetree1 (Roland Mainz) 2009-06-26 \$\n]
+[-author?Roland Mainz <roland.mainz at nrubsig.org>]
+[+NAME?simplefileattributetree1 - generate compound variable tree which 
contains file names and their attributes]
+[+DESCRIPTION?\bsimplefileattributetree1\b is a simple variable tree 
+       demo which builds a compound variable tree based on the output
+       of /usr/xpg4/bin/file which contains the file name, the file attributes
+       and optionally file type and content]
+[b:benchmark?Print time needed to generate the tree.]
+[c:includecontent?Include the file\'s content in the tree, split into 1kb 
blocks.]
+[t:includefiletype?Include the file type (output of /usr/xpg4/bin/file).]
+
+path
+
+[+SEE ALSO?\bksh93\b(1), \bfile\b(1), \bfind\b(1)]
+'
+
+while getopts -a "${progname}" "${simplefileattributetree1_usage}" OPT ; do 
+#      printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
+       case ${OPT} in
+               b)      appconfig.do_benchmarking="true"        ;;
+               +b)     appconfig.do_benchmarking="false"       ;;
+               c)      appconfig.do_record.content="true"      ;;
+               +c)     appconfig.do_record.content="false"     ;;
+               t)      appconfig.do_record.filetype="true"     ;;
+               +t)     appconfig.do_record.filetype="false"    ;;
+               *)      usage ;;
+       esac
+done
+shift $((OPTIND-1))
+
+
+# argument prechecks
+if (( $# == 0 )) ; then
+       print -u2 -f "%s: Missing <path> argument.\n" "${progname}"
+       exit 1
+fi
+
+
+print -u2 -f "# reading file names...\n"
+while (( $# > 0 )) ; do
+       # "ulimit -c 0" use used to force ksh93 to use a seperate process for 
subshells,
+       # this is used to work around a bug with LC_ALL changes bleeding 
through subshells
+       IFS=$'\n' ; typeset -a findls_lines=( $(ulimit -c 0 ; LC_ALL=C find 
"$1" -type f -ls) ) ; IFS=$' \t\n'
+       shift
+done
+
+
+print -u2 -f "# building tree...\n"
+
+${appconfig.do_benchmarking} && (( bench.start=SECONDS ))
+
+for (( i=0 ; i < ${#findls_lin...@]} ; i++ )) ; do
+       compound parseddata
+       typeset treenodename
+       
+       # parse "find -ls" output
+       parse_findls parseddata "${findls_lines[i]}"
+       
+       # add node to tree and return it's absolute name in "treenodename"
+       add_file_to_tree filetree "${parseddata.filepath}" treenodename
+       
+       # merge parsed "find -ls" output into tree node
+       nameref treenode="${treenodename}"
+       treenode+=parseddata
+       
+       # extras (calculated from the existing values in "parseddata")
+       typeset treenode.dirname="${ dirname "${treenode.filepath}" ; }"
+       typeset treenode.basename="${ basename "${treenode.filepath}" ; }"
+       
+       if ${appconfig.do_record.filetype} ; then
+               # Using /usr/(xpg4/)*/bin/file requires a |fork()|+|exec()| 
which makes the script a few hundred times slower... ;-(
+               typeset treenode.filetype="$(file "${treenode.filepath}")"
+       fi
+       
+       if ${appconfig.do_record.content} ; then
+               if [[ -r "${treenode.filepath}" ]] ; then
+                       # We use an array of compound variables here to support
+                       # files with holes (and later alternative streams, too)
+                       compound -a treenode.content
+                       integer cl=0
+                       while \
+                               {
+                                       treenode.content[${cl}]=(
+                                               typeset type="data" # (todo: 
"add support for "holes" (sparse files))
+                                               typeset -b bin
+                                       )
+                                       read -n1024 treenode.content[${cl}].bin
+                               } ; do
+                               (( cl++ ))
+                       done < "${treenode.filepath}"
+                       unset treenode.content[${cl}]
+
+                       typeset -A treenode.hashsum=(
+                               [md5]="$(sum -x md5 < "${treenode.filepath}")"
+                               [sha512]="$(sum -x sha512 < 
"${treenode.filepath}")"
+                       )
+               
+                       # we do this for internal debugging only
+                       if [[ "${ {
+                                       integer j
+                                       for (( j=0 ; j < 
${#treenode.conte...@]} ; j++ )) ; do
+                                               printf "%B" 
treenode.content[$j].bin
+                                       done
+                               } | sum -x sha512 ; }" != 
"${treenode.hashsum[sha512]}" ]] ; then
+                               # this should never happen...
+                               print -u2 -f "fatal hash mismatch for %s\n" 
"${treenode.filepath}"
+                               unset treenode.content treenode.hashsum
+                       fi
+               fi
+       fi
+done
+
+${appconfig.do_benchmarking} && (( bench.stop=SECONDS ))
+
+
+if ${appconfig.do_benchmarking} ; then
+       # print benchmark data
+       print -u2 -f "# time used: %f\n" $((bench.stop - bench.start))
+fi
+
+# print variable tree
+print -v filetree
+
+exit 0
+# EOF.
--- /dev/null   Fri Sep 25 06:35:01 2009
+++ new/usr/src/lib/libshell/common/scripts/simplefiletree1.sh  Fri Sep 25 
06:35:00 2009
@@ -0,0 +1,126 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# simplefiletree1 - build a simple file tree
+#
+
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are 
not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+# Make sure all math stuff runs in the "C" locale to avoid problems
+# with alternative # radix point representations (e.g. ',' instead of
+# '.' in de_DE.*-locales). This needs to be set _before_ any
+# floating-point constants are defined in this script).
+if [[ "${LC_ALL}" != "" ]] ; then
+    export \
+        LC_MONETARY="${LC_ALL}" \
+        LC_MESSAGES="${LC_ALL}" \
+        LC_COLLATE="${LC_ALL}" \
+        LC_CTYPE="${LC_ALL}"
+        unset LC_ALL
+fi
+export LC_NUMERIC=C
+
+
+function add_file_to_tree
+{
+       typeset treename=$1
+       typeset filename=$2
+       integer i
+       typeset nodepath # full name of compound variable
+       typeset -a pe # path elements
+
+       # first built an array containing the names of each path element
+       # (e.g. "foo/var/baz"" results in an array containing "( 'foo' 'bar' 
'baz' )")
+       typeset IFS='/'
+       pe+=( ${filename} )
+       
+       [[ ${pe[0]} == '' ]] && pe[0]='/'
+
+       # walk path described via the "pe" array and build nodes if
+       # there aren't any nodes yet
+       nodepath="${treename}"
+       for (( i=0 ; i < (${#...@]}-1) ; i++ )) ; do
+               nameref x="${nodepath}"
+               [[ ! -v x.node ]] && compound -A x.nodes
+       
+               nodepath+=".nodes[${pe[i]}]"
+       done
+       
+       # insert element
+       nameref node="${nodepath}"
+       [[ ! -v node.elements ]] && typeset -a node.elements
+       node.elements+=( "${pe[i]}" )
+       
+       return 0
+}
+
+# main
+builtin rev
+
+# tree base
+compound filetree
+
+# benchmark data
+compound bench=(
+       float start
+       float stop
+)
+
+typeset i
+
+# argument prechecks
+if (( $# == 0 )) ; then
+       print -u2 -f "%s: Missing <path> argument." "$0"
+       exit 1
+fi
+
+print -u2 "# reading file names"
+while (( $# > 0 )) ; do
+       IFS=$'\n' ; typeset -a filenames=( $(find "$1" -type f) ) ; IFS=$' \t\n'
+       shift
+done
+print -u2 "# building tree..."
+
+(( bench.start=SECONDS ))
+
+for ((i=0 ; i < ${#filenam...@]} ; i++ )) ; do
+       add_file_to_tree filetree "${filenames[i]}"
+done
+
+(( bench.stop=SECONDS ))
+
+# print benchmark data
+print -u2 -f "# time used: %f\n" $((bench.stop - bench.start))
+
+# print tree
+print -v filetree
+
+exit 0
+# EOF.
--- old/usr/src/lib/libshell/common/scripts/svcproptree1.sh     Fri Sep 25 
06:35:04 2009
+++ new/usr/src/lib/libshell/common/scripts/svcproptree1.sh     Fri Sep 25 
06:35:02 2009
@@ -22,7 +22,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -74,11 +74,11 @@
                servicename="${servicename/~(El)svc:\//}" # strip "svc:/"
                propname="${name#~(El).*:properties/}"
 
-               if [[ "${tree["${servicename}"].properties[*]}" == "" ]] ; then
-                       typeset -A tree["${servicename}"].properties=( )
+               if [[ "$(typeset -p "tree[${servicename}].properties")" == "" 
]] ; then
+                       compound -A tree[${servicename}].properties
                fi
        
-               nameref node=tree["${servicename}"].properties["${propname}"]
+               nameref node=tree[${servicename}].properties[${propname}]
 
                node=(
                        typeset datatype="${datatype}"
@@ -110,7 +110,7 @@
 typeset progname="${ basename "${0}" ; }"
 
 typeset -r svcproptree1_usage=$'+
-[-?\n@(#)\$Id: svcproptree1 (Roland Mainz) 2008-10-14 \$\n]
+[-?\n@(#)\$Id: svcproptree1 (Roland Mainz) 2009-06-26 \$\n]
 [-author?Roland Mainz <roland.mainz at nrubsig.org>]
 [+NAME?svcproptree1 - SMF tree demo]
 [+DESCRIPTION?\bsvcproptree1\b is a small ksh93 compound variable demo
@@ -117,7 +117,7 @@
        which reads accepts a SMF service pattern name input file,
        reads the matching service properties and converts them into an internal
        variable tree representation and outputs it in the format
-       specified by viewmode (either "list", "namelist" or "tree")..]
+       specified by viewmode (either "list", "namelist", "tree" or 
"compacttree")..]
 
 pattern viewmode
 
@@ -135,11 +135,11 @@
 typeset svcpattern="$1"
 typeset viewmode="$2"
 
-if [[ "${viewmode}" != ~(Elr)(list|namelist|tree) ]] ; then
+if [[ "${viewmode}" != ~(Elr)(list|namelist|tree|compacttree) ]] ; then
        fatal_error $"Invalid view mode \"${viewmode}\"."
 fi
 
-typeset svc=(
+compound svc=(
        typeset -A proptree
 )
 
@@ -159,8 +159,11 @@
                typeset + | egrep "^svc.proptree\["
                ;;
        tree)
-               printf "%B\n" svc
+               print -v svc
                ;;
+       compacttree)
+               print -C svc
+               ;;
        *)
                fatal_error $"Invalid view mode \"${viewmode}\"."
                ;;
--- old/usr/src/lib/libshell/common/scripts/termclock.sh        Fri Sep 25 
06:35:07 2009
+++ new/usr/src/lib/libshell/common/scripts/termclock.sh        Fri Sep 25 
06:35:05 2009
@@ -22,7 +22,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -193,7 +193,7 @@
                6<#((0))
                cat <&6
 
-               redirect 6<&- ;  rm -f "${scratchfile}" ; redirect 
6<>"${scratchfile}"
+               redirect 6<&- ;  rm -f "${scratchfile}" ; redirect 6<> 
"${scratchfile}"
 
                c="" ; read -r -t ${update_interval} -N 1 c
                if [[ "$c" != "" ]] ; then
@@ -221,6 +221,7 @@
 builtin basename
 builtin cat
 builtin date
+builtin mktemp
 builtin rm
 
 typeset progname="${ basename "${0}" ; }"
@@ -228,7 +229,7 @@
 float -r M_PI=3.14159265358979323846
 
 # terminal size rect
-typeset -C termsize=(
+compound termsize=(
        integer columns=-1
        integer lines=-1
 )
@@ -235,7 +236,7 @@
 
 typeset init_screen="true"
 
-typeset -C clock=(
+compound clock=(
        float   middle_x
        float   middle_y
        integer len_x
@@ -244,17 +245,17 @@
 
 
 # set clock properties
-typeset -C seconds=(
+compound seconds=(
        float val
        typeset ch
        float   scale
        integer length )
-typeset -C minutes=(
+compound minutes=(
        float val
        typeset ch
        float   scale
        integer length )
-typeset -C hours=(
+compound hours=(
        float val
        typeset ch
        float   scale
@@ -267,7 +268,7 @@
 float update_interval=0.9
 
 typeset -r termclock_usage=$'+
-[-?\n@(#)\$Id: termclock (Roland Mainz) 2008-11-04 \$\n]
+[-?\n@(#)\$Id: termclock (Roland Mainz) 2009-05-09 \$\n]
 [-author?Roland Mainz <roland.mainz at nrubsig.org>]
 [-author?David Korn <dgk at research.att.com>]
 [+NAME?termclock - analog clock for terminals]
@@ -290,7 +291,6 @@
 
 # prechecks
 which tput >/dev/null   || fatal_error $"tput not found."
-which mktemp >/dev/null || fatal_error $"mktemp not found."
 (( update_interval >= 0. && update_interval <= 7200. )) || fatal_error 
$"invalid update_interval value."
 
 # create temporary file for double-buffering and register an EXIT trap
@@ -298,7 +298,7 @@
 scratchfile="${ mktemp "/tmp/termclock.ppid${PPID}_pid$$.XXXXXX" ; }"
 [[ "${scratchfile}" != "" ]] || fatal_error $"Could not create temporary file 
name."
 trap 'rm -f "${scratchfile}"' EXIT
-rm -f "${scratchfile}" ; redirect 6<>"${scratchfile}" || fatal_error $"Could 
not create temporary file."
+rm -f "${scratchfile}" ; redirect 6<> "${scratchfile}" || fatal_error $"Could 
not create temporary file."
 
 # register trap to handle window size changes
 trap 'init_screen="true"' WINCH
--- old/usr/src/lib/libshell/common/scripts/test_net_sctp.sh    Fri Sep 25 
06:35:10 2009
+++ new/usr/src/lib/libshell/common/scripts/test_net_sctp.sh    Fri Sep 25 
06:35:08 2009
@@ -22,7 +22,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -44,13 +44,13 @@
 print "# (via fetching the main page of http://www.sctp.org/ via SCTP)"
 
 # open sctp stream and print it's number
-redirect {netfd}<>/dev/sctp/www.sctp.org/80
+redirect {netfd}<> /dev/sctp/www.sctp.org/80
 print "sctp fd=${netfd}"
 
 # send HTTP request    
 request="GET / HTTP/1.1\r\n"
 request+="Host: www.sctp.org\r\n"
-request+="User-Agent: ksh93/test_net_sctp (2008-10-14; $(uname -s -r -p))\r\n"
+request+="User-Agent: ksh93/test_net_sctp (2009-04-08; $(uname -s -r -p))\r\n"
 request+="Connection: close\r\n"
 print -u${netfd} -n -- "${request}\r\n"
 
--- old/usr/src/lib/libshell/common/scripts/xmldocumenttree1.sh Fri Sep 25 
06:35:13 2009
+++ new/usr/src/lib/libshell/common/scripts/xmldocumenttree1.sh Fri Sep 25 
06:35:11 2009
@@ -22,7 +22,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -106,8 +106,8 @@
             nodepath[${nodesnum}]+=( 
                 typeset tagtype="element"
                 typeset tagname="${tag_value}"
-                typeset -A tagattributes=( )
-                typeset -A nodes=( )
+                compound -A tagattributes
+                compound -A nodes
                 integer nodesnum=0
             )
 
@@ -268,13 +268,13 @@
 typeset progname="${ basename "${0}" ; }"
 
 typeset -r xmldocumenttree1_usage=$'+
-[-?\n@(#)\$Id: xmldocumenttree1 (Roland Mainz) 2008-10-14 \$\n]
+[-?\n@(#)\$Id: xmldocumenttree1 (Roland Mainz) 2009-05-09 \$\n]
 [-author?Roland Mainz <roland.mainz at nrubsig.org>]
 [+NAME?xmldocumenttree1 - XML tree demo]
 [+DESCRIPTION?\bxmldocumenttree\b is a small ksh93 compound variable demo
         which reads a XML input file, converts it into an internal
         variable tree representation and outputs it in the format
-        specified by viewmode (either "list", "namelist" or "tree").]
+        specified by viewmode (either "list", "namelist", "tree" or 
"compacttree").]
 
 file viewmode
 
@@ -296,15 +296,15 @@
     fatal_error $"No file given."
 fi
 
-if [[ "${viewmode}" != ~(Elr)(list|namelist|tree) ]] ; then
+if [[ "${viewmode}" != ~(Elr)(list|namelist|tree|compacttree) ]] ; then
     fatal_error $"Invalid view mode \"${viewmode}\"."
 fi
 
-typeset -C xdoc
-typeset -A xdoc.nodes
+compound xdoc
+compound -A xdoc.nodes
 integer xdoc.nodesnum=0
 
-typeset -C stack
+compound stack
 typeset -a stack.items=( [0]="doc.nodes" )
 integer stack.pos=0
 
@@ -343,8 +343,11 @@
         typeset + | egrep "xdoc.*(tagname|tagtype|tagval|tagattributes)"
         ;;
     tree)
-        print -- "${xdoc}"
+        print -v xdoc
         ;;
+    compacttree)
+        print -C xdoc
+        ;;
        *)
         fatal_error $"Invalid view mode \"${viewmode}\"."
         ;;
--- old/usr/src/lib/libshell/common/sh.1        Fri Sep 25 06:35:16 2009
+++ new/usr/src/lib/libshell/common/sh.1        Fri Sep 25 06:35:14 2009
@@ -4,6 +4,7 @@
 .\"
 .\" @(#)sh.1 (dgk at research.att.com) 12/28/93
 .\"
+.xx labels=5
 .nr Z 1 \" set to 1 when command name is ksh, 2 for ksh93
 .ds OK [\|
 .ds CK \|]
@@ -20,15 +21,14 @@
 .\}
 .SH NAME
 .if \nZ=0 \{\
-sh, rsh, pfsh \- shell, the
+sh, rsh, pfsh \- shell, the standard/restricted command and programming 
language
 .\}
 .if \nZ=1 \{\
-ksh, rksh, pfksh \- KornShell, a
+ksh, rksh, pfksh \- KornShell, a standard/restricted command and programming 
language
 .\}
 .if \nZ=2 \{\
-ksh93, rksh93, pfksh93 \- KornShell, a
+ksh93, rksh93, pfksh93 \- KornShell, a standard/restricted command and 
programming language
 .\}
-standard/restricted command and programming language
 .SH SYNOPSIS
 .if \nZ=0 \{\
 .B sh
@@ -699,7 +699,7 @@
 The right hand side of a variable assignment undergoes all the expansion
 list below except word splitting, brace expansion, and file name generation.
 When the left hand side is an assignment is a compound variable and
-the right hand is the name of a compound variable, the coumpound variable
+the right hand is the name of a compound variable, the compound variable
 on the right will be copied or appended to the compound variable on the left.
 .SS Comments.
 .PD 0
@@ -765,6 +765,8 @@
 .TP
 .B "command=\(fmcommand  \(fm"
 .TP
+.B "compound=\(fmtypeset \-C\(fm"
+.TP
 .B "fc=hist"
 .TP
 .B "float=\(fmtypeset \-lE\(fm"
@@ -945,6 +947,14 @@
 so programs that expect to
 .IR lseek (2)
 on the file will not work.
+.PP
+Process substitution of the form
+\f3<(\fP\f2list\^\fP\f3)\fP
+can also be used with the
+.B <
+redirection operator which causes the output of
+.I list\^
+to be standard input or the input for whatever file descriptor is specified.
 .SS Parameter Expansion.
 A
 .I parameter\^
@@ -1179,7 +1189,7 @@
 .I sub1\^
 and
 .I sub2\^
-inclusive (or all elments for
+inclusive (or all elements for
 .B \(**
 and
 .BR @ )
@@ -1916,6 +1926,12 @@
 characters delimit a null field.
 .TP
 .B
+.SM JOBMAX
+This variable defines the maximum number running background jobs
+that can run at a time.  When this limit is reached, the
+shell will wait for a job to complete before staring a new job.
+.TP
+.B
 .SM LANG
 This variable determines the locale category for any
 category not specifically selected with a variable
@@ -2856,8 +2872,8 @@
 .PP
 .if t .RS
 .B
-.if n abs acos acosh asin asinh atan atan2 atanh cbrt copysign cos cosh erf 
erfc exp exp2 expm1 fabs fdim finite floor fma fmax fmod hypot ilogb int isinf 
isnan lgamma log log2 logb nearbyint nextafter nexttoward pow remainder rint 
round sin sinh sqrt tan tanh tgamma trunc
-.if t abs   acos   acosh   asin   asinh   atan   atan2   atanh   cbrt   
copysign   cos   cosh   erf  erfc   exp   exp2   expm1   fabs   fdim   finite   
floor  fma   fmax   fmod   hypot   ilogb   int   isinf   isnan   lgamma   log   
log2   logb   nearbyint   nextafter   nexttoward  pow   rint   round   sin   
sinh   sqrt   tan   tanh   tgamma   trunc
+.if n abs acos acosh asin asinh atan atan2 atanh cbrt copysign cos cosh erf 
erfc exp exp2 expm1 fabs fdim finite floor fma fmax fmod hypot ilogb int isinf 
isnan j0 j1 jn lgamma log log2 logb nearbyint nextafter nexttoward pow 
remainder rint round sin sinh sqrt tan tanh tgamma trunc y0 y1 yn
+.if t abs   acos   acosh   asin   asinh   atan   atan2   atanh   cbrt   
copysign   cos   cosh   erf  erfc   exp   exp2   expm1   fabs   fdim   finite   
floor  fma   fmax   fmod   j0      j1      jn      hypot   ilogb   int   isinf  
 isnan   lgamma   log   log2   logb   nearbyint   nextafter   nexttoward  pow   
rint   round   sin   sinh   sqrt   tan   tanh   tgamma   trunc   y0      y1     
 yn
 .if t .RE
 .PP
 An internal representation of a
@@ -3305,6 +3321,16 @@
 .B noclobber
 option.
 .TP
+.BI >; word
+Write output to a temporary file.  If the command completes
+successfully rename it to
+.IR word  ,
+otherwise, delete the temporary file.
+.BI >; word
+cannot be used with the
+.IR exec (2).
+built-in.
+.TP
 .BI >> word
 Use file
 .I word\^
@@ -3316,8 +3342,19 @@
 Open file
 .I word\^
 for reading and writing
-as standard input.
+as standard output.
 .TP
+.BI <>; word
+The same as 
+.BI <> word
+except that if the command completes successfully,
+.I word\^
+is truncated to the offset at command completion.
+.BI <>; word
+cannot be used with the
+.IR exec (2).
+built-in.
+.TP
 \f3<<\fP\*(OK\f3\-\fP\*(CK\f2word\fP
 The shell input is read up to a line that is the same as
 .IR word
@@ -5772,7 +5809,7 @@
 is used for each of the parameters that requires
 .IR pathname .
 .TP
-\f3getopts\fP \*(OK \f3\ -a\fP \f2name\^\fP \*(CK \f2optstring vname\^\fP 
\*(OK \f2arg\^\fP .\|.\|. \*(CK
+\f3getopts\fP \*(OK \f3\ \-a\fP \f2name\^\fP \*(CK \f2optstring vname\^\fP 
\*(OK \f2arg\^\fP .\|.\|. \*(CK
 Checks
 .I arg
 for legal options.
@@ -6038,7 +6075,7 @@
 .BI "exec /bin/newgrp" " arg\^"
 \&.\|.\|.\^.
 .TP
-\f3print\fP \*(OK \f3\-Renprs\^\fP \*(CK \*(OK \f3\-u\fP \f2unit\^\fP\*(CK 
\*(OK \f3\-f\fP \f2format\^\fP \*(CK \*(OK \f2arg\^\fP .\|.\|. \*(CK
+\f3print\fP \*(OK \f3\-CRenprsv\^\fP \*(CK \*(OK \f3\-u\fP \f2unit\^\fP\*(CK 
\*(OK \f3\-f\fP \f2format\^\fP \*(CK \*(OK \f2arg\^\fP .\|.\|. \*(CK
 With no options or with option
 .B \-
 or
@@ -6060,9 +6097,11 @@
 options are ignored.
 Otherwise,
 unless the
-.B \-R
-or
+.BR \-C ,
+.BR \-R ,
 .BR \-r ,
+or
+.B \-v
 are specified, the following
 escape conventions will be applied:
 .RS
@@ -6133,6 +6172,24 @@
 .B \(bv&
 instead of standard output.
 The
+.B \-v
+option treats each
+.I arg\^
+as a variable name and writes the value in
+the
+.B printf
+.B %B
+format.
+The
+.B \-C
+option treats each
+.I arg\^
+as a variable name and writes the value in
+the
+.B printf
+.B %#B
+format.
+The
 .B \-s
 option causes the
 arguments to be written onto the history file
@@ -6164,8 +6221,10 @@
 .B format\^
 string is reused to format remaining arguments.
 The following extensions can also be used:
-.BL
-.LI
+.RS
+.PD 0
+.TP
+.B %b
 A
 .B %b
 format can be used instead of
@@ -6174,16 +6233,21 @@
 .I arg\^
 to be expanded as described in
 .BR print.
-.LI
+.TP
+.B %B
 A
 .B %B
 option causes each of the arguments to be treated
 as variable names and the binary value of variable
 will be printed. 
-This is most useful for variables whose attribute
+The alternate flag
+.B #
+causes a compound variable to be output on a single line.
+This is most useful for compound variables and variables whose attribute
 is
 .BR \-b .
-.LI
+.TP
+.B %H
 A
 .B %H
 format can be used instead of
@@ -6192,7 +6256,8 @@
 .I arg\^
 that are special in HTML and XML
 to be output as their entity name.
-.LI
+.TP
+.B %P
 A
 .B %P
 format can be used instead of
@@ -6201,7 +6266,8 @@
 .I arg\^
 to be interpreted as an extended regular
 expression and be printed as a shell pattern.
-.LI
+.TP
+.B %R
 A
 .B %R
 format can be used instead of
@@ -6210,7 +6276,8 @@
 .I arg\^
 to be interpreted as a shell pattern
 and to be printed as an extended regular expression.
-.LI
+.TP
+.B %q
 A
 .B %q
 format can be used instead of
@@ -6217,7 +6284,8 @@
 .B %s
 to cause the resulting string to be quoted in a manner than can
 be reinput to the shell.
-.LI
+.TP
+.BI %( date-format )T
 A
 .BI %( date-format )T
 format can be use to treat an argument as a date/time string
@@ -6226,11 +6294,13 @@
 as defined for the
 .BR date (1)
 command.
-.LI
+.TP
+.B %Z
 A
 .B %Z
 format will output a byte whose value is 0.
-.LI
+.TP
+.B %d
 The precision field of the
 .B %d
 format can be followed by a
@@ -6241,7 +6311,8 @@
 flag character causes
 .IB base #
 to be prepended.
-.LI
+.TP
+.B #
 The
 .B #
 flag when used with the
@@ -6250,7 +6321,6 @@
 causes the output to be displayed in thousands units with one of the suffixes
 .B "k M G T P E"
 to indicate the unit.
-.LI
 The
 .B #
 flag when used with the
@@ -6258,11 +6328,14 @@
 specifier causes the output to be displayed in 1024 with one of the suffixes
 .B "Ki Mi Gi Ti Pi Ei"
 to indicate the unit.
-.LI
+.TP
+.B =
 The
 .B =
 flag has been added to center the output within the specified field width.
-.LE
+.PD
+.PP
+.RE
 .TP
 \f3pwd\fP \*(OK \f3\-LP\fP \*(CK
 Outputs the value of the current working
@@ -6881,6 +6954,13 @@
 command
 with no arguments prints a list
 of commands associated with each signal number.
+.PP
+An
+.B exit
+or
+.B return
+without an argument in a trap action will
+preserve the exit status of the command that invoked the trap.
 .TP
 \f3true\fP
 Does nothing, and exits 0. Used with
@@ -6887,6 +6967,11 @@
 .B while
 for infinite loops.
 .TP
+\f3true\fP
+Does nothing, and exits 0. Used with
+.B while
+for infinite loops.
+.TP
 \(dg\(dg \f3typeset\fP \*(OK \f3\(+-ACHSflbnprtux\^\fP \*(CK \*(OK 
\f3\(+-EFLRXZi\*(OK\f2n\^\fP\*(CK \*(CK  \*(OK \f3\-T 
\f2tname\fP=(\f2assign_list\fP) \*(CK \*(OK \f3\-h \f2str\fP \*(CK \*(OK 
\f3\-a\fP \*(OK\f2type\fP\*(CK \*(CK \*(OK 
\f2vname\^\fP\*(OK\f3=\fP\f2value\^\fP \*(CK \^ \*(CK .\|.\|.
 Sets attributes and values for shell variables and functions.
 When invoked inside a function defined with the
@@ -7122,7 +7207,7 @@
 a function whose name has been passed as an argument.
 .TP
 .B \-p
-The name, attributes and values for the give
+The name, attributes and values for the given
 .IR vname s
 are written on standard output in a form that can be
 used as shell input.
--- old/usr/src/lib/libshell/common/sh/args.c   Fri Sep 25 06:35:20 2009
+++ new/usr/src/lib/libshell/common/sh/args.c   Fri Sep 25 06:35:18 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -264,8 +264,13 @@
                                ap->kiafile = opt_info.arg;
                                n = 'n';
                        }
-                       /* FALL THRU */
+                       /*FALLTHROUGH*/
 #endif /* SHOPT_KIA */
+#if SHOPT_REGRESS
+                       goto skip;
+                   case 'I':
+                       continue;
+#endif /* SHOPT_REGRESS */
                    skip:
                    default:
                        if(cp=strchr(optksh,n))
@@ -384,9 +389,9 @@
                off_option(&newflags,SH_NOEXEC);
        if(is_option(&newflags,SH_PRIVILEGED))
                on_option(&newflags,SH_NOUSRPROFILE);
-       if(is_option(&newflags,SH_PRIVILEGED) != sh_isoption(SH_PRIVILEGED))
+       if(!sh_isstate(SH_INIT) && is_option(&newflags,SH_PRIVILEGED) != 
sh_isoption(SH_PRIVILEGED) || sh_isstate(SH_INIT) && 
is_option(&((Arg_t*)shp->arg_context)->sh->offoptions,SH_PRIVILEGED) && 
shp->userid!=shp->euserid)
        {
-               if(sh_isoption(SH_PRIVILEGED))
+               if(!is_option(&newflags,SH_PRIVILEGED))
                {
                        setuid(shp->userid);
                        setgid(shp->groupid);
@@ -789,6 +794,42 @@
 }
 #endif
 
+struct argnod *sh_argprocsub(Shell_t *shp,struct argnod *argp)
+{
+       /* argument of the form <(cmd) or >(cmd) */
+       register struct argnod *ap;
+       int monitor, fd, pv[2];
+       int subshell = shp->subshell;
+       ap = (struct argnod*)stkseek(shp->stk,ARGVAL);
+       ap->argflag |= ARG_MAKE;
+       ap->argflag &= ~ARG_RAW;
+       sfwrite(shp->stk,e_devfdNN,8);
+       sh_pipe(pv);
+       fd = argp->argflag&ARG_RAW;
+       sfputr(shp->stk,fmtbase((long)pv[fd],10,0),0);
+       ap = (struct argnod*)stkfreeze(shp->stk,0);
+       shp->inpipe = shp->outpipe = 0;
+       if(monitor = (sh_isstate(SH_MONITOR)!=0))
+               sh_offstate(SH_MONITOR);
+       shp->subshell = 0;
+       if(fd)
+       {
+               shp->inpipe = pv;
+               sh_exec((Shnode_t*)argp->argchn.ap,(int)sh_isstate(SH_ERREXIT));
+       }
+       else
+       {
+               shp->outpipe = pv;
+               sh_exec((Shnode_t*)argp->argchn.ap,(int)sh_isstate(SH_ERREXIT));
+       }
+       shp->subshell = subshell;
+       if(monitor)
+               sh_onstate(SH_MONITOR);
+       close(pv[1-fd]);
+       sh_iosave(shp,-pv[fd], shp->topfd, (char*)0);
+       return(ap);
+}
+
 /* Argument expansion */
 static int arg_expand(Shell_t *shp,register struct argnod *argp, struct argnod 
**argchain,int flag)
 {
@@ -797,37 +838,11 @@
 #if SHOPT_DEVFD
        if(*argp->argval==0 && (argp->argflag&ARG_EXP))
        {
-               /* argument of the form (cmd) */
-               register struct argnod *ap;
-               int monitor, fd, pv[2];
-               ap = (struct argnod*)stkseek(shp->stk,ARGVAL);
-               ap->argflag |= ARG_MAKE;
-               ap->argflag &= ~ARG_RAW;
+               struct argnod *ap;
+               ap = sh_argprocsub(shp,argp);
                ap->argchn.ap = *argchain;
                *argchain = ap;
                count++;
-               sfwrite(shp->stk,e_devfdNN,8);
-               sh_pipe(pv);
-               fd = argp->argflag&ARG_RAW;
-               sfputr(shp->stk,fmtbase((long)pv[fd],10,0),0);
-               ap = (struct argnod*)stkfreeze(shp->stk,0);
-               shp->inpipe = shp->outpipe = 0;
-               if(monitor = (sh_isstate(SH_MONITOR)!=0))
-                       sh_offstate(SH_MONITOR);
-               if(fd)
-               {
-                       shp->inpipe = pv;
-                       
sh_exec((Shnode_t*)argp->argchn.ap,(int)sh_isstate(SH_ERREXIT));
-               }
-               else
-               {
-                       shp->outpipe = pv;
-                       
sh_exec((Shnode_t*)argp->argchn.ap,(int)sh_isstate(SH_ERREXIT));
-               }
-               if(monitor)
-                       sh_onstate(SH_MONITOR);
-               close(pv[1-fd]);
-               sh_iosave(shp,-pv[fd], shp->topfd, (char*)0);
        }
        else
 #endif /* SHOPT_DEVFD */
--- old/usr/src/lib/libshell/common/sh/arith.c  Fri Sep 25 06:35:23 2009
+++ new/usr/src/lib/libshell/common/sh/arith.c  Fri Sep 25 06:35:21 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -25,7 +25,6 @@
  */
 
 #include       "defs.h"
-#include       <ctype.h>
 #include       "lexstates.h"
 #include       "name.h"
 #include       "streval.h"
@@ -65,6 +64,7 @@
        register Namval_t *mp;
        int     flags = HASH_NOSCOPE|HASH_SCOPE|HASH_BUCKET;
        Dt_t    *sdict = (shp->st.real_fun? shp->st.real_fun->sdict:0);
+       Dt_t    *root = shp->var_tree;
        assign = assign?NV_ASSIGN:NV_NOASSIGN;
        if(cp>=lvalue->expr &&  cp < lvalue->expr+lvalue->elen)
        {
@@ -79,7 +79,11 @@
                        cp[flag] = c;
                        return(&FunNode);
                }
-               np = nv_open(cp,shp->var_tree,assign|NV_VARNAME);
+               if(!np && assign)
+                       np = nv_open(cp,shp->var_tree,assign|NV_VARNAME);
+               if(!np)
+                       return(0);
+               root = shp->last_root;
                cp[flag] = c;
                if(cp[flag+1]=='[')
                        flag++;
@@ -87,7 +91,7 @@
                        flag = 0;
                cp = (char*)np;
        }
-       if((lvalue->emode&ARITH_COMP) && dtvnext(shp->var_tree) && 
((mp=nv_search(cp,shp->var_tree,flags))||(sdict && 
(mp=nv_search(cp,sdict,flags)))))
+       if((lvalue->emode&ARITH_COMP) && dtvnext(root) && 
((mp=nv_search(cp,root,flags))||(sdict && (mp=nv_search(cp,sdict,flags)))))
        {
                while(nv_isref(mp))
                {
@@ -317,9 +321,19 @@
                if(sh_isoption(SH_NOEXEC))
                        return(0);
                np = scope(shp,np,lvalue,0);
+               if(!np)
+               {
+                       if(sh_isoption(SH_NOUNSET))
+                       {
+                               *ptr = lvalue->value;
+                               goto skip;
+                       }
+                       return(0);
+               }
                if(((lvalue->emode&2) || lvalue->level>1 || 
sh_isoption(SH_NOUNSET)) && nv_isnull(np) && !nv_isattr(np,NV_INTEGER))
                {
                        *ptr = nv_name(np);
+               skip:
                        lvalue->value = (char*)ERROR_dictionary(e_notset);
                        lvalue->emode |= 010;
                        return(0);
--- old/usr/src/lib/libshell/common/sh/array.c  Fri Sep 25 06:35:26 2009
+++ new/usr/src/lib/libshell/common/sh/array.c  Fri Sep 25 06:35:24 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -189,6 +189,18 @@
        return(up);
 }
 
+int nv_arrayisset(Namval_t *np, Namarr_t *arp)
+{
+       register struct index_array *ap = (struct index_array*)arp;
+       union Value *up;
+       if(is_associative(ap))
+               return((np = nv_opensub(np)) && !nv_isnull(np));
+       if(ap->cur >= ap->maxi)
+               return(0);
+       up = &(ap->val[ap->cur]);
+       return(up->cp && up->cp!=Empty);
+}
+
 /*
  * Get the Value pointer for an array.
  * Delete space as necessary if flag is ARRAY_DELETE
@@ -487,7 +499,7 @@
                scan = ap->nelem&ARRAY_SCAN;
                if(mp && mp!=np)
                {
-                       if(!is_associative(ap) && string && !nv_type(np) && 
nv_isvtree(mp))
+                       if(!is_associative(ap) && string && !(flags&NV_APPEND) 
&& !nv_type(np) && nv_isvtree(mp))
                        {
                                if(!nv_isattr(np,NV_NOFREE))
                                        _nv_unset(mp,flags&NV_RDONLY);
@@ -529,7 +541,7 @@
                                                ap->nelem--;
                                }
                        }
-                       if(array_elem(ap)==0 && ((ap->nelem&ARRAY_SCAN) || 
!is_associative(ap)))
+                       if(array_elem(ap)==0 && (ap->nelem&ARRAY_SCAN))
                        {
                                if(is_associative(ap))
                                        (*ap->fun)(np, NIL(char*), NV_AFREE);
@@ -602,12 +614,13 @@
 
 static void array_copytree(Namval_t *np, Namval_t *mp)
 {
-       char            *val;
        Namfun_t        *fp = nv_disc(np,NULL,NV_POP);
        nv_offattr(np,NV_ARRAY);
        nv_clone(np,mp,0);
+       if(np->nvalue.cp && !nv_isattr(np,NV_NOFREE))
+               free((void*)np->nvalue.cp);
+       np->nvalue.cp = 0;
        np->nvalue.up = &mp->nvalue;
-       val = sfstruse(sh.strbuf);
        fp->nofree  &= ~1;
        nv_disc(np,(Namfun_t*)fp, NV_FIRST);
        fp->nofree |= 1;
@@ -662,8 +675,7 @@
                if(nv_hasdisc(np,&array_disc) || nv_isvtree(np))
                {
                        ap->header.table = dtopen(&_Nvdisc,Dtoset);
-                       mp = nv_search("0", ap->header.table, 0);
-
+                       mp = nv_search("0", ap->header.table,NV_ADD);
                        if(mp && nv_isnull(mp))
                        {
                                Namfun_t *fp;
@@ -670,7 +682,7 @@
                                ap->val[0].np = mp;
                                array_setbit(ap->bits,0,ARRAY_CHILD);
                                for(fp=np->nvfun; fp && !fp->disc->readf; 
fp=fp->next);
-                               if(fp)
+                               if(fp && fp->disc && fp->disc->readf)
                                        (*fp->disc->readf)(mp,(Sfio_t*)0,0,fp);
                                i++;
                        }
@@ -677,7 +689,7 @@
                }
                else if((ap->val[0].cp=np->nvalue.cp))
                        i++;
-               else if(nv_isattr(np,NV_INTEGER))
+               else if(nv_isattr(np,NV_INTEGER) && !nv_isnull(np))
                {
                        Sfdouble_t d= nv_getnum(np);
                        i++;
@@ -1077,9 +1089,15 @@
        }
        if(mode && np)
        {
+               Namarr_t *ap = nv_arrayptr(np);
+               int scan = 0;
+               if(ap)
+                       scan = ap->nelem&ARRAY_SCAN;
                if((mode&NV_ASSIGN) && (cp[1]=='=' || cp[1]=='+'))
                        mode |= NV_ADD;
                nv_putsub(np, sp, 
((mode&NV_ADD)?ARRAY_ADD:0)|(cp[1]&&(mode&NV_ADD)?ARRAY_FILL:mode&ARRAY_FILL));
+               if(scan)
+                       ap->nelem |= scan;
        }
        if(quoted)
                stakseek(count);
@@ -1252,7 +1270,7 @@
                        else if(ap->header.nelem&ARRAY_NOSCOPE)
                                mode = HASH_NOSCOPE;
                        if(*sp==0 && (mode&NV_ADD))
-                               sfprintf(sfstderr,"adding empty subscript\n"); 
+                               errormsg(SH_DICT,ERROR_warn(0),"adding empty 
subscript"); 
                        if(sh.subshell && (mp=nv_search(sp,ap->header.table,0)) 
&& nv_isnull(mp))
                                ap->cur = mp;
                        if((mp || (mp=nv_search(sp,ap->header.table,mode))) && 
nv_isnull(mp) && (mode&NV_ADD))
@@ -1280,7 +1298,9 @@
                                ap->nextpos = 
(Namval_t*)dtnext(ap->header.table,mp);
                        }
                        np = mp;
-                       if(ap->pos != np && !(ap->header.nelem&ARRAY_SCAN))
+                       if(ap->pos && ap->pos==np)
+                               ap->header.nelem |= ARRAY_SCAN;
+                       else if(!(ap->header.nelem&ARRAY_SCAN))
                                ap->pos = 0;
                        ap->cur = np;
                }
--- old/usr/src/lib/libshell/common/sh/bash.c   Fri Sep 25 06:35:29 2009
+++ new/usr/src/lib/libshell/common/sh/bash.c   Fri Sep 25 06:35:27 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/sh/defs.c   Fri Sep 25 06:35:32 2009
+++ new/usr/src/lib/libshell/common/sh/defs.c   Fri Sep 25 06:35:30 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/sh/deparse.c        Fri Sep 25 06:35:35 2009
+++ new/usr/src/lib/libshell/common/sh/deparse.c        Fri Sep 25 06:35:33 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/sh/env.c    Fri Sep 25 06:35:38 2009
+++ new/usr/src/lib/libshell/common/sh/env.c    Fri Sep 25 06:35:36 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/sh/expand.c Fri Sep 25 06:35:41 2009
+++ new/usr/src/lib/libshell/common/sh/expand.c Fri Sep 25 06:35:39 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -32,6 +32,7 @@
 #   include    "test.h"
 #else
 #   include    <ast.h>
+#   include    <ctype.h>
 #   include    <setjmp.h>
 #endif /* KSHELL */
 #include       <glob.h>
--- old/usr/src/lib/libshell/common/sh/fault.c  Fri Sep 25 06:35:44 2009
+++ new/usr/src/lib/libshell/common/sh/fault.c  Fri Sep 25 06:35:42 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -98,7 +98,7 @@
                }
                return;
        }
-       if(shp->subshell && sig!=SIGINT && sig!=SIGQUIT && sig!=SIGWINCH)
+       if(shp->subshell && sig!=SIGINT && sig!=SIGQUIT && sig!=SIGWINCH && 
sig!=SIGCONT)
        {
                shp->exitval = SH_EXITSIG|sig;
                sh_subfork();
@@ -141,7 +141,7 @@
                        }
                        /* mark signal and continue */
                        shp->trapnote |= SH_SIGSET;
-                       if(sig < shp->sigmax)
+                       if(sig <= shp->sigmax)
                                shp->sigflag[sig] |= SH_SIGSET;
 #if  defined(VMFL) && (VMALLOC_VERSION>=20031205L)
                        if(abortsig(sig))
@@ -186,7 +186,6 @@
 #endif /* SIGTSTP */
        }
 #ifdef ERROR_NOTIFY
-       /* This is obsolete */
        if((error_info.flags&ERROR_NOTIFY) && shp->bltinfun)
                action = (*shp->bltinfun)(-sig,(char**)0,(void*)0);
        if(action>0)
@@ -198,7 +197,7 @@
                return;
        }
        shp->trapnote |= flag;
-       if(sig < shp->sigmax)
+       if(sig <= shp->sigmax)
                shp->sigflag[sig] |= flag;
        if(pp->mode==SH_JMPCMD && sh_isstate(SH_STOPOK))
        {
@@ -215,23 +214,28 @@
 void sh_siginit(void *ptr)
 {
        Shell_t *shp = (Shell_t*)ptr;
-       register int sig, n=SIGTERM+1;
+       register int sig, n;
        register const struct shtable2  *tp = shtab_signals;
        sig_begin();
        /* find the largest signal number in the table */
-#ifdef SIGRTMIN
-       shp->sigruntime[SH_SIGRTMIN] = SIGRTMIN;
-#endif /* SIGRTMIN */
-#ifdef SIGRTMAX
-       shp->sigruntime[SH_SIGRTMAX] = SIGRTMAX;
-#endif /* SIGRTMAX */
+#if defined(SIGRTMIN) && defined(SIGRTMAX)
+       if ((n = SIGRTMIN) > 0 && (sig = SIGRTMAX) > n && sig < SH_TRAP)
+       {
+               shp->sigruntime[SH_SIGRTMIN] = n;
+               shp->sigruntime[SH_SIGRTMAX] = sig;
+       }
+#endif /* SIGRTMIN && SIGRTMAX */
+       n = SIGTERM;
        while(*tp->sh_name)
        {
-               sig = tp->sh_number&((1<<SH_SIGBITS)-1);
-               if ((tp->sh_number>>SH_SIGBITS) & SH_SIGRUNTIME)
-                       sig = shp->sigruntime[sig-1];
-               if(sig>n && sig<SH_TRAP)
-                       n = sig;
+               sig = (tp->sh_number&((1<<SH_SIGBITS)-1));
+               if (!(sig-- & SH_TRAP))
+               {
+                       if ((tp->sh_number>>SH_SIGBITS) & SH_SIGRUNTIME)
+                               sig = shp->sigruntime[sig];
+                       if(sig>n && sig<SH_TRAP)
+                               n = sig;
+               }
                tp++;
        }
        shp->sigmax = n++;
@@ -241,7 +245,7 @@
        for(tp=shtab_signals; sig=tp->sh_number; tp++)
        {
                n = (sig>>SH_SIGBITS);
-               if((sig &= ((1<<SH_SIGBITS)-1)) > shp->sigmax)
+               if((sig &= ((1<<SH_SIGBITS)-1)) > (shp->sigmax+1))
                        continue;
                sig--;
                if(n&SH_SIGRUNTIME)
@@ -291,7 +295,7 @@
 {
        register int    flag, sig = sh.sigmax;
        sh.sigflag[0] |= SH_SIGFAULT;
-       while(--sig>0)
+       for(sig=sh.sigmax; sig>0; sig--)
        {
                flag = sh.sigflag[sig];
                if((flag&(SH_SIGDONE|SH_SIGIGNORE|SH_SIGINTERACTIVE)) && 
!(flag&(SH_SIGFAULT|SH_SIGOFF)))
@@ -321,7 +325,8 @@
                        }
                        else if(sig && mode>1)
                        {
-                               signal(sig,SIG_IGN);
+                               if(sig!=SIGCHLD)
+                                       signal(sig,SIG_IGN);
                                flag &= ~SH_SIGFAULT;
                                flag |= SH_SIGOFF;
                        }
@@ -396,13 +401,25 @@
        }
        if(sh.sigflag[SIGALRM]&SH_SIGALRM)
                sh_timetraps();
+#ifdef SHOPT_BGX
+       if((sh.sigflag[SIGCHLD]&SH_SIGTRAP) && sh.st.trapcom[SIGCHLD])
+               job_chldtrap(&sh,sh.st.trapcom[SIGCHLD],1);
+       while(--sig>=0 && sig!=SIGCHLD)
+#else
        while(--sig>=0)
+#endif /* SHOPT_BGX */
        {
                if(sh.sigflag[sig]&SH_SIGTRAP)
                {
                        sh.sigflag[sig] &= ~SH_SIGTRAP;
                        if(trap=sh.st.trapcom[sig])
-                               sh_trap(trap,0);
+                       {
+                               Sfio_t *fp;
+                               if(sig==SIGPIPE && 
(fp=sfpool((Sfio_t*)0,sh.outpool,SF_WRITE)) && sferror(fp))
+                                       sfclose(fp);
+                               sh.oldexit = SH_EXITSIG|sig;
+                               sh_trap(trap,0);
+                       }
                }
        }
 }
@@ -465,7 +482,7 @@
        if(was_verbose)
                sh_onstate(SH_VERBOSE);
        exitset();
-       if(jmpval>SH_JMPTRAP)
+       if(jmpval>SH_JMPTRAP && (((struct checkpt*)shp->jmpbuffer)->prev || 
((struct checkpt*)shp->jmpbuffer)->mode==SH_JMPSCRIPT))
                siglongjmp(*shp->jmplist,jmpval);
        return(shp->exitval);
 }
@@ -568,8 +585,8 @@
        register int savxit = shp->exitval;
        shp->trapnote = 0;
        indone=1;
-       if(sig==0)
-               sig = shp->lastsig;
+       if(sig)
+               savxit = SH_EXITSIG|sig;
        if(shp->userinit)
                (*shp->userinit)(shp, -1);
        if(t=shp->st.trapcom[0])
@@ -604,6 +621,8 @@
        sfsync((Sfio_t*)sfstdin);
        sfsync((Sfio_t*)shp->outpool);
        sfsync((Sfio_t*)sfstdout);
+       if(savxit&SH_EXITSIG)
+               sig = savxit&SH_EXITMASK;
        if(sig)
        {
                /* generate fault termination code */
--- old/usr/src/lib/libshell/common/sh/fcin.c   Fri Sep 25 06:35:47 2009
+++ new/usr/src/lib/libshell/common/sh/fcin.c   Fri Sep 25 06:35:45 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/sh/init.c   Fri Sep 25 06:35:50 2009
+++ new/usr/src/lib/libshell/common/sh/init.c   Fri Sep 25 06:35:48 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -29,7 +29,6 @@
 
 #include        "defs.h"
 #include        <stak.h>
-#include        <ctype.h>
 #include        <ccode.h>
 #include        <pwd.h>
 #include        <tmx.h>
@@ -44,6 +43,7 @@
 #include       "builtins.h"
 #include       "FEATURE/time"
 #include       "FEATURE/dynamic"
+#include       "FEATURE/externs"
 #include       "lexstates.h"
 #include       "version.h"
 
@@ -56,6 +56,10 @@
 #define ATTRS          1
                        "B"
 #endif
+#if SHOPT_BGX
+#define ATTRS          1
+                       "J"
+#endif
 #if SHOPT_ACCT
 #define ATTRS          1
                        "L"
@@ -68,6 +72,10 @@
 #define ATTRS          1
                        "P"
 #endif
+#if SHOPT_REGRESS
+#define ATTRS          1
+                       "R"
+#endif
 #if ATTRS
                        " "
 #endif
@@ -195,22 +203,27 @@
 static void put_ed(register Namval_t* np,const char *val,int flags,Namfun_t 
*fp)
 {
        register const char *cp, *name=nv_name(np);
+       register int    newopt=0;
        Shell_t *shp = nv_shell(np);
        if(*name=='E' && nv_getval(sh_scoped(shp,VISINOD)))
                goto done;
-       sh_offoption(SH_VI);
-       sh_offoption(SH_EMACS);
-       sh_offoption(SH_GMACS);
        if(!(cp=val) && (*name=='E' || !(cp=nv_getval(sh_scoped(shp,EDITNOD)))))
                goto done;
        /* turn on vi or emacs option if editor name is either*/
        cp = path_basename(cp);
        if(strmatch(cp,"*[Vv][Ii]*"))
-               sh_onoption(SH_VI);
+               newopt=SH_VI;
        else if(strmatch(cp,"*gmacs*"))
-               sh_onoption(SH_GMACS);
+               newopt=SH_GMACS;
        else if(strmatch(cp,"*macs*"))
-               sh_onoption(SH_EMACS);
+               newopt=SH_EMACS;
+       if(newopt)
+       {
+               sh_offoption(SH_VI);
+               sh_offoption(SH_EMACS);
+               sh_offoption(SH_GMACS);
+               sh_onoption(newopt);
+       }
 done:
        nv_putv(np, val, flags, fp);
 }
@@ -220,11 +233,12 @@
 {
        Shell_t *shp = nv_shell(np);
        void    *histopen = shp->hist_ptr;
+       char    *cp;
        if(val && histopen)
        {
-               if(np==HISTFILE && strcmp(val,nv_getval(HISTFILE))==0) 
+               if(np==HISTFILE && (cp=nv_getval(np)) && strcmp(val,cp)==0) 
                        return;
-               if(np==HISTSIZE &&  sh_arith(val)==nv_getnum(HISTSIZE))
+               if(np==HISTSIZE && sh_arith(val)==nv_getnum(HISTSIZE))
                        return;
                hist_close(shp->hist_ptr);
        }
@@ -431,10 +445,18 @@
 static void put_ifs(register Namval_t* np,const char *val,int flags,Namfun_t 
*fp)
 {
        register struct ifs *ip = (struct ifs*)fp;
+       Shell_t         *shp;
        ip->ifsnp = 0;
+       if(!val)
+       {
+               fp = nv_stack(np, NIL(Namfun_t*));
+               if(fp && !fp->nofree)
+                       free((void*)fp);
+       }
        if(val != np->nvalue.cp)
                nv_putv(np, val, flags, fp);
-       
+       if(!val && !(flags&NV_CLONE) && (fp=np->nvfun) && !fp->disc && 
(shp=(Shell_t*)(fp->last)))
+               nv_stack(np,&((Init_t*)shp->init_context)->IFS_init.hdr);
 }
 
 /*
@@ -505,8 +527,10 @@
        struct tms tp;
        if(!val)
        {
-               nv_stack(np, NIL(Namfun_t*));
-               nv_unset(np);
+               fp = nv_stack(np, NIL(Namfun_t*));
+               if(fp && !fp->nofree)
+                       free((void*)fp);
+               nv_putv(np, val, flags, fp);
                return;
        }
        if(!np->nvalue.dp)
@@ -552,7 +576,9 @@
        register long n;
        if(!val)
        {
-               nv_stack(np, NIL(Namfun_t*));
+               fp = nv_stack(np, NIL(Namfun_t*));
+               if(fp && !fp->nofree)
+                       free((void*)fp);
                nv_unset(np);
                return;
        }
@@ -608,7 +634,9 @@
        Shell_t *shp = nv_shell(np);
        if(!val)
        {
-               nv_stack(np, NIL(Namfun_t*));
+               fp = nv_stack(np, NIL(Namfun_t*));
+               if(fp && !fp->nofree)
+                       free((void*)fp);
                nv_unset(np);
                return;
        }
@@ -627,8 +655,11 @@
 
 static char* get_lastarg(Namval_t* np, Namfun_t *fp)
 {
-       Shell_t *shp = nv_shell(np);
-       NOT_USED(np);
+       Shell_t *shp = nv_shell(np);
+       char    *cp;
+       int     pid;
+        if(sh_isstate(SH_INIT) && (cp=shp->lastarg) && *cp=='*' && 
(pid=strtol(cp+1,&cp,10)) && *cp=='*')
+               nv_putval(np,(pid==getppid()?cp+1:0),0);
        return(shp->lastarg);
 }
 
@@ -640,14 +671,15 @@
                sfprintf(shp->strbuf,"%.*g",12,*((double*)val));
                val = sfstruse(shp->strbuf);
        }
+       if(val)
+               val = strdup(val);
        if(shp->lastarg && !nv_isattr(np,NV_NOFREE))
                free((void*)shp->lastarg);
        else
                nv_offattr(np,NV_NOFREE);
-       if(val)
-               shp->lastarg = strdup(val);
-       else
-               shp->lastarg = 0;
+       shp->lastarg = (char*)val;
+       nv_offattr(np,NV_EXPORT);
+       np->nvenv = 0;
 }
 
 static int hasgetdisc(register Namfun_t *fp)
@@ -979,6 +1011,7 @@
        register int n;
        int type;
        static char *login_files[3];
+       memfatal();
        n = strlen(e_version);
        if(e_version[n-1]=='$' && e_version[n-2]==' ')
                e_version[n-2]=0;
@@ -1001,6 +1034,41 @@
 #if ERROR_VERSION >= 20000102L
        error_info.catalog = e_dict;
 #endif
+#if SHOPT_REGRESS
+       {
+               Opt_t*  nopt;
+               Opt_t*  oopt;
+               char*   a;
+               char**  av = argv;
+               char*   regress[3];
+
+               sh_regress_init(shp);
+               regress[0] = "__regress__";
+               regress[2] = 0;
+               /* NOTE: only shp is used by __regress__ at this point */
+               shp->bltindata.shp = shp;
+               while ((a = *++av) && a[0] == '-' && (a[1] == 'I' || a[1] == 
'-' && a[2] == 'r'))
+               {
+                       if (a[1] == 'I')
+                       {
+                               if (a[2])
+                                       regress[1] = a + 2;
+                               else if (!(regress[1] = *++av))
+                                       break;
+                       }
+                       else if (strncmp(a+2, "regress", 7))
+                               break;
+                       else if (a[9] == '=')
+                               regress[1] = a + 10;
+                       else if (!(regress[1] = *++av))
+                               break;
+                       nopt = optctx(0, 0);
+                       oopt = optctx(nopt, 0);
+                       b___regress__(2, regress, &shp->bltindata);
+                       optctx(oopt, nopt);
+               }
+       }
+#endif
        shp->cpipe[0] = -1;
        shp->coutpipe = -1;
        shp->userid=getuid();
@@ -1051,6 +1119,11 @@
                        shp->login_sh = 2;
        }
        env_init(shp);
+       if(!ENVNOD->nvalue.cp)
+       {
+               sfprintf(shp->strbuf,"%s/.kshrc",nv_getval(HOME));
+               nv_putval(ENVNOD,sfstruse(shp->strbuf),NV_RDONLY);
+       }
        *SHLVL->nvalue.ip +=1;
 #if SHOPT_SPAWN
        {
@@ -1058,9 +1131,13 @@
                 * try to find the pathname for this interpreter
                 * try using environment variable _ or argv[0]
                 */
-               char *last, *cp=nv_getval(L_ARGNOD);
+               char *cp=nv_getval(L_ARGNOD);
                char buff[PATH_MAX+1];
                shp->shpath = 0;
+#if _AST_VERSION >= 20090202L
+               if((n = pathprog(NiL, buff, sizeof(buff))) > 0 && n <= 
sizeof(buff))
+                       shp->shpath = strdup(buff);
+#else
                sfprintf(shp->strbuf,"/proc/%d/exe",getpid());
                if((n=readlink(sfstruse(shp->strbuf),buff,sizeof(buff)-1))>0)
                {
@@ -1067,6 +1144,7 @@
                        buff[n] = 0;
                        shp->shpath = strdup(buff);
                }
+#endif
                else if((cp && (sh_type(cp)&SH_TYPE_SH)) || (argc>0 && 
strchr(cp= *argv,'/')))
                {
                        if(*cp=='/')
@@ -1168,17 +1246,16 @@
        /* set[ug]id scripts require the -p flag */
        if(shp->userid!=shp->euserid || shp->groupid!=shp->egroupid)
        {
-#if SHOPT_P_SUID
+#ifdef SHOPT_P_SUID
                /* require sh -p to run setuid and/or setgid */
-               if(!sh_isoption(SH_PRIVILEGED) && shp->euserid < SHOPT_P_SUID)
+               if(!sh_isoption(SH_PRIVILEGED) && shp->userid >= SHOPT_P_SUID)
                {
                        setuid(shp->euserid=shp->userid);
                        setgid(shp->egroupid=shp->groupid);
                }
                else
-#else
-                       sh_onoption(SH_PRIVILEGED);
 #endif /* SHOPT_P_SUID */
+                       sh_onoption(SH_PRIVILEGED);
 #ifdef SHELLMAGIC
                /* careful of #! setuid scripts with name beginning with - */
                if(shp->login_sh && argv[1] && strcmp(argv[0],argv[1])==0)
@@ -1306,6 +1383,7 @@
        shp->fn_depth = shp->dot_depth = 0;
        sh_sigreset(0);
        *SHLVL->nvalue.ip +=1;
+       shp->st.filename = strdup(shp->lastarg);
        return(1);
 }
 
@@ -1314,7 +1392,7 @@
  */
 Namfun_t *nv_cover(register Namval_t *np)
 {
-       if(np==IFSNOD || np==PATHNOD || np==SHELLNOD || np==FPATHNOD || 
np==CDPNOD || np==SECONDS)
+       if(np==IFSNOD || np==PATHNOD || np==SHELLNOD || np==FPATHNOD || 
np==CDPNOD || np==SECONDS || np==ENVNOD)
                return(np->nvfun);
 #ifdef _hdr_locale
        if(np==LCALLNOD || np==LCTYPENOD || np==LCMSGNOD || np==LCCOLLNOD || 
np==LCNUMNOD || np==LANGNOD)
--- old/usr/src/lib/libshell/common/sh/io.c     Fri Sep 25 06:35:53 2009
+++ new/usr/src/lib/libshell/common/sh/io.c     Fri Sep 25 06:35:51 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -31,7 +31,6 @@
 #include       <fcin.h>
 #include       <ls.h>
 #include       <stdarg.h>
-#include       <ctype.h>
 #include       <regex.h>
 #include       "variables.h"
 #include       "path.h"
@@ -406,7 +405,7 @@
        sh_iostream(shp,0);
        /* all write steams are in the same pool and share outbuff */
        shp->outpool = sfopen(NIL(Sfio_t*),NIL(char*),"sw");  /* pool 
identifier */
-       shp->outbuff = (char*)malloc(IOBSIZE);
+       shp->outbuff = (char*)malloc(IOBSIZE+4);
        shp->errbuff = (char*)malloc(IOBSIZE/4);
        sfsetbuf(sfstderr,shp->errbuff,IOBSIZE/4);
        sfsetbuf(sfstdout,shp->outbuff,IOBSIZE);
@@ -548,7 +547,11 @@
        if(f2==shp->infd)
                shp->infd = fd;
        if(fd<0)
+       {
+               shp->toomany = 1;
+               ((struct checkpt*)shp->jmplist)->mode = SH_JMPERREXIT;
                errormsg(SH_DICT,ERROR_system(1),e_toomany);
+       }
        if(shp->fdptrs[fd]=shp->fdptrs[f2])
        {
                if(f2==job.fd)
@@ -717,6 +720,20 @@
        }
        if (fd >= 0)
        {
+               int nfd= -1;
+               if (flags & O_CREAT)
+               {
+                       struct stat st;
+                       if (stat(path,&st) >=0)
+                               nfd = open(path,flags,st.st_mode);
+               }
+               else
+                       nfd = open(path,flags);
+               if(nfd>=0)
+               {
+                       fd = nfd;
+                       goto ok;
+               }
                if((mode=sh_iocheckfd(shp,fd))==IOCLOSE)
                        return(-1);
                flags &= O_ACCMODE;
@@ -727,12 +744,21 @@
                if((fd=dup(fd))<0)
                        return(-1);
        }
-       else while((fd = open(path, flags, mode)) < 0)
-               if(errno!=EINTR || sh.trapnote)
-                       return(-1);
-#ifdef O_SERVICE
- ok:
+       else
+       {
+#if SHOPT_REGRESS
+               char    buf[PATH_MAX];
+               if(strncmp(path,"/etc/",5)==0)
+               {
+                       sfsprintf(buf, sizeof(buf), "%s%s", 
sh_regress_etc(path, __LINE__, __FILE__), path+4);
+                       path = buf;
+               }
 #endif
+               while((fd = open(path, flags, mode)) < 0)
+                       if(errno!=EINTR || sh.trapnote)
+                               return(-1);
+       }
+ ok:
        flags &= O_ACCMODE;
        if(flags==O_WRONLY)
                mode = IOWRITE;
@@ -939,10 +965,11 @@
        const char *message = e_open;
        int o_mode;             /* mode flag for open */
        static char io_op[7];   /* used for -x trace info */
-       int clexec=0, fn, traceon;
+       int trunc=0, clexec=0, fn, traceon;
        int r, indx = shp->topfd, perm= -1;
        char *tname=0, *after="", *trace = shp->st.trap[SH_DEBUGTRAP];
        Namval_t *np=0;
+       int isstring = shp->subshell?(sfset(sfstdout,0,0)&SF_STRING):0;
        if(flag==2)
                clexec = 1;
        if(iop)
@@ -951,7 +978,7 @@
        {
                iof=iop->iofile;
                fn = (iof&IOUFD);
-               if(fn==1 && shp->subshell && (flag==2 || 
(sfset(sfstdout,0,0)&SF_STRING)))
+               if(fn==1 && shp->subshell && !shp->subshare && (flag==2 || 
isstring))
                        sh_subfork();
                io_op[0] = '0'+(iof&IOUFD);
                if(iof&IOPUT)
@@ -978,6 +1005,16 @@
                                strcpy(ap->argval,iop->ioname);
                                
fname=sh_macpat(shp,ap,(iof&IOARITH)?ARG_ARITH:ARG_EXP);
                        }
+                       else if(iof&IOPROCSUB)
+                       {
+                               struct argnod *ap = (struct 
argnod*)stakalloc(ARGVAL+strlen(iop->ioname));
+                               memset(ap, 0, ARGVAL);
+                               if(iof&IOPUT)
+                                       ap->argflag = ARG_RAW;
+                               ap->argchn.ap = (struct argnod*)fname; 
+                               ap = sh_argprocsub(shp,ap);
+                               fname = ap->argval;
+                       }
                        else
                                
fname=sh_mactrim(shp,fname,(!sh_isoption(SH_NOGLOB)&&sh_isoption(SH_INTERACTIVE))?2:0);
                }
@@ -1033,7 +1070,7 @@
                                                message = e_file;
                                                goto fail;
                                        }
-                                       if(shp->subshell && dupfd==1)
+                                       if(shp->subshell && dupfd==1 && 
(sfset(sfstdout,0,0)&SF_STRING))
                                        {
                                                sh_subtmpfile(0);
                                                dupfd = sffileno(sfstdout);
@@ -1083,6 +1120,8 @@
                                        
errormsg(SH_DICT,ERROR_exit(1),e_restricted,fname);
                                io_op[2] = '>';
                                o_mode = O_RDWR|O_CREAT;
+                               if(iof&IOREWRITE)
+                                       trunc = io_op[2] = ';';
                                goto openit;
                        }
                        else if(!(iof&IOPUT))
@@ -1197,7 +1236,10 @@
                                        if((off = file_offset(shp,fn,fname))<0)
                                                goto fail;
                                        if(sp)
+                                       {
                                                off=sfseek(sp, off, SEEK_SET);
+                                               sfsync(sp);
+                                       }
                                        else
                                                off=lseek(fn, off, SEEK_SET);
                                        if(off<0)
@@ -1245,7 +1287,7 @@
                                                        sh_close(fn);
                                                }
                                        }
-                                       sh_iosave(shp,fn,indx,tname?fname:0);
+                                       
sh_iosave(shp,fn,indx,tname?fname:(trunc?Empty:0));
                                }
                                else if(sh_subsavefd(fn))
                                        
sh_iosave(shp,fn,indx|IOSUBSHELL,tname?fname:0);
@@ -1422,7 +1464,11 @@
 #endif /* SHOPT_DEVFD */
        {
                if((savefd = sh_fcntl(origfd, F_DUPFD, 10)) < 0 && errno!=EBADF)
+               {
+                       shp->toomany=1;
+                       ((struct checkpt*)shp->jmplist)->mode = SH_JMPERREXIT;
                        errormsg(SH_DICT,ERROR_system(1),e_toomany);
+               }
        }
        filemap[shp->topfd].tname = name;
        filemap[shp->topfd].subshell = flag;
@@ -1492,7 +1538,9 @@
                        continue;
                }
                origfd = filemap[fd].orig_fd;
-               if(filemap[fd].tname)
+               if(filemap[fd].tname == Empty && shp->exitval==0)
+                       ftruncate(origfd,lseek(origfd,0,SEEK_CUR));
+               else if(filemap[fd].tname)
                        io_usename(filemap[fd].tname,(int*)0,shp->exitval?2:1);
                sh_close(origfd);
                if ((savefd = filemap[fd].save_fd) >= 0)
@@ -1638,7 +1686,10 @@
        int fd = sffileno(iop);
        NOT_USED(handle);
        if(job.waitsafe && job.savesig)
-               job_reap(job.savesig);
+       {
+               job_lock();
+               job_unlock();
+       }
        if(sh.trapnote)
        {
                errno = EINTR;
@@ -1942,14 +1993,7 @@
                        if(mode&SF_READ)
                                flag |= IOREAD;
                        shp->fdstatus[fd] = flag;
-#if 0
-                       if(flag==IOWRITE)
-                               sfpool(sp,shp->outpool,SF_WRITE);
-                       else
-#else
-                       if(flag!=IOWRITE)
-#endif
-                               sh_iostream(shp,fd);
+                       sh_iostream(shp,fd);
                }
                if((pp=(struct checkpt*)shp->jmplist) && pp->mode==SH_JMPCMD)
                {
--- old/usr/src/lib/libshell/common/sh/jobs.c   Fri Sep 25 06:35:56 2009
+++ new/usr/src/lib/libshell/common/sh/jobs.c   Fri Sep 25 06:35:54 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -30,7 +30,6 @@
  */
 
 #include       "defs.h"
-#include       <ctype.h>
 #include       <wait.h>
 #include       "io.h"
 #include       "jobs.h"
@@ -77,24 +76,6 @@
        }
 }
 
-/*
- * return next on link list of jobsave free list
- */
-static struct jobsave *jobsave_create(pid_t pid)
-{
-       register struct jobsave *jp = job_savelist;
-       if(jp)
-       {
-               njob_savelist--;
-               job_savelist = jp->next;
-       }
-       else
-               jp = newof(0,struct jobsave,1,0);
-       if(jp)
-               jp->pid = pid;
-       return(jp);
-}
-
 struct back_save
 {
        int             count;
@@ -132,6 +113,9 @@
 #define P_COREDUMP     0100
 #define P_DISOWN       0200
 #define P_FG           0400
+#ifdef SHOPT_BGX
+#define P_BG           01000
+#endif /* SHOPT_BGX */
 
 static int             job_chksave(pid_t);
 static struct process  *job_bypid(pid_t);
@@ -151,7 +135,6 @@
 static pid_t           lastpid;
 static struct back_save        bck;
 
-
 #ifdef JOBS
     static void                        job_set(struct process*);
     static void                        job_reset(struct process*);
@@ -195,7 +178,63 @@
 
 typedef int (*Waitevent_f)(int,long,int);
 
+#ifdef SHOPT_BGX
+void job_chldtrap(Shell_t *shp, const char *trap, int unpost)
+{
+       register struct process *pw,*pwnext;
+       pid_t bckpid;
+       int oldexit;
+       job_lock();
+       shp->sigflag[SIGCHLD] &= ~SH_SIGTRAP;
+       for(pw=job.pwlist;pw;pw=pwnext)
+       {
+               pwnext = pw->p_nxtjob;
+               if((pw->p_flag&(P_BG|P_DONE)) != (P_BG|P_DONE))
+                       continue;
+               pw->p_flag &= ~P_BG;
+               bckpid = shp->bckpid;
+               oldexit = shp->savexit;
+               shp->bckpid = pw->p_pid;
+               shp->savexit = pw->p_exit;
+               if(pw->p_flag&P_SIGNALLED)
+                       shp->savexit |= SH_EXITSIG;
+               sh_trap(trap,0);
+               shp->savexit = oldexit;
+               shp->bckpid = bckpid;
+               if(unpost)
+                       job_unpost(pw,0);
+       }
+       job_unlock();
+}
+#endif /* SHOPT_BGX */
+
 /*
+ * return next on link list of jobsave free list
+ */
+static struct jobsave *jobsave_create(pid_t pid)
+{
+       register struct jobsave *jp = job_savelist;
+       job_chksave(pid);
+       if(++bck.count > sh.lim.child_max)
+               job_chksave(0);
+       if(jp)
+       {
+               njob_savelist--;
+               job_savelist = jp->next;
+       }
+       else
+               jp = newof(0,struct jobsave,1,0);
+       if(jp)
+       {
+               jp->pid = pid;
+               jp->next = bck.list;
+               bck.list = jp;
+               jp->exitval = 0;
+       }
+       return(jp);
+}
+
+/*
  * Reap one job
  * When called with sig==0, it does a blocking wait
  */
@@ -206,7 +245,6 @@
        struct process *px;
        register int flags;
        struct jobsave *jp;
-       struct back_save *bp;
        int nochild=0, oerrno, wstat;
        Waitevent_f waitevent = sh.waitevent;
        static int wcontinued = WCONTINUED;
@@ -268,14 +306,7 @@
                        pw->p_exitmin = 0;
                        if(job.toclear)
                                job_clear();
-                       if(++bck.count > sh.lim.child_max)
-                               job_chksave(0);
-                       if(jp = jobsave_create(pid))
-                       {
-                               jp->next = bck.list;
-                               bck.list = jp;
-                               jp->exitval = 0;
-                       }
+                       jp = jobsave_create(pid);
                        pw->p_flag = 0;
                        lastpid = pw->p_pid = pid;
                        px = 0;
@@ -344,6 +375,22 @@
                                if(WEXITSTATUS(wstat) > pw->p_exitmin)
                                        pw->p_exit = WEXITSTATUS(wstat);
                        }
+#ifdef SHOPT_BGX
+                       if((pw->p_flag&P_DONE) && (pw->p_flag&P_BG))
+                       {
+                               job.numbjob--;
+                               if(sh.st.trapcom[SIGCHLD])
+                               {
+                                       sh.sigflag[SIGCHLD] |= SH_SIGTRAP;
+                                       if(sig==0)
+                                               
job_chldtrap(&sh,sh.st.trapcom[SIGCHLD],0);
+                                       else
+                                               sh.trapnote |= SH_SIGTRAP;
+                               }
+                               else
+                                       pw->p_flag &= ~P_BG;
+                       }
+#endif /* SHOPT_BGX */
                        if(pw->p_pgrp==0)
                                pw->p_flag &= ~P_NOTIFY;
                }
@@ -367,15 +414,20 @@
                        if(!px)
                                tcsetpgrp(JOBTTY,job.mypid);
                }
+#ifndef SHOPT_BGX
                if(!sh.intrap && sh.st.trapcom[SIGCHLD] && pid>0 && 
(pwfg!=job_bypid(pid)))
                {
                        sh.sigflag[SIGCHLD] |= SH_SIGTRAP;
                        sh.trapnote |= SH_SIGTRAP;
                }
+#endif
        }
        if(errno==ECHILD)
        {
                errno = oerrno;
+#ifdef SHOPT_BGX
+               job.numbjob = 0;
+#endif /* SHOPT_BGX */
                nochild = 1;
        }
        sh.waitevent = waitevent;
@@ -1045,6 +1097,9 @@
                init_savelist();
        job.pwlist = NIL(struct process*);
        job.numpost=0;
+#ifdef SHOPT_BGX
+       job.numbjob = 0;
+#endif /* SHOPT_BGX */
        job.waitall = 0;
        job.curpgid = 0;
        job.toclear = 0;
@@ -1064,10 +1119,12 @@
 {
        register struct process *pw;
        register History_t *hp = sh.hist_ptr;
+#ifdef SHOPT_BGX
+       int val,bg=0;
+#else
        int val;
+#endif
        sh.jobenv = sh.curenv;
-       if(njob_savelist < NJOB_SAVELIST)
-               init_savelist();
        if(job.toclear)
        {
                job_clear();
@@ -1074,6 +1131,16 @@
                return(0);
        }
        job_lock();
+#ifdef SHOPT_BGX
+       if(join==1)
+       {
+               join = 0;
+               bg = P_BG;
+               job.numbjob++;
+       }
+#endif /* SHOPT_BGX */
+       if(njob_savelist < NJOB_SAVELIST)
+               init_savelist();
        if(pw = job_bypid(pid))
                job_unpost(pw,0);
        if(join && (pw=job_bypid(join)))
@@ -1090,6 +1157,7 @@
                freelist = pw->p_nxtjob;
        else
                pw = new_of(struct process,0);
+       pw->p_flag = 0;
        job.numpost++;
        if(join && job.pwlist)
        {
@@ -1109,7 +1177,8 @@
        job.pwlist = pw;
        pw->p_env = sh.curenv;
        pw->p_pid = pid;
-       pw->p_flag = P_EXITSAVE;
+       if(!sh.outpipe || sh_isoption(SH_PIPEFAIL))
+               pw->p_flag = P_EXITSAVE;
        pw->p_exitmin = sh.xargexit;
        pw->p_exit = 0;
        if(sh_isstate(SH_MONITOR))
@@ -1140,9 +1209,18 @@
                        pw->p_flag |= (P_SIGNALLED|P_STOPPED);
                        pw->p_exit = 0;
                }
+               else if(pw->p_exit >= SH_EXITSIG)
+               {
+                       pw->p_flag |= P_DONE|P_SIGNALLED;
+                       pw->p_exit &= SH_EXITMASK;
+               }
                else
                        pw->p_flag |= (P_DONE|P_NOTIFY);
        }
+#ifdef SHOPT_BGX
+       if(bg && !(pw->p_flag&P_DONE))
+               pw->p_flag |= P_BG;
+#endif /* SHOPT_BGX */
        lastpid = 0;
        job_unlock();
        return(pw->p_job);
@@ -1334,14 +1412,9 @@
                                                        px->p_flag &= 
~P_EXITSAVE;
                                        }
                                }
-                               if(!job.waitall)
-                               {
-                                       if(!sh_isoption(SH_PIPEFAIL))
-                                               job_unpost(pw,1);
+                               px = job_unpost(pw,1);
+                               if(!px || !sh_isoption(SH_PIPEFAIL))
                                        break;
-                               }
-                               else if(!(px=job_unpost(pw,1)))
-                                       break;
                                pw = px;
                                continue;
                        }
@@ -1430,6 +1503,9 @@
        {
                sfprintf(outfile,"[%d]\t",(int)pw->p_job);
                sh.bckpid = pw->p_pid;
+#ifdef SHOPT_BGX
+               pw->p_flag |= P_BG;
+#endif
                msg = "&";
        }
        else
@@ -1451,6 +1527,9 @@
                }
                job.waitall = 1;
                pw->p_flag |= P_FG;
+#ifdef SHOPT_BGX
+               pw->p_flag &= ~P_BG;
+#endif
                job_wait(pw->p_pid);
                job.waitall = 0;
        }
@@ -1515,6 +1594,10 @@
        sfsync(sfstderr);
 #endif /* DEBUG */
        pwtop = pw = job_byjid((int)pwtop->p_job);
+#ifdef SHOPT_BGX
+       if(pw->p_flag&P_BG) 
+               return(pw);
+#endif /* SHOPT_BGX */
        for(; pw && 
(pw->p_flag&P_DONE)&&(notify||!(pw->p_flag&P_NOTIFY)||pw->p_env); 
pw=pw->p_nxtproc);
        if(pw)
                return(pw);
@@ -1527,12 +1610,8 @@
                {
                        struct jobsave *jp;
                        /* save status for future wait */
-                       if(bck.count++ > sh.lim.child_max)
-                               job_chksave(0);
                        if(jp = jobsave_create(pw->p_pid))
                        {
-                               jp->next = bck.list;
-                               bck.list = jp;
                                jp->exitval = pw->p_exit;
                                if(pw->p_flag&P_SIGNALLED)
                                        jp->exitval |= SH_EXITSIG;
@@ -1630,7 +1709,7 @@
        if ( sig == SIGAPOLLO )
                return( apollo_error() );
 #endif /* apollo */
-       if(sig<sh.sigmax && sh.sigmsg[sig])
+       if(sig<=sh.sigmax && sh.sigmsg[sig])
                return(sh.sigmsg[sig]);
 #if defined(SIGRTMIN) && defined(SIGRTMAX)
        if(sig>=sh.sigruntime[SH_SIGRTMIN] && sig<=sh.sigruntime[SH_SIGRTMAX])
@@ -1656,7 +1735,8 @@
 {
        register struct jobsave *jp = bck.list, *jpold=0;
        register int r= -1;
-       while(jp)
+       register int count=bck.count;
+       while(jp && count-->0)
        {
                if(jp->pid==pid)
                        break;
@@ -1712,6 +1792,7 @@
                {
                        jp->next = bp->list;
                        bp->list = jp;
+                       bp->count++;
                }
                else
                        job_chksave(jp->pid);
@@ -1719,7 +1800,7 @@
        for(pw=job.pwlist; pw; pw=pwnext)
        {
                pwnext = pw->p_nxtjob;
-               if(pw->p_env != sh.curenv)
+               if(pw->p_env != sh.curenv || pw->p_pid==sh.pipepid)
                        continue;
                for(px=pw; px; px=px->p_nxtproc)
                        px->p_flag |= P_DONE;
--- old/usr/src/lib/libshell/common/sh/lex.c    Fri Sep 25 06:35:59 2009
+++ new/usr/src/lib/libshell/common/sh/lex.c    Fri Sep 25 06:35:57 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -100,6 +100,7 @@
        int             lex_max;
        int             *lex_match;
        int             lex_state;
+       int             docextra;
 #if SHOPT_KIA
        off_t           kiaoff;
 #endif
@@ -196,6 +197,12 @@
 #endif
        if(lp->lexd.nocopy)
                return;
+       if(lp->lexd.dolparen && lp->lexd.docword)
+       {
+               int n = size - (lp->lexd.docend-(char*)buff);
+               sfwrite(shp->strbuf,lp->lexd.docend,n);
+               lp->lexd.docextra  += n;
+       }
        if(lp->lexd.first)
        {
                size -= (lp->lexd.first-(char*)buff);
@@ -222,12 +229,13 @@
        register int c;
        Lex_t savelex;
        struct argnod *ap;
-       int aok;
+       int aok,docextra;
        savelex = *lp;
        ap = lp->arg;
        c = fcfill();
        if(ap)
                lp->arg = ap;
+       docextra = lp->lexd.docextra;
        lp->lex = savelex.lex;
        lp->lexd = savelex.lexd;
        if(fcfile() ||  c)
@@ -237,6 +245,11 @@
        memcpy(lp, &savelex, offsetof(Lex_t,lexd));
        lp->arg = ap;
        lp->aliasok = aok;
+       if(lp->lexd.docword && docextra)
+       {
+               lp->lexd.docextra = docextra;
+               lp->lexd.docend = fcseek(0)-1;
+       }
        return(c);
 }
 
@@ -533,14 +546,17 @@
                                                return(lp->token=c);
                                        else if(c=='&')
                                        {
-#if SHOPT_BASH
-                                               if(!sh_isoption(SH_POSIX) && 
n=='>')
+                                               if(!sh_isoption(SH_POSIX) && 
n=='>' && (sh_isoption(SH_BASH) || sh_isstate(SH_PROFILE)))
                                                {
+                                                       
if(!sh_isoption(SH_BASH) && !lp->nonstandard)
+                                                       {
+                                                               lp->nonstandard 
= 1;
+                                                               
errormsg(SH_DICT,ERROR_warn(0),e_lexnonstandard,shp->inlineno);
+                                                       }
                                                        lp->digits = -1;
                                                        c = '>';
                                                }
                                                else
-#endif
                                                        n = 0;
                                        }
                                        else if(n=='&')
@@ -556,7 +572,20 @@
                                        else if(n=='|')
                                                c  |= SYMPIPE;
                                        else if(c=='<' && n=='>')
+                                       {
+                                               lp->digits = 1;
                                                c = IORDWRSYM;
+                                               fcgetc(n);
+                                               if(fcgetc(n)==';')
+                                               {
+                                                       lp->token = c = 
IORDWRSYMT;
+                                                       if(lp->inexec)
+                                                               sh_syntax(lp);
+                                               }
+                                               else if(n>0)
+                                                       fcseek(-1);
+                                               n= 0;
+                                       }
                                        else if(n=='#' && (c=='<'||c=='>'))
                                                c |= SYMSHARP;
                                        else if(n==';' && c=='>')
@@ -577,7 +606,7 @@
                                        }
                                        else
                                        {
-                                               if((n=fcpeek(0))!=RPAREN && 
n!=LPAREN && lp->lexd.warn)
+                                               if(lp->lexd.warn && 
(n=fcpeek(0))!=RPAREN && n!=' ' && n!='\t')
                                                        
errormsg(SH_DICT,ERROR_warn(0),e_lexspace,shp->inlineno,c,n);
                                        }
                                }
@@ -762,7 +791,7 @@
                                                lp->lastline = shp->inlineno;
                                                pushlevel(lp,c,mode);
                                        }
-                                       ingrave = (c=='`');
+                                       ingrave ^= (c=='`');
                                        mode = ST_QUOTE;
                                        continue;
                                }
@@ -985,7 +1014,7 @@
                                {
                                        if(lp->lexd.warn && c!='/' && 
sh_lexstates[ST_NORM][c]!=S_BREAK && (c!='"' || mode==ST_QUOTE))
                                                
errormsg(SH_DICT,ERROR_warn(0),e_lexslash,shp->inlineno);
-                                       else if(c=='"' && mode!=ST_QUOTE)
+                                       else if(c=='"' && mode!=ST_QUOTE && 
!ingrave)
                                                wordflags |= ARG_MESSAGE;
                                        fcseek(-1);
                                }
@@ -1111,6 +1140,16 @@
                                        (oldmode(lp)==ST_NONE) ||
                                        (mode==ST_NAME && 
(lp->assignok||lp->lexd.level)))
                                {
+                                       if(mode==ST_NAME)
+                                       {
+                                               fcgetc(n);
+                                               if(n>0)
+                                               {
+                                                       if(n==']')
+                                                               
errormsg(SH_DICT,ERROR_exit(SYNBAD),e_lexsyntax1, shp->inlineno, "[]", "empty 
subscript");
+                                                       fcseek(-1);
+                                               }
+                                       }
                                        pushlevel(lp,RBRACT,mode);
                                        wordflags |= ARG_QUOTED;
                                        mode = ST_NESTED;
@@ -1522,6 +1561,7 @@
                                        fcseek(-1);
                                break;
                            case IODOCSYM:
+                               lp->lexd.docextra = 0;
                                sh_lex(lp);
                                break;
                            case 0:
@@ -1564,9 +1604,14 @@
        if(offset=stktell(stkp))
                base = stkfreeze(stkp,0);
        n = fcseek(0)-lp->lexd.docend;
-       iop = newof(0,struct ionod,1,n+ARGVAL);
+       iop = newof(0,struct ionod,1,lp->lexd.docextra+n+ARGVAL);
        iop->iolst = lp->heredoc;
        stkseek(stkp,ARGVAL);
+       if(lp->lexd.docextra)
+       {
+               sfseek(lp->sh->strbuf,(Sfoff_t)0, SEEK_SET);
+               sfmove(lp->sh->strbuf,stkp,lp->lexd.docextra,-1);
+       }
        sfwrite(stkp,lp->lexd.docend,n);
        lp->arg = sh_endword(lp->sh,0);
        iop->ioname = (char*)(iop+1);
@@ -1839,9 +1884,9 @@
                        {
                                /* new-line joining */
                                lp->sh->inlineno++;
-                               if(!lp->lexd.dolparen && 
(n=(fcseek(0)-bufp)-n)>0)
+                               if(!lp->lexd.dolparen && 
(n=(fcseek(0)-bufp)-n)>=0)
                                {
-                                       if((n=sfwrite(sp,bufp,n))>0)
+                                       if(n && (n=sfwrite(sp,bufp,n))>0)
                                                iop->iosize += n;
                                        bufp = fcseek(0)+1;
                                }
@@ -1872,6 +1917,7 @@
  */
 static char    *fmttoken(Lex_t *lp, register int sym, char *tok)
 {
+       int n=1;
        if(sym < 0)
                return((char*)sh_translate(e_lexzerobyte));
        if(sym==0)
@@ -1891,7 +1937,7 @@
                return((char*)sh_translate(e_newline));
        tok[0] = sym;
        if(sym&SYMREP)
-               tok[1] = sym;
+               tok[n++] = sym;
        else
        {
                switch(sym&SYMMASK)
@@ -1912,14 +1958,16 @@
                                sym = '#';
                                break;
                        case SYMSEMI:
+                               if(tok[0]=='<')
+                                       tok[n++] = '>';
                                sym = ';';
                                break;
                        default:
                                sym = 0;
                }
-               tok[1] = sym;
+               tok[n++] = sym;
        }
-       tok[2] = 0;
+       tok[n] = 0;
        return(tok);
 }
 
--- old/usr/src/lib/libshell/common/sh/macro.c  Fri Sep 25 06:36:03 2009
+++ new/usr/src/lib/libshell/common/sh/macro.c  Fri Sep 25 06:36:01 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -38,6 +38,7 @@
 #include       "variables.h"
 #include       "shlex.h"
 #include       "io.h"
+#include       "jobs.h"
 #include       "shnodes.h"
 #include       "path.h"
 #include       "national.h"
@@ -529,8 +530,13 @@
                        {
                                /* preserve \digit for pattern matching */
                                /* also \alpha for extended patterns */
-                               if(!mp->lit && !mp->quote && (n==S_DIG || 
((paren+ere) && sh_lexstates[ST_DOL][*(unsigned char*)cp]==S_ALP)))
-                                       break;
+                               if(!mp->lit && !mp->quote)
+                               {
+                                       if((n==S_DIG || ((paren+ere) && 
sh_lexstates[ST_DOL][*(unsigned char*)cp]==S_ALP)))
+                                               break;
+                                       if(ere && mp->pattern==1 && 
strchr(".[()*+?{|^$&!",*cp))
+                                               break;
+                               }
                                /* followed by file expansion */
                                if(!mp->lit && (n==S_ESC || (!mp->quote && 
                                        
(n==S_PAT||n==S_ENDCH||n==S_SLASH||n==S_BRACT||*cp=='-'))))
@@ -647,8 +653,14 @@
                                int offset=0,oldpat = mp->pattern;
                                int oldarith = mp->arith, oldsub=mp->subcopy;
                                sfwrite(stkp,first,++c);
-                               if((mp->assign&1) && first[c-2]=='.')
-                                       offset = stktell(stkp);
+                               if(mp->assign&1)
+                               {
+                                       if(first[c-2]=='.')
+                                               offset = stktell(stkp);
+                                       if(isastchar(*cp) && cp[1]==']')
+                                               errormsg(SH_DICT,ERROR_exit(1),
+e_badsubscript,*cp);
+                               }
                                first = fcseek(c);
                                mp->pattern = 4;
                                mp->arith = 0;
@@ -678,7 +690,7 @@
                                        {
                                                char *p = cp;
                                                while((c=mbchar(p)) && 
c!=RPAREN && c!='E');
-                                               ere = c=='E';
+                                               ere = (c=='E'||c=='A');
                                        }
                                }
                                else if(n==RPAREN)
@@ -892,7 +904,7 @@
 static char *prefix(Shell_t *shp, char *id)
 {
        Namval_t *np;
-       register char *cp = strchr(id,'.');
+       register char *sub=0, *cp = strchr(id,'.');
        if(cp)
        {
                *cp = 0;
@@ -905,11 +917,23 @@
                        int n;
                        char *sp;
                        shp->argaddr = 0;
-                       while(nv_isref(np))
+                       while(nv_isref(np) && np->nvalue.cp)
+                       {
+                               sub = nv_refsub(np);
                                np = nv_refnode(np);
-                       id = 
(char*)malloc(strlen(cp)+1+(n=strlen(sp=nv_name(np)))+1);
-                       strcpy(&id[n],cp);
+                               if(sub)
+                                       nv_putsub(np,sub,0L);
+                       }
+                       id = 
(char*)malloc(strlen(cp)+1+(n=strlen(sp=nv_name(np)))+ (sub?strlen(sub)+3:1));
                        memcpy(id,sp,n);
+                       if(sub)
+                       {
+                               id[n++] = '[';
+                               strcpy(&id[n],sub);
+                               n+= strlen(sub)+1;
+                               id[n-1] = ']';
+                       }
+                       strcpy(&id[n],cp);
                        return(id);
                }
        }
@@ -961,7 +985,7 @@
                tp = (Shnode_t*)&node;
                tp->com.comarg = (struct argnod*)dp;
                tp->com.comline = shp->inlineno;
-               dp->dolnum = 2;
+               dp->dolnum = 1;
                dp->dolval[0] = strdup(name);
                stkseek(shp->stk,offset);
                comsubst((Mac_t*)shp->mac_context,tp,2);
@@ -1009,7 +1033,7 @@
        Namarr_t        *ap=0;
        int             dolmax=0, vsize= -1, offset= -1, nulflg, replen=0, 
bysub=0;
        char            idbuff[3], *id = idbuff, *pattern=0, *repstr, *arrmax=0;
-       int             addsub=0,oldpat=mp->pattern,idnum=0,flag=0,d;
+       int             var=1,addsub=0,oldpat=mp->pattern,idnum=0,flag=0,d;
        Stk_t           *stkp = mp->shp->stk;
 retry1:
        mp->zeros = 0;
@@ -1016,7 +1040,7 @@
        idbuff[0] = 0;
        idbuff[1] = 0;
        c = fcget();
-       switch(c>0x7f?S_ALP:sh_lexstates[ST_DOL][c])
+       switch(isascii(c)?sh_lexstates[ST_DOL][c]:S_ALP)
        {
            case S_RBRA:
                if(type<M_SIZE)
@@ -1053,6 +1077,7 @@
                }
                /* FALL THRU */
            case S_SPC2:
+               var = 0;
                *id = c;
                v = special(mp->shp,c);
                if(isastchar(c))
@@ -1081,6 +1106,7 @@
                comsubst(mp,(Shnode_t*)0,1);
                return(1);
            case S_DIG:
+               var = 0;
                c -= '0';
                mp->shp->argaddr = 0;
                if(type)
@@ -1117,7 +1143,7 @@
                        np = 0;
                        do
                                sfputc(stkp,c);
-                       while(((c=fcget()),(c>0x7f||isaname(c)))||type && 
c=='.');
+                       while(((c=fcget()),(!isascii(c)||isaname(c)))||type && 
c=='.');
                        while(c==LBRACT && (type||mp->arrayok))
                        {
                                mp->shp->argaddr=0;
@@ -1204,11 +1230,15 @@
                }
                else
 #endif  /* SHOPT_FILESCAN */
-               if(mp->shp->argaddr)
-                       flag &= ~NV_NOADD;
-               np = nv_open(id,mp->shp->var_tree,flag|NV_NOFAIL);
-               if((!np || nv_isnull(np)) && type==M_BRACE && c==RBRACE && 
!(flag&NV_ARRAY))
                {
+                       if(mp->shp->argaddr)
+                               flag &= ~NV_NOADD;
+                       np = nv_open(id,mp->shp->var_tree,flag|NV_NOFAIL);
+               }
+               if(isastchar(mode))
+                       var = 0;
+               if((!np || nv_isnull(np)) && type==M_BRACE && c==RBRACE && 
!(flag&NV_ARRAY) && strchr(id,'.'))
+               {
                        if(sh_macfun(mp->shp,id,offset))
                        {
                                fcget();
@@ -1215,6 +1245,13 @@
                                return(1);
                        }
                }
+               if(np && (flag&NV_NOADD) && nv_isnull(np))
+               {
+                       if(nv_isattr(np,NV_NOFREE))
+                               nv_offattr(np,NV_NOFREE);
+                       else
+                               np = 0;
+               }
                ap = np?nv_arrayptr(np):0;
                if(type)
                {
@@ -1299,7 +1336,15 @@
                                v = nv_getvtree(np,(Namfun_t*)0);
                        else
                        {
-                               v = nv_getval(np);
+                               if(type && fcpeek(0)=='+')
+                               {
+                                       if(ap)
+                                               v = 
nv_arrayisset(np,ap)?(char*)"x":0;
+                                       else
+                                               v = nv_isnull(np)?0:(char*)"x";
+                               }
+                               else
+                                       v = nv_getval(np);
                                /* special case --- ignore leading zeros */  
                                if( (mp->arith||mp->let) && (np->nvfun || 
nv_isattr(np,(NV_LJUST|NV_RJUST|NV_ZFILL))) && (offset==0 || !isalnum(c)))
                                        mp->zeros = 1;
@@ -1345,6 +1390,7 @@
                        mac_error(np);
                if(type==M_NAMESCAN || type==M_NAMECOUNT)
                {
+                       mp->shp->last_root = mp->shp->var_tree;
                        id = prefix(mp->shp,id);
                        stkseek(stkp,offset);
                        if(type==M_NAMECOUNT)
@@ -1432,6 +1478,7 @@
                                int quoted = mp->quoted;
                                int arith = mp->arith;
                                int zeros = mp->zeros;
+                               int assign = mp->assign;
                                if(newops)
                                {
                                        type = fcget();
@@ -1446,6 +1493,7 @@
                                        mp->pattern = 1+(c=='/');
                                        mp->split = 0;
                                        mp->quoted = 0;
+                                       mp->assign &= ~1;
                                        mp->arith = mp->zeros = 0;
                                        newquote = 0;
                                }
@@ -1459,6 +1507,7 @@
                                mp->quoted = quoted;
                                mp->arith = arith;
                                mp->zeros = zeros;
+                               mp->assign = assign;
                                /* add null byte */
                                sfputc(stkp,0);
                                stkseek(stkp,stktell(stkp)-1);
@@ -1803,7 +1852,7 @@
                        mac_error(np);
                }
        }
-       else if(sh_isoption(SH_NOUNSET) && (!np  || nv_isnull(np) || 
(nv_isarray(np) && !np->nvalue.cp)))
+       else if(var && sh_isoption(SH_NOUNSET) && (!np  || nv_isnull(np) || 
(nv_isarray(np) && !np->nvalue.cp)))
        {
                if(np)
                {
@@ -2467,7 +2516,6 @@
  */
 static char *special(Shell_t *shp,register int c)
 {
-       register Namval_t *np;
        if(c!='$')
                shp->argaddr = 0;
        switch(c)
@@ -2497,10 +2545,10 @@
            case '?':
                return(ltos(shp->savexit));
            case 0:
-               if(sh_isstate(SH_PROFILE) || !error_info.id || 
((np=nv_search(error_info.id,shp->bltin_tree,0)) && nv_isattr(np,BLT_SPC)))
+               if(sh_isstate(SH_PROFILE) || shp->fn_depth==0 || 
!shp->st.cmdname)
                        return(shp->shname);
                else
-                       return(error_info.id);
+                       return(shp->st.cmdname);
        }
        return(NIL(char*));
 }
--- old/usr/src/lib/libshell/common/sh/main.c   Fri Sep 25 06:36:06 2009
+++ new/usr/src/lib/libshell/common/sh/main.c   Fri Sep 25 06:36:04 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -37,6 +37,7 @@
 #include       "path.h"
 #include       "io.h"
 #include       "jobs.h"
+#include       "shlex.h"
 #include       "shnodes.h"
 #include       "history.h"
 #include       "timeout.h"
@@ -114,10 +115,14 @@
        int     fd;
 
        if (!file || !*file || (fd = path_open(file, PATHCOMP)) < 0)
+       {
+               REGRESS(source, "sh_source", ("%s:ENOENT", file));
                return 0;
+       }
        oid = error_info.id;
        nid = error_info.id = strdup(file);
        shp->st.filename = path_fullname(stakptr(PATH_OFFSET));
+       REGRESS(source, "sh_source", ("%s", file));
        exfile(shp, iop, fd);
        error_info.id = oid;
        free(nid);
@@ -177,6 +182,7 @@
        if((beenhere++)==0)
        {
                sh_onstate(SH_PROFILE);
+               ((Lex_t*)shp->lex_context)->nonstandard = 0;
                if(shp->ppid==1)
                        shp->login_sh++;
                if(shp->login_sh >= 2)
@@ -274,8 +280,10 @@
                                /* open stream should have been passed into 
shell */
                                if(strmatch(name,e_devfdNN))
                                {
+#if !_WINIX
                                        char *cp;
                                        int type;
+#endif
                                        fdin = (int)strtol(name+8, (char**)0, 
10);
                                        if(fstat(fdin,&statb)<0)
                                                
errormsg(SH_DICT,ERROR_system(1),e_open,name);
--- old/usr/src/lib/libshell/common/sh/name.c   Fri Sep 25 06:36:09 2009
+++ new/usr/src/lib/libshell/common/sh/name.c   Fri Sep 25 06:36:07 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -26,7 +26,6 @@
 #define putenv ___putenv
 
 #include       "defs.h"
-#include       <ctype.h>
 #include       "variables.h"
 #include       "path.h"
 #include       "lexstates.h"
@@ -88,6 +87,7 @@
        struct Cache_entry
        {
                Dt_t            *root;
+               Dt_t            *last_root;
                char            *name;
                Namval_t        *np;
                Namval_t        *last_table;
@@ -283,7 +283,7 @@
  * Perform parameter assignment for a linked list of parameters
  * <flags> contains attributes for the parameters
  */
-void nv_setlist(register struct argnod *arg,register int flags)
+void nv_setlist(register struct argnod *arg,register int flags, Namval_t *typ)
 {
        Shell_t         *shp = &sh;
        register char   *cp;
@@ -340,6 +340,8 @@
                                else
                                        cp = fp->fornam;
                                error_info.line = fp->fortyp-shp->st.firstline;
+                               if(!array && tp->tre.tretyp!=TLST && 
tp->com.comset && !tp->com.comarg && tp->com.comset->argval[0]==0 && 
tp->com.comset->argval[1]=='[')
+                                       array |= 
(tp->com.comset->argflag&ARG_MESSAGE)?NV_IARRAY:NV_ARRAY;
                                if(shp->fn_depth && 
(Namval_t*)tp->com.comnamp==SYSTYPESET)
                                        flag |= NV_NOSCOPE;
                                if(prefix && tp->com.comset && *cp=='[')
@@ -359,6 +361,8 @@
                                        }
                                }
                                np = nv_open(cp,shp->var_tree,flag|NV_ASSIGN);
+                               if(typ && !array  && (nv_isnull(np) || 
nv_isarray(np)))
+                                       nv_settype(np,typ,0);
                                if((flags&NV_STATIC) && !nv_isnull(np))
 #if SHOPT_TYPEDEF
                                        goto check_type;
@@ -365,7 +369,7 @@
 #else
                                        continue;
 #endif /* SHOPT_TYPEDEF */
-                               if(array)
+                               if(array && (!(ap=nv_arrayptr(np)) || 
!ap->hdr.type))
                                {
                                        if(!(arg->argflag&ARG_APPEND))
                                                nv_unset(np);
@@ -377,7 +381,9 @@
                                        {
                                                nv_onattr(np,NV_ARRAY);
                                        }
-                                       if(tp->tre.tretyp!=TLST && 
!tp->com.comset && !tp->com.comarg)
+                               }
+                               if(array && tp->tre.tretyp!=TLST && 
!tp->com.comset && !tp->com.comarg)
+                               {
 #if SHOPT_TYPEDEF
                                                goto check_type;
 #else
@@ -444,7 +450,7 @@
                                                        if(!(array&NV_IARRAY) 
&& !(tp->com.comset->argflag&ARG_MESSAGE))
                                                                
nv_setarray(np,nv_associative);
                                                }
-                                               
nv_setlist(tp->com.comset,flags);
+                                               
nv_setlist(tp->com.comset,flags,0);
                                                shp->prefix = prefix;
                                                
if(tp->com.comset->argval[1]!='[')
                                                         nv_setvtree(np);
@@ -496,17 +502,25 @@
                                else
                                        shp->prefix = cp;
                                shp->last_table = 0;
-                               memset(&nr,0,sizeof(nr));
-                               memcpy(&node,L_ARGNOD,sizeof(node));
-                               L_ARGNOD->nvalue.nrp = &nr;
-                               nr.np = np;
-                               nr.root = shp->last_root;
-                               nr.table = shp->last_table;
-                               L_ARGNOD->nvflag = NV_REF|NV_NOFREE;
-                               L_ARGNOD->nvfun = 0;
+                               if(shp->prefix)
+                               {
+                                       if(*shp->prefix=='_' && 
shp->prefix[1]=='.' && nv_isref(L_ARGNOD))
+                                       {
+                                               
sfprintf(stkstd,"%s%s",nv_name(L_ARGNOD->nvalue.nrp->np),shp->prefix+1);
+                                               shp->prefix = 
stkfreeze(stkstd,1);
+                                       }
+                                       memset(&nr,0,sizeof(nr));
+                                       memcpy(&node,L_ARGNOD,sizeof(node));
+                                       L_ARGNOD->nvalue.nrp = &nr;
+                                       nr.np = np;
+                                       nr.root = shp->last_root;
+                                       nr.table = shp->last_table;
+                                       L_ARGNOD->nvflag = NV_REF|NV_NOFREE;
+                                       L_ARGNOD->nvfun = 0;
+                               }
                                sh_exec(tp,sh_isstate(SH_ERREXIT));
 #if SHOPT_TYPEDEF
-                               if(!maketype)
+                               if(shp->prefix)
 #endif
                                {
                                        L_ARGNOD->nvalue.nrp = node.nvalue.nrp;
@@ -523,7 +537,7 @@
                                        tp = tp->lst.lstrit;
 
                                }
-                               if(!nv_isarray(np) && (tp->com.comarg || 
!tp->com.comset || tp->com.comset->argval[0]!='['))
+                               if(!nv_isarray(np) && !typ && (tp->com.comarg 
|| !tp->com.comset || tp->com.comset->argval[0]!='['))
                                        nv_setvtree(np);
 #if SHOPT_TYPEDEF
                                goto check_type;
@@ -776,7 +790,10 @@
                                if(top)
                                {
                                        if(nq==np)
+                                       {
                                                flags &= ~NV_NOSCOPE;
+                                               root = shp->var_base;
+                                       }
                                        else if(nq)
                                        {
                                                if(nv_isnull(np) && c!='.' && 
(np->nvfun=nv_cover(nq)))
@@ -798,7 +815,7 @@
 #endif
                                if(c=='.') /* don't optimize */
                                        shp->argaddr = 0;
-                               else if((flags&NV_NOREF) && (c!='[' || 
*cp!='.'))
+                               else if((flags&NV_NOREF) && (c!='[' && 
*cp!='.'))
                                {
                                        if(c && !(flags&NV_NOADD))
                                                nv_unref(np);
@@ -835,6 +852,9 @@
                                                flags &= ~NV_NOSCOPE;
                                }
                                flags |= NV_NOREF;
+                               if(nv_isnull(np))
+                                       nv_onattr(np,NV_NOFREE);
+                               
                        }
                        shp->last_root = root;
                        if(cp[1]=='.')
@@ -867,8 +887,13 @@
                                {
                                        char *sub=0;
                                        int n = 0;
+                                       mode &= ~HASH_NOSCOPE;
                                        if(c=='[')
                                        {
+#if 0
+                                               Namarr_t *ap = nv_arrayptr(np);
+                                               int scan = 
ap?(ap->nelem&ARRAY_SCAN):0;
+#endif
                                                n = mode|nv_isarray(np);
                                                if(!mode && (flags&NV_ARRAY) && 
((c=sp[1])=='*' || c=='@') && sp[2]==']')
                                                {
@@ -881,6 +906,10 @@
                                                if(flags&NV_ASSIGN)
                                                        n |= NV_ADD;
                                                cp = 
nv_endsubscript(np,sp,n|(flags&NV_ASSIGN));
+#if 0
+                                               if(scan)
+                                                       
nv_putsub(np,NIL(char*),ARRAY_SCAN);
+#endif
                                        }
                                        else
                                                cp = sp;
@@ -1000,6 +1029,7 @@
                                                if((nq = 
(*fp->disc->createf)(np,cp+1,flags,fp)) == np)
                                                {
                                                        add = NV_ADD;
+                                                       shp->last_table = 0;
                                                        break;
                                                }
                                                else if(np=nq)
@@ -1075,6 +1105,7 @@
  * If <flags> & NV_NOREF then don't follow reference
  * If <flags> & NV_NOFAIL then don't generate an error message on failure
  * If <flags> & NV_STATIC then unset before an assignment
+ * If <flags> & NV_UNJUST then unset attributes before assignment
  * SH_INIT is only set while initializing the environment
  */
 Namval_t *nv_open(const char *name, Dt_t *root, int flags)
@@ -1175,6 +1206,7 @@
                        if(nv_isarray(np))
                                 nv_putsub(np,NIL(char*),ARRAY_UNDEF);
                        shp->last_table = xp->last_table;
+                       shp->last_root = xp->last_root;
                        goto nocache;
                }
        }
@@ -1209,6 +1241,7 @@
                xp->root = root;
                xp->np = np;
                xp->last_table = shp->last_table;
+               xp->last_root = shp->last_root;
                xp->flags = (flags&(NV_ARRAY|NV_NOSCOPE));
                nvcache.index = (nvcache.index+1)&(NVCACHE-1);
        }
@@ -1241,7 +1274,6 @@
        if(np && shp->mktype)
                np = nv_addnode(np,0);
 #endif /* SHOPT_TYPEDEF */
-
        if(c=='=' && np && (flags&NV_ASSIGN))
        {
                cp++;
@@ -1259,7 +1291,10 @@
                        if((flags&NV_STATIC) && !shp->mktype)
                        {
                                if(!nv_isnull(np))
+                               {
+                                       shp->prefix = prefix;
                                        return(np);
+                               }
                        }
                        isref = nv_isref(np);
                        if(sh_isoption(SH_XTRACE) && nv_isarray(np))
@@ -1267,9 +1302,18 @@
                        c = msg==e_aliname? 0: (append | (flags&NV_EXPORT)); 
                        if(isref)
                                nv_offattr(np,NV_REF);
+                       if(!append && (flags&NV_UNJUST))
+                       {
+                               nv_offattr(np,NV_LJUST|NV_RJUST|NV_ZFILL);
+                               np->nvsize = 0;
+                       }
                        nv_putval(np, cp, c);
                        if(isref)
+                       {
+                               
if(nv_search((char*)np,shp->var_base,HASH_BUCKET))
+                                       shp->last_root = shp->var_base;
                                nv_setref(np,(Dt_t*)0,NV_VARNAME);
+                       }
                        savesub = sub;
                        shp->prefix = prefix;
                }
@@ -1325,7 +1369,7 @@
        sh.argaddr = 0;
        if(sh.subshell && !nv_local)
                np = sh_assignok(np,1);
-       if(np->nvfun && np->nvfun->disc && !(flags&NV_NODISC) && 
!nv_isattr(np,NV_REF))
+       if(np->nvfun && np->nvfun->disc && !(flags&NV_NODISC) && !nv_isref(np))
        {
                /* This function contains disc */
                if(!nv_local)
@@ -1387,7 +1431,7 @@
                                        up->ldp = new_of(Sfdouble_t,0);
                                else if(flags&NV_APPEND)
                                        old = *(up->ldp);
-                               *(up->ldp) = ld+old;
+                               *(up->ldp) = old?ld+old:ld;
                        }
                        else
                        {
@@ -1407,7 +1451,7 @@
                                        up->dp = new_of(double,0);
                                else if(flags&NV_APPEND)
                                        od = *(up->dp);
-                               *(up->dp) = d+od;
+                               *(up->dp) = od?d+od:d;
                        }
                }
                else
@@ -2014,7 +2058,7 @@
        {
                dtview(newscope,(Dt_t*)shp->var_tree);
                shp->var_tree = newscope;
-               nv_setlist(envlist,NV_EXPORT|NV_NOSCOPE|NV_IDENT|NV_ASSIGN);
+               nv_setlist(envlist,NV_EXPORT|NV_NOSCOPE|NV_IDENT|NV_ASSIGN,0);
                if(!fun)
                        return;
                shp->var_tree = dtview(newscope,0);
@@ -2039,6 +2083,10 @@
 {
        char *cp=0;
        NOT_USED(data);
+       if(np==VERSIONNOD && nv_isref(np))
+               return;
+       if(np==L_ARGNOD)
+               return;
        if(nv_isattr(np,NV_EXPORT) && nv_isarray(np))
        {
                nv_putsub(np,NIL(char*),0);
@@ -2047,7 +2095,7 @@
        }
        if(nv_isattr(np,NV_EXPORT|NV_NOFREE))
        {
-               if(nv_isref(np))
+               if(nv_isref(np) && np!=VERSIONNOD)
                {
                        nv_offattr(np,NV_NOFREE|NV_REF);
                        free((void*)np->nvalue.nrp);
@@ -2082,7 +2130,11 @@
        for(np=(Namval_t*)dtfirst(root);np;np=npnext)
        {
                if(nv_isref(np))
-                       nv_unref(np);
+               {
+                       free((void*)np->nvalue.nrp);
+                       np->nvalue.cp = 0;
+                       np->nvflag = 0;
+               }
                if(nq=dtsearch(oroot,np))
                {
                        if(nv_cover(nq))
@@ -2200,6 +2252,11 @@
                /* called from disc, assign the actual value */
                nv_local=0;
        }
+       if(nv_isattr(np,NV_INT16P) == NV_INT16)
+       {
+               np->nvalue.cp = nv_isarray(np)?Empty:0;
+               goto done;
+       }
        if(nv_isarray(np) && np->nvalue.cp!=Empty && np->nvfun)
                up = np->nvalue.up;
        else
@@ -2604,6 +2661,7 @@
        Namarr_t *ap = 0;
        int oldsize,oldatts;
        Namfun_t *fp= (newatts&NV_NODISC)?np->nvfun:0;
+       char *prefix = sh.prefix;
        newatts &= ~NV_NODISC;
 
        /* check for restrictions */
@@ -2623,7 +2681,8 @@
                        sh_envput(sh.env,np);
        }
 #endif
-       if((size==0||(n&NV_INTEGER)) && ((n^newatts)&~NV_NOCHANGE)==0)
+       oldsize = nv_size(np);
+       if((size==oldsize|| (n&NV_INTEGER)) && ((n^newatts)&~NV_NOCHANGE)==0)
        {
                if(size)
                        nv_setsize(np,size);
@@ -2684,6 +2743,7 @@
                np->nvfun = fp;
        if(ap)
                ap->nelem--;
+       sh.prefix = prefix;
        return;
 }
 
@@ -2800,11 +2860,20 @@
        while(c= *cp++)
        {
                if(c=='[')
-                       cp = nv_endsubscript((Namval_t*)0,ep=cp,0);
+               {
+                       if(*cp==']')
+                               cp++;
+                       else
+                               cp = nv_endsubscript((Namval_t*)0,ep=cp,0);
+               }
                else if(c=='.')
                {
                        if(*cp=='[')
-                               cp = nv_endsubscript((Namval_t*)0,cp,0);
+                       {
+                               cp = nv_endsubscript((Namval_t*)0,ep=cp,0);
+                               if((ep=sh_checkid(ep+1,cp)) < cp)
+                                       cp=strcpy(ep,cp);
+                       }
                        ep = 0;
                }
                else if(eq && c == '=')
@@ -2822,6 +2891,7 @@
        Namval_t                *last_table = shp->last_table;
        Dt_t                    *last_root = shp->last_root;
        Dt_t                    *hp = 0;
+       char                    *prefix=shp->prefix,*nvenv = 0;
        if(nv_isattr(np,NV_PARAM) && shp->st.prevst)
        {
                if(!(hp=(Dt_t*)shp->st.prevst->save_tree))
@@ -2837,6 +2907,7 @@
                errormsg(SH_DICT,ERROR_exit(1),e_varname,nv_name(np));
        if(nv_isarray(np) && !(mp=nv_opensub(np)))
                index=nv_aindex(np);
+       shp->prefix = 0;
        if(!hp)
                hp = shp->var_tree;
        if(!(nr = nv_open(cp, hp, 
flags|NV_ARRAY|NV_NOREF|NV_NOSCOPE|NV_NOADD|NV_NOFAIL)))
@@ -2845,6 +2916,7 @@
                hp = shp->last_root;
        if(!nr)
                nr= nv_open(cp, hp, 
flags|NV_NOREF|((flags&NV_MOVE)?0:NV_NOFAIL));
+       shp->prefix = prefix;
        if(!nr)
        {
                if(!nv_isvtree(np))
@@ -2859,7 +2931,10 @@
                        mp->nvenv = (void*)np;
        }
        if(mp)
+       {
+               nvenv = (char*)np;
                np = mp;
+       }
        if(nr==np)
        {
                if(index<0)
@@ -2868,6 +2943,8 @@
                        cp = strdup(cp);
        }
        _nv_unset(np,0);
+       if(!nv_isattr(np,NV_MINIMAL))
+               np->nvenv = nvenv;
        if(nr==np)
        {
                nv_putsub(np,(char*)0, index);
@@ -2892,7 +2969,9 @@
 {
        Shell_t         *shp = &sh;
        register Namval_t *nq, *nr=0;
-       register char *ep,*cp;
+       register char   *ep,*cp;
+       Dt_t            *root = shp->last_root;
+       Namarr_t        *ap;
        if(nv_isref(np))
                return;
        if(nv_isarray(np))
@@ -2908,13 +2987,22 @@
        if(!hp)
                hp = shp->var_tree;
        if(!(nr = nq = nv_open(cp, hp, flags|NV_NOSCOPE|NV_NOADD|NV_NOFAIL)))
-               hp = shp->var_base;
+               hp = shp->last_root==shp->var_tree?shp->var_tree:shp->var_base;
        else if(shp->last_root)
                hp = shp->last_root;
        if(nq && ep && nv_isarray(nq) && !nv_getsub(nq))
                nv_endsubscript(nq,ep-1,NV_ADD);
        if(!nr)
+       {
                nr= nq = nv_open(cp, hp, flags);
+               hp = shp->last_root;
+       }
+       if(shp->last_root == shp->var_tree && root!=shp->var_tree)
+       {
+               _nv_unset(np,NV_RDONLY);
+               nv_onattr(np,NV_REF);
+               errormsg(SH_DICT,ERROR_exit(1),e_globalref,nv_name(np));
+       }
        if(nr==np) 
        {
                if(shp->namespace && nv_dict(shp->namespace)==hp)
@@ -2923,6 +3011,8 @@
                if(!(hp=dtvnext(hp)) || 
(nq=nv_search((char*)np,hp,NV_ADD|HASH_BUCKET))==np)
                        errormsg(SH_DICT,ERROR_exit(1),e_selfref,nv_name(np));
        }
+       if(nq && !ep && (ap=nv_arrayptr(nq)) && 
!(ap->nelem&(ARRAY_UNDEF|ARRAY_SCAN)))
+               ep =  nv_getsub(nq);
        if(ep)
        {
                /* cause subscript evaluation and return result */
@@ -3017,8 +3107,10 @@
        Namval_t *nq;
        if(!nv_isref(np))
                return;
-       nq = nv_refnode(np);
        nv_offattr(np,NV_NOFREE|NV_REF);
+       if(!np->nvalue.nrp)
+               return;
+       nq = nv_refnode(np);
        free((void*)np->nvalue.nrp);
        np->nvalue.cp = strdup(nv_name(nq));
 #if SHOPT_OPTIMIZE
--- old/usr/src/lib/libshell/common/sh/nvdisc.c Fri Sep 25 06:36:13 2009
+++ new/usr/src/lib/libshell/common/sh/nvdisc.c Fri Sep 25 06:36:11 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -150,16 +150,17 @@
        }
 }
 
-#define        LOOKUP          0
+#define        LOOKUPS         0
 #define        ASSIGN          1
 #define        APPEND          2
 #define        UNASSIGN        3
+#define        LOOKUPN         4
 #define BLOCKED                ((Namval_t*)&nv_local)
 
 struct vardisc
 {
        Namfun_t        fun;
-       Namval_t        *disc[4];
+       Namval_t        *disc[5];
 };
 
 struct blocked
@@ -281,12 +282,12 @@
        {
                int bflag;
                block(bp,type);
-               if (type==APPEND && (bflag= !isblocked(bp,LOOKUP)))
-                       block(bp,LOOKUP);
+               if (type==APPEND && (bflag= !isblocked(bp,LOOKUPS)))
+                       block(bp,LOOKUPS);
                sh_fun(nq,np,(char**)0);
                unblock(bp,type);
                if(bflag)
-                       unblock(bp,LOOKUP);
+                       unblock(bp,LOOKUPS);
                if(!vp->disc[type])
                        chktfree(np,vp);
        }
@@ -351,15 +352,15 @@
  * This function executes a lookup disc and then performs
  * the lookup on the given node <np>
  */
-static char*   lookup(Namval_t *np, Namfun_t *handle)
+static char*   lookup(Namval_t *np, int type, Sfdouble_t *dp,Namfun_t *handle)
 {
        register struct vardisc *vp = (struct vardisc*)handle;
        struct blocked          block, *bp = block_info(np, &block);
-       register Namval_t       *nq = vp->disc[LOOKUP];
+       register Namval_t       *nq = vp->disc[type];
        register char           *cp=0;
        Namval_t                node;
        union Value             *up = np->nvalue.up;
-       if(nq && !isblocked(bp,LOOKUP))
+       if(nq && !isblocked(bp,type))
        {
                node = *SH_VALNOD;
                if(!nv_isnull(SH_VALNOD))
@@ -367,16 +368,24 @@
                        nv_onattr(SH_VALNOD,NV_NOFREE);
                        nv_unset(SH_VALNOD);
                }
-               block(bp,LOOKUP);
+               if(type==LOOKUPN)
+               {
+                       nv_onattr(SH_VALNOD,NV_DOUBLE|NV_INTEGER);
+                       nv_setsize(SH_VALNOD,10);
+               }
+               block(bp,type);
                sh_fun(nq,np,(char**)0);
-               unblock(bp,LOOKUP);
-               if(!vp->disc[LOOKUP])
+               unblock(bp,type);
+               if(!vp->disc[type])
                        chktfree(np,vp);
-               if(cp = nv_getval(SH_VALNOD))
+               if(type==LOOKUPN)
                {
-                       cp = stkcopy(stkstd,cp);
-                       _nv_unset(SH_VALNOD,NV_RDONLY);
+                       cp = (char*)(SH_VALNOD->nvalue.cp);
+                       *dp = nv_getnum(SH_VALNOD);
                }
+               else if(cp = nv_getval(SH_VALNOD))
+                       cp = stkcopy(stkstd,cp);
+               _nv_unset(SH_VALNOD,NV_RDONLY);
                if(!nv_isnull(&node))
                {
                        /* restore everything but the nvlink field */
@@ -386,20 +395,30 @@
        if(nv_isarray(np))
                np->nvalue.up = up;
        if(!cp)
-               cp = nv_getv(np,handle);
+       {
+               if(type==LOOKUPS)
+                       cp = nv_getv(np,handle);
+               else
+                       *dp = nv_getn(np,handle);
+       }
        if(bp== &block)
                block_done(bp);
        return(cp);
 }
 
+static char*   lookups(Namval_t *np, Namfun_t *handle)
+{
+       return(lookup(np,LOOKUPS,(Sfdouble_t*)0,handle));
+}
 
-static const Namdisc_t shdisc =
+static Sfdouble_t lookupn(Namval_t *np, Namfun_t *handle)
 {
-       sizeof(struct vardisc),
-       assign,
-       lookup
-};
+       Sfdouble_t      d;
+       lookup(np,LOOKUPN, &d ,handle);
+       return(d);
+}
 
+
 /*
  * Set disc on given <event> to <action>
  * If action==np, the current disc is returned
@@ -465,11 +484,16 @@
                vp = 0;
        if(!vp)
        {
+               Namdisc_t       *dp;
                if(action==np)
                        return((char*)action);
-               if(!(vp = newof(NIL(struct vardisc*),struct vardisc,1,0)))
+               if(!(vp = newof(NIL(struct vardisc*),struct 
vardisc,1,sizeof(Namdisc_t))))
                        return(0);
-               vp->fun.disc = &shdisc;
+               dp = (Namdisc_t*)(vp+1);
+               vp->fun.disc = dp;
+               memset(dp,0,sizeof(*dp));
+               dp->dsize = sizeof(struct vardisc);
+               dp->putval = assign;
                nv_stack(np, (Namfun_t*)vp);
        }
        if(action==np)
@@ -478,7 +502,14 @@
                empty = 0;
        }
        else if(action)
+       {
+               Namdisc_t *dp = (Namdisc_t*)vp->fun.disc;
+               if(type==LOOKUPS)
+                       dp->getval = lookups;
+               else if(type==LOOKUPN)
+                       dp->getnum = lookupn;
                vp->disc[type] = action;
+       }
        else
        {
                struct blocked *bp;
@@ -573,13 +604,14 @@
 {
        register Namfun_t       *nfp;
        register int            size;
+       if(!fp->disc && !fp->next && (fp->nofree&1))
+               return(fp);
        if(!(size=fp->dsize) && (!fp->disc || !(size=fp->disc->dsize)))
                size = sizeof(Namfun_t);
        if(!(nfp=newof(NIL(Namfun_t*),Namfun_t,1,size-sizeof(Namfun_t))))
                return(0);
        memcpy(nfp,fp,size);
-       if(flags&NV_COMVAR)
-               nfp->nofree &= ~1;
+       nfp->nofree &= ~1;
        nfp->nofree |= (flags&NV_RDONLY)?1:0;
        return(nfp);
 }
@@ -901,7 +933,10 @@
                return(1);
        }
        if(nv_isattr(np,NV_INTEGER) && mp->nvalue.ip!=np->nvalue.ip)
+       {
                mp->nvalue.ip = (int*)num_clone(np,(void*)np->nvalue.ip);
+               nv_offattr(mp,NV_NOFREE);
+       }
        else if(flags&NV_NOFREE)
                nv_onattr(np,NV_NOFREE);
        return(1);
@@ -972,7 +1007,7 @@
        }
        else
        {
-               if(*name=='.' && root==sh.var_tree)
+               if(*name=='.' && root==sh.var_tree && !dp)
                        root = sh.var_base;
                np = dtmatch(root,(void*)name);
        }
--- old/usr/src/lib/libshell/common/sh/nvtree.c Fri Sep 25 06:36:16 2009
+++ new/usr/src/lib/libshell/common/sh/nvtree.c Fri Sep 25 06:36:14 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -193,6 +193,8 @@
                                last = 0;
                        }
                }
+               else
+                       dp->hp = (Namval_t*)dtfirst(dp->root);
        }
        else
                dp->hp = (Namval_t*)dtfirst(dp->root);
@@ -283,7 +285,7 @@
                        if(nv_isarray(np))
                                nv_putsub(np,(char*)0, ARRAY_UNDEF);
                        dp->hp = nextnode(dp);
-                       if(nv_isnull(np) && !nv_isarray(np))
+                       if(nv_isnull(np) && !nv_isarray(np) && 
!nv_isattr(np,NV_INTEGER))
                                continue;
                        last_table = sh.last_table;
 #if 0
@@ -417,7 +419,7 @@
                {
                        if(nv_isvtree(np))
                                sfprintf(out,"%s -C ",prefix);
-                       else if(!np->nvalue.cp && 
nv_isattr(np,~NV_NOFREE)==NV_MINIMAL && strcmp(np->nvname,"_"))
+                       else if((!np->nvalue.cp||np->nvalue.cp==Empty) && 
nv_isattr(np,~NV_NOFREE)==NV_MINIMAL && strcmp(np->nvname,"_"))
                                sfputr(out,prefix,' ');
                }
                return;
@@ -478,7 +480,7 @@
                                        }
                                        else if(tp->sh_name[1]=='A')
                                                continue;
-                                       if(ap && (ap->nelem&ARRAY_TREE))
+                                       if((ap && (ap->nelem&ARRAY_TREE)) || 
(!ap && nv_isattr(np,NV_NOFREE)))
                                        {
                                                if(prefix && *prefix)
                                                        sfwrite(out,"-C ",3);
@@ -592,6 +594,8 @@
                if(mp && nv_isvtree(mp))
                        nv_onattr(mp,NV_EXPORT);
                ep = nv_getval(mp?mp:np);
+               if(ep==Empty)
+                       ep = 0;
                xp = 0;
                if(!ap && nv_isattr(np,NV_INTEGER|NV_LJUST)==NV_LJUST)
                {
@@ -681,7 +685,7 @@
                if(!xp)
                        return;
        }
-       if((nv_isnull(np) || np->nvalue.cp==Empty) && !nv_isarray(np))
+       if(nv_isnull(np) && !nv_isarray(np) && !nv_isattr(np,NV_INTEGER))
                return;
        if(special || (nv_isarray(np) && nv_arrayptr(np)))
        {
@@ -718,7 +722,7 @@
                if(*name!='.')
                        nv_attribute(np,wp->out,"typeset",'=');
                nv_outname(wp->out,name,-1);
-               if(np->nvalue.cp || nv_isattr(np,~(NV_MINIMAL|NV_NOFREE)) || 
nv_isvtree(np))  
+               if((np->nvalue.cp && np->nvalue.cp!=Empty) || 
nv_isattr(np,~(NV_MINIMAL|NV_NOFREE)) || nv_isvtree(np))  
                        sfputc(wp->out,(isarray==2?'\n':'='));
                if(isarray==2)
                        return;
@@ -819,15 +823,24 @@
                        }
                        else if(outfile && !wp->nofollow && argv[1] && 
memcmp(arg,argv[1],l=strlen(arg))==0 && argv[1][l]=='[')
                        {
+                               int     k=1;
+                               Namarr_t *ap=0;
                                Namval_t *np = 
nv_open(arg,wp->root,NV_VARNAME|NV_NOADD|NV_NOASSIGN|wp->noscope);
                                if(!np)
                                        continue;
-                               wp->array = nv_isarray(np);
+                               if((wp->array = nv_isarray(np)) && 
(ap=nv_arrayptr(np)))
+                                       k = array_elem(ap);
+                                       
                                if(wp->indent>0)
                                        sfnputc(outfile,'\t',wp->indent);
                                nv_attribute(np,outfile,"typeset",1);
                                nv_close(np);
-                               sfputr(outfile,arg+m+r+(n?n:0),'=');
+                               sfputr(outfile,arg+m+r+(n?n:0),(k?'=':'\n'));
+                               if(!k)
+                               {
+                                       wp->array=0;
+                                       continue;
+                               }
                                wp->nofollow=1;
                                argv = genvalue(argv,cp,cp-arg ,wp);
                                sfputc(outfile,wp->indent<0?';':'\n');
@@ -1031,7 +1044,7 @@
                Shell_t         *shp = sh_getinterp();
                Namval_t        *last_table = shp->last_table;
                Dt_t            *last_root = shp->last_root;
-               Namval_t        *mp = 
val?nv_open(val,shp->var_tree,NV_VARNAME|NV_NOADD|NV_NOASSIGN|NV_NOFAIL):0;
+               Namval_t        *mp = 
val?nv_open(val,shp->var_tree,NV_VARNAME|NV_NOADD|NV_NOASSIGN|NV_ARRAY|NV_NOFAIL):0;
                if(mp && nv_isvtree(mp))
                {
                        shp->prev_table = shp->last_table;
--- old/usr/src/lib/libshell/common/sh/nvtype.c Fri Sep 25 06:36:19 2009
+++ new/usr/src/lib/libshell/common/sh/nvtype.c Fri Sep 25 06:36:17 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -248,6 +248,13 @@
        }
 }
 
+static Namfun_t *clone_chtype(Namval_t* np, Namval_t *mp, int flags, Namfun_t 
*fp)
+{
+       if(flags&NV_NODISC)
+               return(0);
+       return(nv_clone_disc(fp,flags));
+}
+
 static const Namdisc_t chtype_disc =
 {
        sizeof(Namchld_t),
@@ -256,7 +263,7 @@
        0,
        0,
        0,
-       0,
+       clone_chtype,
        name_chtype
 };
 
@@ -394,7 +401,7 @@
                        nrp++;
                        nq = nq->nvalue.nrp->np;
                }
-               if(nq->nvalue.cp || nv_isarray(nq) || nv_isattr(nq,NV_RDONLY))
+               if(nq->nvalue.cp || !nv_isvtree(nq) || nv_isattr(nq,NV_RDONLY))
                {
                        /* see if default value has been overwritten */
                        if(!mp->nvname)
@@ -796,7 +803,7 @@
        nv_onattr(np, NV_RDONLY);
 }
 
-static void addtype(Namval_t *mp)
+void nv_newtype(Namval_t *mp)
 {
        struct  {
                    Optdisc_t   opt;
@@ -1113,8 +1120,10 @@
                        if(nv_isarray(nq) && !nq->nvfun)
                        {
                                nv_putsub(nq, (char*)0, ARRAY_FILL);
-                               ((Namarr_t*)nq->nvfun)->nelem--;
-                               
+                               if(nv_isattr(nq,NV_INTEGER))
+                                       nv_putval(nq, "0",0);
+                               else
+                                       ((Namarr_t*)nq->nvfun)->nelem--;
                        }
                        nv_disc(nq, &pp->childfun.fun, NV_LAST);
                        if(nq->nvfun)
@@ -1139,6 +1148,8 @@
                                if(!j)
                                        free((void*)np->nvalue.cp);
                        }
+                       if(!nq->nvalue.cp && nq->nvfun== &pp->childfun.fun)
+                               nq->nvalue.cp = Empty;
                        np->nvalue.cp = 0;
 #if 0
                        offset += dsize;
@@ -1170,7 +1181,7 @@
        }
        if(mnodes!=nodes)
                free((void*)mnodes);
-       addtype(mp);
+       nv_newtype(mp);
        return(mp);
 }
 
@@ -1207,7 +1218,7 @@
        if(!sign)
                nv_onattr(mp,NV_UNSIGN);
        nv_disc(mp, fp, NV_LAST);
-       addtype(mp);
+       nv_newtype(mp);
        return(mp);
 }
 
@@ -1230,6 +1241,11 @@
 Namval_t *nv_type(Namval_t *np)
 {
        Namfun_t  *fp;
+       if(nv_isattr(np,NV_BLTIN|BLT_DCL)==(NV_BLTIN|BLT_DCL))
+       {
+               Namdecl_t *ntp = (Namdecl_t*)nv_context(np);
+               return(ntp?ntp->tp:0);
+       }
        for(fp=np->nvfun; fp; fp=fp->next)
        {
                if(fp->type)
@@ -1326,6 +1342,7 @@
                np->nvalue.up = 0;
                nofree = ap->hdr.nofree;
                ap->hdr.nofree = 0;
+               ap->hdr.type = tp;
                nv_disc(np, &ap->hdr, NV_FIRST);
                ap->hdr.nofree = nofree;
                nv_onattr(np,NV_ARRAY);
@@ -1492,7 +1509,7 @@
        nv_setsize(mp,rsize);
        nv_disc(mp, &pp->fun, NV_LAST);
        mp->nvalue.cp = pp->data;
-       addtype(mp);
+       nv_newtype(mp);
        return(mp);
 }
 
--- old/usr/src/lib/libshell/common/sh/parse.c  Fri Sep 25 06:36:22 2009
+++ new/usr/src/lib/libshell/common/sh/parse.c  Fri Sep 25 06:36:20 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -32,8 +32,8 @@
 #include       "defs.h"
 #else
 #include       <shell.h>
-#endif
 #include       <ctype.h>
+#endif
 #include       <fcin.h>
 #include       <error.h>
 #include       "shlex.h"
@@ -293,7 +293,7 @@
        Fcin_t  sav_input;
        struct argnod *sav_arg = lexp->arg;
        int     sav_prompt = shp->nextprompt;
-       if(shp->binscript && sffileno(iop)==shp->infd)
+       if(shp->binscript && (sffileno(iop)==shp->infd || (flag&SH_FUNEVAL)))
                return((void*)sh_trestore(shp,iop));
        fcsave(&sav_input);
        shp->st.staklist = 0;
@@ -323,12 +323,13 @@
                        lexp->arg = sav_arg;
                        if(version > 3)
                                errormsg(SH_DICT,ERROR_exit(1),e_lexversion);
-                       if(sffileno(iop)==shp->infd)
+                       if(sffileno(iop)==shp->infd || (flag&SH_FUNEVAL))
                                shp->binscript = 1;
                        sfgetc(iop);
                        return((void*)sh_trestore(shp,iop));
                }
        }
+       flag &= ~SH_FUNEVAL;
        if((flag&SH_NL) && (shp->inlineno=error_info.line+shp->st.firstline)==0)
                shp->inlineno=1;
 #if KSHELL
@@ -718,7 +719,7 @@
        {
                if(fcfill() >= 0)
                        fcseek(-1);
-               if(sh_isstate(SH_HISTORY))
+               if(sh_isstate(SH_HISTORY) && shp->hist_ptr)
                        t->funct.functloc = 
sfseek(shp->hist_ptr->histfp,(off_t)0,SEEK_CUR);
                else
                {
@@ -1177,13 +1178,13 @@
            case LBRACE:
                comsub = lexp->comsub;
                lexp->comsub = 0;
-               t = sh_cmd(lexp,RBRACE,SH_NL);
+               t = sh_cmd(lexp,RBRACE,SH_NL|SH_SEMI);
                lexp->comsub = comsub;
                break;
 
            case LPAREN:
                t = getnode(parnod);
-               t->par.partre=sh_cmd(lexp,RPAREN,SH_NL);
+               t->par.partre=sh_cmd(lexp,RPAREN,SH_NL|SH_SEMI);
                t->par.partyp=TPAR;
                break;
 
@@ -1224,6 +1225,20 @@
        return(t);
 }
 
+static struct argnod *process_sub(Lex_t *lexp,int tok)
+{
+       struct argnod *argp;
+       Shnode_t *t;
+       int mode = (tok==OPROCSYM);
+       t = sh_cmd(lexp,RPAREN,SH_NL);
+       argp = (struct argnod*)stkalloc(lexp->sh->stk,sizeof(struct argnod));
+       *argp->argval = 0;
+       argp->argchn.ap = (struct 
argnod*)makeparent(lexp,mode?TFORK|FPIN|FAMP|FPCL:TFORK|FPOU,t);
+       argp->argflag =  (ARG_EXP|mode);
+       return(argp);
+}
+
+
 /*
  * This is for a simple command, for list, or compound assignment
  */
@@ -1278,7 +1293,7 @@
                                if(assignment==1)
                                {
                                        last = strchr(argp->argval,'=');
-                                       if((cp=strchr(argp->argval,'[')) && (cp 
< last))
+                                       if(last && (last[-1]==']'|| 
(last[-1]=='+' && last[-2]==']')) && (cp=strchr(argp->argval,'[')) && (cp < 
last))
                                                last = cp;
                                        stkseek(stkp,ARGVAL);
                                        
sfwrite(stkp,argp->argval,last-argp->argval);
@@ -1338,17 +1353,11 @@
 #if SHOPT_DEVFD
                if((tok==IPROCSYM || tok==OPROCSYM))
                {
-                       Shnode_t *t;
-                       int mode = (tok==OPROCSYM);
-                       t = sh_cmd(lexp,RPAREN,SH_NL);
-                       argp = (struct argnod*)stkalloc(stkp,sizeof(struct 
argnod));
-                       *argp->argval = 0;
+                       argp = process_sub(lexp,tok);
                        argmax = 0;
                        argno = -1;
                        *argtail = argp;
                        argtail = &(argp->argnxt.ap);
-                       argp->argchn.ap = (struct 
argnod*)makeparent(lexp,mode?TFORK|FPIN|FAMP|FPCL:TFORK|FPOU,t);
-                       argp->argflag =  (ARG_EXP|mode);
                        goto retry;
                }
 #endif /* SHOPT_DEVFD */
@@ -1502,9 +1511,7 @@
        register struct ionod   *iop;
        Stk_t                   *stkp = lexp->sh->stk;
        char *iovname=0;
-#if SHOPT_BASH
        register int            errout=0;
-#endif
        if(token==IOVNAME)
        {
                iovname=lexp->arg->argval+1;
@@ -1518,6 +1525,8 @@
                        iof |= (IODOC|IORAW);
                else if(token==IOMOV0SYM)
                        iof |= IOMOV;
+               else if(token==IORDWRSYMT)
+                       iof |= IORDW|IOREWRITE;
                else if(token==IORDWRSYM)
                        iof |= IORDW;
                else if((token&SYMSHARP) == SYMSHARP)
@@ -1532,13 +1541,11 @@
                break;
 
            case '>':
-#if SHOPT_BASH
                if(iof<0)
                {
                        errout = 1;
                        iof = 1;
                }
-#endif
                iof |= IOPUT;
                if(token==IOAPPSYM)
                        iof |= IOAPP;
@@ -1570,10 +1577,18 @@
                }
                else if(token==EXPRSYM && (iof&IOLSEEK))
                        iof |= IOARITH;
+               else if(((token==IPROCSYM && !(iof&IOPUT)) || (token==OPROCSYM 
&& (iof&IOPUT))) && !(iof&(IOLSEEK|IOREWRITE|IOMOV|IODOC)))
+               {
+                       lexp->arg = process_sub(lexp,token);
+                       iof |= IOPROCSUB;
+               }
                else
                        sh_syntax(lexp);
        }
-       iop->ioname=lexp->arg->argval;
+       if( (iof&IOPROCSUB) && !(iof&IOLSEEK))
+               iop->ioname= (char*)lexp->arg->argchn.ap;
+       else
+               iop->ioname=lexp->arg->argval;
        iop->iovname = iovname;
        if(iof&IODOC)
        {
@@ -1622,11 +1637,11 @@
        {
                struct ionod *ioq=iop;
                sh_lex(lexp);
-#if SHOPT_BASH
                if(errout)
                {
                        /* redirect standard output to standard error */
                        ioq = (struct ionod*)stkalloc(stkp,sizeof(struct 
ionod));
+                       memset(ioq,0,sizeof(*ioq));
                        ioq->ioname = "1";
                        ioq->iolst = 0;
                        ioq->iodelim = 0;
@@ -1633,7 +1648,6 @@
                        ioq->iofile = IORAW|IOPUT|IOMOV|2;
                        iop->ionxt=ioq;
                }
-#endif
                ioq->ionxt=inout(lexp,lastio,flag);
        }
        else
--- old/usr/src/lib/libshell/common/sh/path.c   Fri Sep 25 06:36:25 2009
+++ new/usr/src/lib/libshell/common/sh/path.c   Fri Sep 25 06:36:23 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -601,7 +601,7 @@
        shp->st.filename = pname;
        shp->funload = 1;
        error_info.line = 0;
-       sh_eval(sfnew(NIL(Sfio_t*),buff,IOBSIZE,fno,SF_READ),0);
+       sh_eval(sfnew(NIL(Sfio_t*),buff,IOBSIZE,fno,SF_READ),SH_FUNEVAL);
        shp->readscript = 0;
        free((void*)shp->st.filename);
        shp->funload = oldload;
@@ -652,10 +652,17 @@
                path_init(shp);
        if(flag)
        {
+               if((np=nv_search(name,shp->track_tree,0)) && 
!nv_isattr(np,NV_NOALIAS) && (pp=(Pathcomp_t*)np->nvalue.cp))
+               {
+                       stakseek(PATH_OFFSET);
+                       path_nextcomp(pp,name,pp);
+                       stakputc(0);
+                       return(0);
+               }
                pp = path_absolute(name,oldpp?*oldpp:NIL(Pathcomp_t*));
                if(oldpp)
                        *oldpp = pp;
-               if(!pp && 
(np=nv_search(name,sh.fun_tree,HASH_NOSCOPE))&&np->nvalue.ip)
+               if(!pp && 
(np=nv_search(name,shp->fun_tree,HASH_NOSCOPE))&&np->nvalue.ip)
                        return(1);
                if(!pp)
                        *stakptr(PATH_OFFSET) = 0;
@@ -717,6 +724,7 @@
                                typedef int (*Fptr_t)(int, char*[], void*);
                                Fptr_t addr;
                                int n = staktell();
+                               int libcmd;
                                char *cp;
                                stakputs("b_");
                                stakputs(name);
@@ -727,7 +735,7 @@
                                                cp++;
                                        else
                                                cp = oldpp->blib;
-                                       if(strcmp(cp,LIBCMD)==0 && 
(addr=(Fptr_t)dlllook((void*)0,stakptr(n))))
+                                       if((libcmd = !strcmp(cp,LIBCMD)) && 
(addr=(Fptr_t)dlllook((void*)0,stakptr(n))))
                                        {
                                                if((np = 
sh_addbuiltin(stakptr(PATH_OFFSET),addr,NiL)) && nv_isattr(np,NV_BLTINOPT))
                                                        return(oldpp);
@@ -737,7 +745,21 @@
 #else
                                        if (oldpp->bltin_lib = 
dllfind(oldpp->blib, NiL, RTLD_LAZY, NiL, 0))
 #endif
-                                               sh_addlib(oldpp->bltin_lib);
+                                       {
+                                               /*
+                                                * this detects the 2007-05-11 
builtin context change and also
+                                                * the 2008-03-30 opt_info.num 
change that hit libcmd::b_head
+                                                */
+
+                                               if (libcmd && 
!dlllook(oldpp->bltin_lib, "b_pids"))
+                                               {
+                                                       
dlclose(oldpp->bltin_lib);
+                                                       oldpp->bltin_lib = 0;
+                                                       oldpp->blib = 0;
+                                               }
+                                               else
+                                                       
sh_addlib(oldpp->bltin_lib);
+                                       }
                                }
                                
if((addr=(Fptr_t)dlllook(oldpp->bltin_lib,stakptr(n))) &&
                                   (!(np = 
sh_addbuiltin(stakptr(PATH_OFFSET),NiL,NiL)) || np->nvalue.bfp!=addr) &&
@@ -881,7 +903,7 @@
        Pathcomp_t *libpath, *pp=0;
        Shell_t *shp = &sh;
        int slash=0;
-       nv_setlist(local,NV_EXPORT|NV_IDENT|NV_ASSIGN);
+       nv_setlist(local,NV_EXPORT|NV_IDENT|NV_ASSIGN,0);
        envp = sh_envgen();
        if(strchr(arg0,'/'))
        {
@@ -926,7 +948,7 @@
        char **xp=0, *xval, *libenv = (libpath?libpath->lib:0); 
        Namval_t*       np;
        char            *s, *v;
-       int             r, n;
+       int             r, n, pidsize;
        pid_t           pid= -1;
        /* leave room for inserting _= pathname in environment */
        envp--;
@@ -933,8 +955,9 @@
 #if _lib_readlink
        /* save original pathname */
        stakseek(PATH_OFFSET);
+       pidsize = sfprintf(stkstd,"*%d*",spawn?getpid():getppid());
        stakputs(opath);
-       opath = stakfreeze(1)+PATH_OFFSET;
+       opath = stakfreeze(1)+PATH_OFFSET+pidsize;
        np=nv_search(argv[0],shp->track_tree,0);
        while(libpath && !libpath->lib)
                libpath=libpath->next;
@@ -1012,7 +1035,7 @@
        }
        if(!opath)
                opath = stakptr(PATH_OFFSET);
-       envp[0] =  (char*)opath-PATH_OFFSET;
+       envp[0] =  (char*)opath-(PATH_OFFSET+pidsize);
        envp[0][0] =  '_';
        envp[0][1] =  '=';
        sfsync(sfstderr);
@@ -1219,6 +1242,8 @@
                (HISTCUR)->nvalue.lp = 0;
        }
        sh_offstate(SH_FORKED);
+       if(shp->sigflag[SIGCHLD]==SH_SIGOFF)
+               shp->sigflag[SIGCHLD] = SH_SIGFAULT;
        siglongjmp(*shp->jmplist,SH_JMPSCRIPT);
 }
 
--- old/usr/src/lib/libshell/common/sh/pmain.c  Fri Sep 25 06:36:28 2009
+++ new/usr/src/lib/libshell/common/sh/pmain.c  Fri Sep 25 06:36:26 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/sh/shcomp.c Fri Sep 25 06:36:31 2009
+++ new/usr/src/lib/libshell/common/sh/shcomp.c Fri Sep 25 06:36:29 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/sh/streval.c        Fri Sep 25 06:36:34 2009
+++ new/usr/src/lib/libshell/common/sh/streval.c        Fri Sep 25 06:36:32 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -78,11 +78,13 @@
        Sfdouble_t      (*convert)(const char**,struct lval*,int,Sfdouble_t);
 };
 
-typedef int       (*Math_0_f)(Sfdouble_t);
-typedef Sfdouble_t (*Fun_t)(Sfdouble_t,...);
-typedef Sfdouble_t (*Math_1_f)(Sfdouble_t);
-typedef Sfdouble_t (*Math_2_f)(Sfdouble_t,Sfdouble_t);
-typedef Sfdouble_t (*Math_3_f)(Sfdouble_t,Sfdouble_t,Sfdouble_t);
+typedef Sfdouble_t (*Math_f)(Sfdouble_t,...);
+typedef Sfdouble_t (*Math_1f_f)(Sfdouble_t);
+typedef int       (*Math_1i_f)(Sfdouble_t);
+typedef Sfdouble_t (*Math_2f_f)(Sfdouble_t,Sfdouble_t);
+typedef int        (*Math_2i_f)(Sfdouble_t,Sfdouble_t);
+typedef Sfdouble_t (*Math_3f_f)(Sfdouble_t,Sfdouble_t,Sfdouble_t);
+typedef int        (*Math_3i_f)(Sfdouble_t,Sfdouble_t,Sfdouble_t);
 
 #define getchr(vp)     (*(vp)->nextchr++)
 #define peekchr(vp)    (*(vp)->nextchr)
@@ -155,7 +157,7 @@
        register char *tp;
        Sfdouble_t small_stack[SMALL_STACK+1];
        const char *ptr = "";
-       Fun_t fun;
+       Math_f fun;
        struct lval node;
        node.emode = ep->emode;
        node.expr = ep->expr;
@@ -257,11 +259,12 @@
                        node.value = (char*)dp;
                        node.flag = c;
                        num = (*ep->fun)(&ptr,&node,ASSIGN,num);
+                       c=0;
                        break;
                    case A_PUSHF:
-                       cp = roundptr(ep,cp,Fun_t);
+                       cp = roundptr(ep,cp,Math_f);
                        *++sp = (Sfdouble_t)(cp-ep->code);
-                       cp += sizeof(Fun_t);
+                       cp += sizeof(Math_f);
                        *++tp = *cp++;
                        continue;
                    case A_PUSHN:
@@ -368,29 +371,35 @@
                        num = (sp[-1]<num);
                        type=0;
                        break;
-                   case A_CALL0:
+                   case A_CALL1F:
                        sp--,tp--;
-                       fun = *((Fun_t*)(ep->code+(int)(*sp)));
+                       fun = *((Math_f*)(ep->code+(int)(*sp)));
                        type = 0;
-                       num = (*((Math_0_f)fun))(num);
+                       num = (*((Math_1f_f)fun))(num);
                        break;
-                   case A_CALL1:
+                   case A_CALL1I:
                        sp--,tp--;
-                       fun = *((Fun_t*)(ep->code+(int)(*sp)));
+                       fun = *((Math_f*)(ep->code+(int)(*sp)));
                        type = *tp;
-                       num = (*fun)(num);
+                       num = (*((Math_1i_f)fun))(num);
                        break;
-                   case A_CALL2:
+                   case A_CALL2F:
                        sp-=2,tp-=2;
-                       fun = *((Fun_t*)(ep->code+(int)(*sp)));
+                       fun = *((Math_f*)(ep->code+(int)(*sp)));
+                       type = 0;
+                       num = (*((Math_2f_f)fun))(sp[1],num);
+                       break;
+                   case A_CALL2I:
+                       sp-=2,tp-=2;
+                       fun = *((Math_f*)(ep->code+(int)(*sp)));
                        type = *tp;
-                       num = (*((Math_2_f)fun))(sp[1],num);
+                       num = (*((Math_2i_f)fun))(sp[1],num);
                        break;
-                   case A_CALL3:
+                   case A_CALL3F:
                        sp-=3,tp-=3;
-                       fun = *((Fun_t*)(ep->code+(int)(*sp)));
-                       type = *tp;
-                       num = (*((Math_3_f)fun))(sp[1],sp[2],num);
+                       fun = *((Math_f*)(ep->code+(int)(*sp)));
+                       type = 0;
+                       num = (*((Math_3f_f)fun))(sp[1],sp[2],num);
                        break;
                }
                if(c&T_BINARY)
@@ -593,7 +602,10 @@
                                vp->staksize--;
                        }
                        if(!expr(vp,c))
+                       {
+                               stakseek(-1);
                                return(0);
+                       }
                        lvalue.value = 0;
                        break;
 
@@ -610,7 +622,7 @@
                                        vp->stakmaxsize = vp->staksize;
                                vp->infun=1;
                                stakputc(A_PUSHF);
-                               stakpush(vp,fun,Fun_t);
+                               stakpush(vp,fun,Math_f);
                                stakputc(1);
                        }
                        else
@@ -623,13 +635,13 @@
                        vp->paren--;
                        if(fun)
                        {
-                               int  x= (nargs>7);
+                               int  x= (nargs>7)?2:-1;
                                nargs &= 7;
                                if(vp->infun != nargs)
                                        ERROR(vp,e_argcount);
                                if(vp->staksize+=nargs>=vp->stakmaxsize)
                                        vp->stakmaxsize = vp->staksize+nargs;
-                               stakputc(A_CALL0+nargs -x);
+                               stakputc(A_CALL1F+nargs+x);
                                vp->staksize -= nargs;
                        }
                        vp->infun = infun;
--- old/usr/src/lib/libshell/common/sh/string.c Fri Sep 25 06:36:37 2009
+++ new/usr/src/lib/libshell/common/sh/string.c Fri Sep 25 06:36:35 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -27,7 +27,6 @@
 #include       <ast_wchar.h>
 #include       "defs.h"
 #include       <stak.h>
-#include       <ctype.h>
 #include       <ccode.h>
 #include       "shtable.h"
 #include       "lexstates.h"
--- old/usr/src/lib/libshell/common/sh/subshell.c       Fri Sep 25 06:36:40 2009
+++ new/usr/src/lib/libshell/common/sh/subshell.c       Fri Sep 25 06:36:38 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -102,11 +102,11 @@
        Shell_t *shp = &sh;
        int fds[2];
        Sfoff_t off;
+       register struct checkpt *pp = (struct checkpt*)shp->jmplist;
+       register struct subshell *sp = subshell_data->pipe;
        if(sfset(sfstdout,0,0)&SF_STRING)
        {
                register int fd;
-               register struct checkpt *pp = (struct checkpt*)shp->jmplist;
-               register struct subshell *sp = subshell_data->pipe;
                /* save file descriptor 1 if open */
                if((sp->tmpfd = fd = fcntl(1,F_DUPFD,10)) >= 0)
                {
@@ -113,15 +113,20 @@
                        fcntl(fd,F_SETFD,FD_CLOEXEC);
                        shp->fdstatus[fd] = shp->fdstatus[1]|IOCLEX;
                        close(1);
+                       shp->fdstatus[1] = IOCLOSE;
                }
                else if(errno!=EBADF)
+               {
+                       ((struct checkpt*)shp->jmplist)->mode = SH_JMPERREXIT;
+                       shp->toomany = 1;
                        errormsg(SH_DICT,ERROR_system(1),e_toomany);
-               if(!pflag)
+               }
+               if(shp->subshare || !pflag)
                {
                        sfdisc(sfstdout,SF_POPDISC);
                        if((fd=sffileno(sfstdout))>=0)
                        {
-                               sh.fdstatus[fd] = IOREAD|IOWRITE;
+                               shp->fdstatus[fd] = IOREAD|IOWRITE;
                                sfsync(sfstdout);
                                if(fd==1)
                                        fcntl(1,F_SETFD,0);
@@ -128,12 +133,17 @@
                                else
                                {
                                        sfsetfd(sfstdout,1);
-                                       sh.fdstatus[1] = sh.fdstatus[fd];
-                                       sh.fdstatus[fd] = IOCLOSE;
+                                       shp->fdstatus[1] = shp->fdstatus[fd];
+                                       shp->fdstatus[fd] = IOCLOSE;
                                }
                                goto skip;
                        }
                }
+       }
+       if(sp && (shp->fdstatus[1]==IOCLOSE || (!shp->subshare && 
!(shp->fdstatus[1]&IONOSEEK))))
+       {
+               struct stat statb,statx;
+               int fd;
                sh_pipe(fds);
                sp->pipefd = fds[0];
                sh_fcntl(sp->pipefd,F_SETFD,FD_CLOEXEC);
@@ -143,10 +153,22 @@
                        
write(fds[1],sfsetbuf(sfstdout,(Void_t*)sfstdout,0),(size_t)off);
                        sfpurge(sfstdout);
                }
+               if((sfset(sfstdout,0,0)&SF_STRING) || fstat(1,&statb)<0)
+                       statb.st_ino = 0;
                sfclose(sfstdout);
                if((sh_fcntl(fds[1],F_DUPFD, 1)) != 1)
-                       errormsg(SH_DICT,ERROR_system(1),e_file+4);
+                       errormsg(SH_DICT,ERROR_system(1),e_redirect);
                sh_close(fds[1]);
+               if(statb.st_ino) for(fd=0; fd < 10; fd++)
+               {
+                       if(fd==1 || 
((shp->fdstatus[fd]&(IONOSEEK|IOSEEK|IOWRITE))!=(IOSEEK|IOWRITE)) || 
fstat(fd,&statx)<0)
+                               continue;
+                       if(statb.st_ino==statx.st_ino && 
statb.st_dev==statx.st_dev)
+                       {
+                               sh_close(fd);
+                               fcntl(1,F_DUPFD, fd);
+                       }
+               }
        skip:
                sh_iostream(shp,1);
                sfset(sfstdout,SF_SHARE|SF_PUBLIC,1);
@@ -156,6 +178,7 @@
        }
 }
 
+
 /*
  * This routine creates a temp file if necessary and creates a subshell.
  * The parent routine longjmps back to sh_subshell()
@@ -167,16 +190,21 @@
        Shell_t *shp = sp->shp;
        int     curenv = shp->curenv;
        pid_t pid;
+       char *trap = shp->st.trapcom[0];
+       if(trap)
+               trap = strdup(trap);
        /* see whether inside $(...) */
        if(sp->pipe)
                sh_subtmpfile(1);
        shp->curenv = 0;
-       if(pid = sh_fork(0,NIL(int*)))
+       if(pid = sh_fork(FSHOWME,NIL(int*)))
        {
                shp->curenv = curenv;
                /* this is the parent part of the fork */
                if(sp->subpid==0)
                        sp->subpid = pid;
+               if(trap)
+                       free((void*)trap);
                siglongjmp(*shp->jmplist,SH_JMPSUB);
        }
        else
@@ -190,6 +218,7 @@
                shp->subshell = 0;
                SH_SUBSHELLNOD->nvalue.s = 0;
                sp->subpid=0;
+               shp->st.trapcom[0] = trap;
        }
 }
 
@@ -225,7 +254,7 @@
        Namarr_t                *ap;
        int                     save;
        /* don't bother with this */
-       if(!sp->shpwd || (nv_isnull(np) && !add))
+       if(!sp->shpwd || (nv_isnull(np) && !add) || np==SH_LEVELNOD)
                return(np);
        /* don't bother to save if in newer scope */
        if(!(rp=shp->st.real_fun)  || !(dp=rp->sdict))
@@ -305,7 +334,7 @@
                        continue;
                if(nv_isarray(mp))
                         nv_putsub(mp,NIL(char*),ARRAY_SCAN);
-               _nv_unset(mp,NV_RDONLY);
+               _nv_unset(mp,NV_RDONLY|NV_CLONE);
                if(nv_isarray(np))
                {
                        nv_clone(np,mp,NV_MOVE);
@@ -317,7 +346,11 @@
                mp->nvfun = np->nvfun;
                mp->nvflag = np->nvflag;
                if(nv_cover(mp))
-                       nv_putval(mp, np->nvalue.cp,0);
+               {
+                       nv_putval(mp, nv_getval(np),np->nvflag|NV_NOFREE);
+                       if(!nv_isattr(np,NV_NOFREE))
+                               nv_offattr(mp,NV_NOFREE);
+               }
                else
                        mp->nvalue.cp = np->nvalue.cp;
                np->nvfun = 0;
@@ -386,7 +419,7 @@
        {
                nq = (Namval_t*)dtnext(root,np);
                flag=0;
-               if(fun && np->nvalue.rp->fname && *np->nvalue.rp->fname=='/')
+               if(fun && np->nvalue.rp && np->nvalue.rp->fname && 
*np->nvalue.rp->fname=='/')
                {
                        np->nvalue.rp->fdict = 0;
                        flag = NV_NOFREE;
@@ -437,7 +470,7 @@
        Shell_t *shp = &sh;
        struct subshell sub_data;
        register struct subshell *sp = &sub_data;
-       int jmpval,nsig=0;
+       int jmpval,nsig=0,duped=0;
        int savecurenv = shp->curenv;
        int savejobpgid = job.curpgid;
        int16_t subshell;
@@ -498,7 +531,6 @@
                sp->cpid = shp->cpid;
                sp->coutpipe = shp->coutpipe;
                sp->cpipe = shp->cpipe[1];
-               shp->coutpipe = shp->cpipe[1] = -1;
                shp->cpid = 0;
                sh_sigreset(0);
        }
@@ -554,6 +586,7 @@
                subshell_data = sp->prev;
                if(jmpval==SH_JMPSCRIPT)
                        siglongjmp(*shp->jmplist,jmpval);
+               shp->exitval &= SH_EXITMASK;
                sh_done(shp,0);
        }
        if(comsub)
@@ -584,7 +617,11 @@
                        {
                                int fd=sfsetfd(iop,3);
                                if(fd<0)
+                               {
+                                       shp->toomany = 1;
+                                       ((struct checkpt*)shp->jmplist)->mode = 
SH_JMPERREXIT;
                                        
errormsg(SH_DICT,ERROR_system(1),e_toomany);
+                               }
                                shp->sftable[fd] = iop;
                                fcntl(fd,F_SETFD,FD_CLOEXEC);
                                shp->fdstatus[fd] = (shp->fdstatus[1]|IOCLEX);
@@ -597,7 +634,8 @@
                if(sp->tmpfd>=0)
                {
                        close(1);
-                       fcntl(sp->tmpfd,F_DUPFD,1);
+                       if (fcntl(sp->tmpfd,F_DUPFD,1) != 1)
+                               duped++;
                        sh_close(sp->tmpfd);
                }
                shp->fdstatus[1] = sp->fdstatus;
@@ -609,8 +647,6 @@
                shp->exitval = 0;
                if(comsub)
                        shp->spid = sp->subpid;
-               else
-                       job_wait(sp->subpid);
        }
        if(comsub && iop && sp->pipefd<0)
                sfseek(iop,(off_t)0,SEEK_SET);
@@ -671,7 +707,7 @@
                        free((void*)sp->pwd);
                if(sp->mask!=shp->mask)
                        umask(shp->mask=sp->mask);
-               if(shp->coutpipe>=0)
+               if(shp->coutpipe!=sp->coutpipe)
                {
                        sh_close(shp->coutpipe);
                        sh_close(shp->cpipe[1]);
@@ -683,6 +719,11 @@
        shp->subshare = sp->subshare;
        if(shp->subshell)
                SH_SUBSHELLNOD->nvalue.s = --shp->subshell;
+       subshell = shp->subshell;
+       subshell_data = sp->prev;
+       sh_argfree(shp,argsav,0);
+       if(shp->topfd != buff.topfd)
+               sh_iorestore(shp,buff.topfd|IOSUBSHELL,jmpval);
        if(sp->sig)
        {
                if(sp->prev)
@@ -693,12 +734,10 @@
                        sh_chktrap();
                }
        }
-       subshell = shp->subshell;
-       subshell_data = sp->prev;
-       sh_argfree(shp,argsav,0);
+       sh_sigcheck();
        shp->trapnote = 0;
-       if(shp->topfd != buff.topfd)
-               sh_iorestore(shp,buff.topfd|IOSUBSHELL,jmpval);
+       if(sp->subpid && !comsub)
+               job_wait(sp->subpid);
        if(shp->exitval > SH_EXITSIG)
        {
                int sig = shp->exitval&SH_EXITMASK;
@@ -705,5 +744,13 @@
                if(sig==SIGINT || sig== SIGQUIT)
                        sh_fault(sig);
        }
+       if(duped)
+       {
+               ((struct checkpt*)shp->jmplist)->mode = SH_JMPERREXIT;
+               shp->toomany = 1;
+               errormsg(SH_DICT,ERROR_system(1),e_redirect);
+       }
+       if(jmpval && shp->toomany)
+               siglongjmp(*shp->jmplist,jmpval);
        return(iop);
 }
--- old/usr/src/lib/libshell/common/sh/suid_exec.c      Fri Sep 25 06:36:43 2009
+++ new/usr/src/lib/libshell/common/sh/suid_exec.c      Fri Sep 25 06:36:41 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/sh/tdump.c  Fri Sep 25 06:36:46 2009
+++ new/usr/src/lib/libshell/common/sh/tdump.c  Fri Sep 25 06:36:44 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/sh/timers.c Fri Sep 25 06:36:49 2009
+++ new/usr/src/lib/libshell/common/sh/timers.c Fri Sep 25 06:36:47 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/sh/trestore.c       Fri Sep 25 06:36:52 2009
+++ new/usr/src/lib/libshell/common/sh/trestore.c       Fri Sep 25 06:36:50 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -134,6 +134,7 @@
                {
                        Stak_t *savstak;
                        struct slnod *slp;
+                       struct functnod *fp;
                        t = getnode(shp->stk,functnod);
                        t->funct.functloc = -1;
                        t->funct.functline = sfgetu(infile);
@@ -140,10 +141,15 @@
                        t->funct.functnam = r_string(shp->stk);
                        savstak = stakcreate(STAK_SMALL);
                        savstak = stakinstall(savstak, 0);
-                       slp = (struct slnod*)stkalloc(shp->stk,sizeof(struct 
slnod));
+                       slp = (struct slnod*)stkalloc(shp->stk,sizeof(struct 
slnod)+sizeof(struct functnod));
                        slp->slchild = 0;
                        slp->slnext = shp->st.staklist;
                        shp->st.staklist = 0;
+                       fp = (struct functnod*)(slp+1);
+                       memset(fp, 0, sizeof(*fp));
+                       fp->functtyp = TFUN|FAMP;
+                       if(shp->st.filename)
+                               fp->functnam = 
stkcopy(shp->stk,shp->st.filename);
                        t->funct.functtre = r_tree(shp); 
                        t->funct.functstak = slp;
                        slp->slptr =  stakinstall(savstak,0);
--- old/usr/src/lib/libshell/common/sh/waitevent.c      Fri Sep 25 06:36:55 2009
+++ new/usr/src/lib/libshell/common/sh/waitevent.c      Fri Sep 25 06:36:53 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/common/sh/xec.c    Fri Sep 25 06:36:58 2009
+++ new/usr/src/lib/libshell/common/sh/xec.c    Fri Sep 25 06:36:56 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -352,7 +352,12 @@
        int16_t level, oldlevel = (int16_t)nv_getnum(np);
        nv_putv(np,val,flags,fp);
        if(!val)
+       {
+               fp = nv_stack(np, NIL(Namfun_t*));
+               if(fp && !fp->nofree)
+                       free((void*)fp);
                return;
+       }
        level = nv_getnum(np);
        if(level<0 || level > lp->maxlevel)
        {
@@ -414,7 +419,7 @@
                        n -= 2;
                sfwrite(iop,cp,n);
        }
-       if(!(flags&ARG_RAW))
+       if(*argv && !(flags&ARG_RAW))
                out_string(iop, *argv++,' ', 0);
        n = (flags&ARG_ARITH);
        while(cp = *argv++)
@@ -466,7 +471,9 @@
        struct checkpt buff;
        static Sfio_t *io_save;
        volatile int traceon=0, lineno=0;
+       int binscript=shp->binscript;
        io_save = iop; /* preserve correct value across longjmp */
+       shp->binscript = 0;
 #define SH_TOPFUN      0x8000  /* this is a temporary tksh hack */
        if (mode & SH_TOPFUN)
        {
@@ -476,7 +483,7 @@
        sh_pushcontext(&buff,SH_JMPEVAL);
        buff.olist = pp->olist;
        jmpval = sigsetjmp(buff.buff,0);
-       if(jmpval==0)
+       while(jmpval==0)
        {
                if(mode&SH_READEVAL)
                {
@@ -484,22 +491,28 @@
                        if(traceon=sh_isoption(SH_XTRACE))
                                sh_offoption(SH_XTRACE);
                }
-               t = (Shnode_t*)sh_parse(shp,iop,(mode&SH_READEVAL)?0:SH_NL);
-               if(mode&SH_READEVAL)
-                       mode &= SH_READEVAL;
-               else
-                       sfclose(iop);
-               io_save = 0;
+               t = 
(Shnode_t*)sh_parse(shp,iop,(mode&(SH_READEVAL|SH_FUNEVAL))?mode&SH_FUNEVAL:SH_NL);
+               if(!(mode&SH_FUNEVAL) || !sfreserve(iop,0,0))
+               {
+                       if(!(mode&SH_READEVAL))
+                               sfclose(iop);
+                       io_save = 0;
+                       mode &= ~SH_FUNEVAL;
+               }
+               mode &= ~SH_READEVAL;
                if(!sh_isoption(SH_VERBOSE))
                        sh_offstate(SH_VERBOSE);
-               if(mode && shp->hist_ptr)
+               if((mode&~SH_FUNEVAL) && shp->hist_ptr)
                {
                        hist_flush(shp->hist_ptr);
                        mode = sh_state(SH_INTERACTIVE);
                }
-               sh_exec(t,sh_isstate(SH_ERREXIT)|mode);
+               
sh_exec(t,sh_isstate(SH_ERREXIT)|sh_isstate(SH_NOFORK)|(mode&~SH_FUNEVAL));
+               if(!(mode&SH_FUNEVAL))
+                       break;
        }
        sh_popcontext(&buff);
+       shp->binscript = binscript;
        if(traceon)
                sh_onoption(SH_XTRACE);
        if(lineno)
@@ -597,12 +610,14 @@
  */
 static int set_instance(Namval_t *nq, Namval_t *node, struct Namref *nr)
 {
-       char            *cp = nv_name(nq);
+       char            *sp=0,*cp = nv_name(nq);
        Namarr_t        *ap;
        memset(nr,0,sizeof(*nr));
        nr->np = nq;
        nr->root = sh.var_tree;
        nr->table = sh.last_table;
+       if((ap=nv_arrayptr(nq)) && (sp = nv_getsub(nq)))
+               sp = strdup(sp);
        if(sh.var_tree!=sh.var_base && 
!nv_open(cp,nr->root,NV_VARNAME|NV_NOREF|NV_NOSCOPE|NV_NOADD|NV_NOFAIL))
                nr->root = sh.var_base;
        nv_putval(SH_NAMENOD, cp, NV_NOFREE);
@@ -611,9 +626,9 @@
        L_ARGNOD->nvflag = NV_REF|NV_NOFREE;
        L_ARGNOD->nvfun = 0;
        L_ARGNOD->nvenv = 0;
-       if((ap=nv_arrayptr(nq)) && (cp = nv_getsub(nq)) && (cp = strdup(cp)))
+       if(sp)
        {
-               nv_putval(SH_SUBSCRNOD,nr->sub=cp,NV_NOFREE);
+               nv_putval(SH_SUBSCRNOD,nr->sub=sp,NV_NOFREE);
                return(ap->nelem&ARRAY_SCAN);
        }
        return(0);
@@ -644,9 +659,12 @@
                register char   *com0 = 0;
                int             errorflg = (type&sh_state(SH_ERREXIT))|OPTIMIZE;
                int             execflg = (type&sh_state(SH_NOFORK));
+               int             execflg2 = (type&sh_state(SH_FORKED));
                int             mainloop = (type&sh_state(SH_INTERACTIVE));
 #if SHOPT_AMP || SHOPT_SPAWN
                int             ntflag = (type&sh_state(SH_NTFORK));
+#else
+               int             ntflag = 0;
 #endif
                int             topfd = shp->topfd;
                char            *sav=stkptr(stkp,0);
@@ -659,6 +677,8 @@
                int             echeck = 0;
                if(flags&sh_state(SH_INTERACTIVE))
                {
+                       if(pipejob==2)
+                               job_unlock();
                        pipejob = 0;
                        job.curpgid = 0;
                        flags &= ~sh_state(SH_INTERACTIVE);
@@ -746,6 +766,7 @@
                        {
                                if(argn==0 || (np && nv_isattr(np,BLT_SPC)))
                                {
+                                       Namval_t *tp=0;
                                        if(argn)
                                        {
                                                if(checkopt(com,'A'))
@@ -771,7 +792,10 @@
 #endif
                                        {
                                                if(np!=SYSTYPESET)
+                                               {
                                                        shp->typeinit = np;
+                                                       tp = nv_type(np);
+                                               }
                                                if(checkopt(com,'C'))
                                                        flgs |= NV_COMVAR;
                                                if(checkopt(com,'S'))
@@ -778,6 +802,8 @@
                                                        flgs |= NV_STATIC;
                                                if(checkopt(com,'n'))
                                                        flgs |= NV_NOREF;
+                                               else if(!shp->typeinit && 
(checkopt(com,'L') || checkopt(com,'R') || checkopt(com,'Z')))
+                                                       flgs |= NV_UNJUST;
 #if SHOPT_TYPEDEF
                                                else if(argn>=3 && 
checkopt(com,'T'))
                                                {
@@ -799,7 +825,7 @@
                                        if(OPTIMIZE)
                                                flgs |= NV_TAGGED;
 #endif
-                                       nv_setlist(argp,flgs);
+                                       nv_setlist(argp,flgs,tp);
                                        if(np==shp->typeinit)
                                                shp->typeinit = 0;
                                        shp->envlist = argp;
@@ -875,6 +901,11 @@
                                                        np = 0;
                                        }
                                }
+                               if(np && pipejob==2)
+                               {
+                                       job_unlock();
+                                       pipejob = 1;
+                               }
                                /* check for builtins */
                                if(np && is_abuiltin(np))
                                {
@@ -882,6 +913,7 @@
                                        volatile void *save_ptr;
                                        volatile void *save_data;
                                        int jmpval, save_prompt;
+                                       int was_nofork = 
execflg?sh_isstate(SH_NOFORK):0;
                                        struct checkpt buff;
                                        unsigned long was_vi=0, was_emacs=0, 
was_gmacs=0;
                                        struct stat statb;
@@ -902,6 +934,8 @@
                                                sh_offoption(SH_EMACS);
                                                sh_offoption(SH_GMACS);
                                        }
+                                       if(execflg)
+                                               sh_onstate(SH_NOFORK);
                                        sh_pushcontext(&buff,SH_JMPCMD);
                                        jmpval = sigsetjmp(buff.buff,1);
                                        if(jmpval == 0)
@@ -999,6 +1033,8 @@
                                        }
                                        if(bp && bp->ptr!= nv_context(np))
                                                np->nvfun = (Namfun_t*)bp->ptr;
+                                       if(execflg && !was_nofork)
+                                               sh_offstate(SH_NOFORK);
                                        if(!(nv_isattr(np,BLT_ENV)))
                                        {
                                                if(bp->nosfio && shp->pwd)
@@ -1019,7 +1055,7 @@
                                        }
                                        sh_popcontext(&buff);
                                        errorpop(&buff.err);
-                                       error_info.flags &= ~ERROR_SILENT;
+                                       error_info.flags &= 
~(ERROR_SILENT|ERROR_NOTIFY);
                                        shp->bltinfun = 0;
                                        if(buff.olist)
                                                free_list(buff.olist);
@@ -1127,15 +1163,19 @@
                        register pid_t parent;
                        int no_fork,jobid;
                        int pipes[2];
-                       no_fork = (execflg && !(type&(FAMP|FPOU)) &&
-#if SHOPT_AMP || SHOPT_SPAWN
-                               !ntflag &&
-#endif
-                               !shp->subshell && !shp->st.trapcom[0] && 
-                               !shp->st.trap[SH_ERRTRAP] && shp->fn_depth==0 &&
-                               !(pipejob && sh_isoption(SH_PIPEFAIL)));
                        if(shp->subshell)
-                               sh_subtmpfile(1);
+                       {
+                               if(shp->subshare)
+                                       sh_subtmpfile(1);
+                               else
+                                       sh_subfork();
+                       }
+                       no_fork = !ntflag && !(type&(FAMP|FPOU)) &&
+                           !shp->st.trapcom[0] && !shp->st.trap[SH_ERRTRAP] &&
+                               (execflg2 || (execflg && 
+                               !shp->subshell && shp->fn_depth==0 &&
+                               !(pipejob && sh_isoption(SH_PIPEFAIL))
+                           ));
                        if(sh_isstate(SH_PROFILE) || shp->dot_depth)
                        {
                                /* disable foreground job monitor */
@@ -1150,6 +1190,18 @@
                                job.parent=parent=0;
                        else
                        {
+#ifdef SHOPT_BGX
+                               int maxjob;
+                               if(((type&(FAMP|FINT)) == (FAMP|FINT)) && 
(maxjob=nv_getnum(JOBMAXNOD))>0)
+                               {
+                                       while(job.numbjob >= maxjob)
+                                       {
+                                               job_lock();
+                                               job_reap(0);
+                                               job_unlock();
+                                       }
+                               }
+#endif /* SHOPT_BGX */
                                if(type&FCOOP)
                                        coproc_init(shp,pipes);
                                nv_getval(RANDNOD);
@@ -1183,6 +1235,11 @@
                         * It may or may not wait for the child
                         */
                        {
+                               if(pipejob==2)
+                               {
+                                       pipejob = 1;
+                                       job_unlock();
+                               }
                                if(type&FPCL)
                                        sh_close(shp->inpipe[0]);
                                if(type&(FCOOP|FAMP))
@@ -1197,11 +1254,13 @@
                                                        sh_sigtrap(SIGINT);
                                                shp->trapnote |= SH_SIGIGNORE;
                                        }
-                                       if(execflg && shp->subshell)
+                                       if(execflg && shp->subshell && 
!shp->subshare)
                                        {
                                                shp->spid = parent;
                                                job.pwlist->p_env--;
                                        }
+                                       else if(shp->pipepid)
+                                               shp->pipepid = parent;
                                        else
                                                job_wait(parent);
                                        if(!sh_isoption(SH_MONITOR))
@@ -1294,7 +1353,7 @@
                                         */
                                        if(!no_fork && !(type&FPOU))
                                                job_clear();
-                                       
sh_exec(t->fork.forktre,flags|sh_state(SH_NOFORK));
+                                       
sh_exec(t->fork.forktre,flags|sh_state(SH_NOFORK)|sh_state(SH_FORKED));
                                }
                                else if(com0)
                                {
@@ -1317,7 +1376,8 @@
                     * save and restore io-streams
                     */
                        pid_t   pid;
-                       int jmpval, waitall;
+                       int     jmpval, waitall;
+                       int     simple = 
(t->fork.forktre->tre.tretyp&COMMSK)==TCOM;
                        struct checkpt buff;
                        if(shp->subshell)
                                execflg = 0;
@@ -1327,13 +1387,17 @@
                                was_interactive = sh_isstate(SH_INTERACTIVE);
                                sh_offstate(SH_INTERACTIVE);
                                if(!execflg)
+                               {
                                        sh_iosave(shp,0,shp->topfd,(char*)0);
+                                       if(simple)
+                                               shp->pipepid = 1;
+                               }
                                sh_iorenumber(shp,shp->inpipe[0],0);
                                /*
                                 * if read end of pipe is a simple command
                                 * treat as non-sharable to improve performance
                                 */
-                               if((t->fork.forktre->tre.tretyp&COMMSK)==TCOM)
+                               if(simple)
                                        sfset(sfstdin,SF_PUBLIC|SF_SHARE,0);
                                waitall = job.waitall;
                                job.waitall = 0;
@@ -1346,7 +1410,7 @@
                        {
                                sh_redirect(shp,t->fork.forkio,execflg);
                                (t->fork.forktre)->tre.tretyp |= 
t->tre.tretyp&FSHOWME;
-                               sh_exec(t->fork.forktre,flags);
+                               sh_exec(t->fork.forktre,flags&~simple);
                        }
                        else
                                sfsync(shp->outpool);
@@ -1361,10 +1425,17 @@
                                if(!(type&SH_EXITSIG))
                                {
                                        /* wait for remainder of pipline */
-                                       job_wait(waitall?pid:0);
+                                       if(shp->pipepid>1)
+                                       {
+                                               job_wait(shp->pipepid);
+                                               type = shp->exitval;
+                                       }
+                                       else
+                                               job_wait(waitall?pid:0);
                                        if(type || !sh_isoption(SH_PIPEFAIL))
                                                shp->exitval = type;
                                }
+                               shp->pipepid = 0;
                                shp->st.ioset = 0;
                        }
                        if(jmpval>SH_JMPIO)
@@ -1377,8 +1448,17 @@
                        flags &= ~OPTIMIZE_FLAG;
                        if(!shp->subshell && !shp->st.trapcom[0] && 
!shp->st.trap[SH_ERRTRAP] && (flags&sh_state(SH_NOFORK)))
                        {
-                               int jmpval;
+                               char *savsig;
+                               int nsig,jmpval;
                                struct checkpt buff;
+                               shp->st.otrapcom = 0;
+                               if((nsig=shp->st.trapmax*sizeof(char*))>0 || 
shp->st.trapcom[0])
+                               {
+                                       nsig += sizeof(char*);
+                                       
memcpy(savsig=malloc(nsig),(char*)&shp->st.trapcom[0],nsig);
+                                       shp->st.otrapcom = (char**)savsig;
+                               }
+                               sh_sigreset(0);
                                sh_pushcontext(&buff,SH_JMPEXIT);
                                jmpval = sigsetjmp(buff.buff,0);
                                if(jmpval==0)
@@ -1419,6 +1499,7 @@
                                job.waitall = 1;
                        else
                                job.waitall |= !pipejob && 
sh_isstate(SH_MONITOR);
+                       job_lock();
                        do
                        {
 #if SHOPT_FASTPIPE
@@ -1442,6 +1523,7 @@
                        while(!type && t->tre.tretyp==TFIL);
                        shp->inpipe = pvn;
                        shp->outpipe = 0;
+                       pipejob = 2;
                        if(type == 0)
                        {
                                /*
@@ -1454,6 +1536,8 @@
                        else
                                /* execution failure, close pipe */
                                sh_pclose(pvn);
+                       if(pipejob==2)
+                               job_unlock();
                        pipejob = savepipe;
 #ifdef SIGTSTP
                        if(!pipejob && sh_isstate(SH_MONITOR))
@@ -1651,7 +1735,7 @@
                                shp->offsets[0] = -1;
                                shp->offsets[1] = 0;
                                if(tt->com.comset)
-                                       
nv_setlist(tt->com.comset,NV_IDENT|NV_ASSIGN);
+                                       
nv_setlist(tt->com.comset,NV_IDENT|NV_ASSIGN,0);
                        }
 #endif /*SHOPT_FILESCAN */
                        shp->st.loopcnt++;
@@ -2336,7 +2420,15 @@
                        job.curpgid = parent;
                if(flags&FCOOP)
                        shp->cpid = parent;
+#ifdef SHOPT_BGX
+               if(!postid && (flags&(FAMP|FINT)) == (FAMP|FINT))
+                       postid = 1;
                myjob = job_post(parent,postid);
+               if(postid==1)
+                       postid = 0;
+#else
+               myjob = job_post(parent,postid);
+#endif /* SHOPT_BGX */
                if(flags&FAMP)
                        job.curpgid = curpgid;
                if(jobid)
@@ -2388,7 +2480,8 @@
 #endif /* SHOPT_ACCT */
        /* Reset remaining signals to parent */
        /* except for those `lost' by trap   */
-       sh_sigreset(2);
+       if(!(flags&FSHOWME))
+               sh_sigreset(2);
        shp->subshell = 0;
        if((flags&FAMP) && shp->coutpipe>1)
                sh_close(shp->coutpipe);
@@ -2463,6 +2556,8 @@
        struct funenv           *fp;
        struct checkpt          buff;
        Namval_t                *nspace = shp->namespace;
+       Dt_t                    *last_root = shp->last_root;
+       Shopt_t                 options = shp->options;
        if(shp->fn_depth==0)
                shp->glob_options =  shp->options;
        else
@@ -2534,7 +2629,10 @@
        if(jmpval == 0)
        {
                if(shp->fn_depth++ > MAXDEPTH)
+               {
+                       shp->toomany = 1;
                        siglongjmp(*shp->jmplist,SH_JMPERRFN);
+               }
                else if(fun)
                        r= (*fun)(arg);
                else
@@ -2567,7 +2665,8 @@
        shp->trapnote=0;
        if(nsig)
                stakset(savstak,0);
-       shp->options = shp->glob_options;
+       shp->options = options;
+       shp->last_root = last_root;
        if(trap)
        {
                sh_trap(trap,0);
@@ -2588,7 +2687,8 @@
        struct funenv fun;
        char *fname = nv_getval(SH_FUNNAMENOD);
        struct Level    *lp =(struct Level*)(SH_LEVELNOD->nvfun);
-       int             level;
+       int             level, pipepid=shp->pipepid;
+       shp->pipepid = 0;
        sh_stats(STAT_FUNCT);
        if(!lp->hdr.disc)
                lp = init_level(0);
@@ -2632,6 +2732,7 @@
        nv_putval(SH_FUNNAMENOD,fname,NV_NOFREE);
 #endif
        nv_putval(SH_PATHNAMENOD,shp->st.filename,NV_NOFREE);
+       shp->pipepid = pipepid;
 }
 
 /*
@@ -3136,7 +3237,7 @@
        {
                sh_unscope(shp);
                if(jmpval==SH_JMPSCRIPT)
-                       nv_setlist(t->com.comset,NV_EXPORT|NV_IDENT|NV_ASSIGN);
+                       
nv_setlist(t->com.comset,NV_EXPORT|NV_IDENT|NV_ASSIGN,0);
        }
        if(t->com.comio)
                sh_iorestore(shp,buff.topfd,jmpval);
--- /dev/null   Fri Sep 25 06:37:01 2009
+++ new/usr/src/lib/libshell/common/tests/README.tests  Fri Sep 25 06:36:59 2009
@@ -0,0 +1,50 @@
+
+#### ksh93 test suite
+
+## Intro
+The directory /usr/demo/ksh/tests/ contains the ksh93 test suite
+which is used to verify the correct behaviour of ksh93.
+
+The test suite is split into modules with the ending *.sh
+and a frontend called "shtests" which is used to run the tests.
+
+
+## Basic description:
+/usr/demo/ksh/tests/shtests <options> <varname=value> <testmodule>
+
+<options> may be:
+    -a execute test module one time as normal script code
+       and a 2nd time as compiled shell script. The env
+       variable SHCOMP defines the version of the shell
+       compiler being used (default is /usr/bin/shcomp).
+    -c execute test module as compiled shell script
+    -s execute test module as normal shell script
+    -t do not print timing information
+    -v use VMDEBUG
+<varname=value>
+    Sets one or more environment variables to value "value".
+<testmodule>
+    file name of test module
+
+
+## Basic usage:
+The tests can be executed like this:
+$ export SHELL=<path-to-ksh93-executable>
+for t in /usr/demo/ksh/tests/*.sh ; do
+    $SHELL /usr/demo/ksh/tests/shtests -a $t
+done
+
+Note that you MUST NOT use "/usr/bin/ksh93" as value for
+SHELL since /usr/bin/ksh93 on Solaris is a wrapper which
+selects a suitable executable in /usr/bin/<isa>/ksh93
+based on the hardware capabilities defined via /usr/bin/isalist
+
+Valid values for SHELL are:
+- SHELL=/usr/bin/i86/ksh93      # 32bit i386
+- SHELL=/usr/bin/amd64/ksh93    # 64bit AMD64
+- SHELL=/usr/bin/sparcv7/ksh93  # 32bit SPARC
+- SHELL=/usr/bin/sparcv9/ksh93  # 64bit SPARC
+- SHELL=/usr/bin/s390/ksh93     # 32bit SystemZ
+- SHELL=/usr/bin/s390x/ksh93    # 64bit SystemZ
+
+# EOF.
--- old/usr/src/lib/libshell/common/tests/alias.sh      Fri Sep 25 06:37:04 2009
+++ new/usr/src/lib/libshell/common/tests/alias.sh      Fri Sep 25 06:37:02 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -27,6 +27,10 @@
 
 Command=${0##*/}
 integer Errors=0
+
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
 alias foo='print hello'
 if     [[ $(foo) != hello ]]
 then   err_exit 'foo, where foo is alias for "print hello" failed'
@@ -66,7 +70,7 @@
 if     [[ $(!! hello 2>/dev/null) != hello ]]
 then   err_exit 'alias for !!=print not working'
 fi
-alias foo=echo 
+alias foo=echo
 if     [[ $(print  "$(foo bar)" ) != bar  ]]
 then   err_exit 'alias in command substitution not working'
 fi
@@ -81,14 +85,12 @@
        [[ $(alias -t | grep rm= ) ]] && err_exit 'tracked alias not cleared'
 fi
 if     hash -r 2>/dev/null && [[ ! $(hash) ]]
-then   mkdir  /tmp/ksh$$ || err_exit "mkdir /tmp/ksh$$ failed" 
-       trap "cd /; rm -rf /tmp/ksh$$" EXIT
-       PATH=/tmp/ksh$$:/bin:/usr/bin
+then   PATH=$tmp:/bin:/usr/bin
        for i in foo -foo --
-       do      print ':' > /tmp/ksh$$/$i
-               chmod +x /tmp/ksh$$/$i
+       do      print ':' > $tmp/$i
+               chmod +x $tmp/$i
                hash -r -- $i 2>/dev/null || err_exit "hash -r -- $i failed"
-               [[ $(hash) == $i=/tmp/ksh$$/$i ]] || err_exit "hash -r -- $i 
failed, expected $i=/tmp/ksh$$/$i, got $(hash)"
+               [[ $(hash) == $i=$tmp/$i ]] || err_exit "hash -r -- $i failed, 
expected $i=$tmp/$i, got $(hash)"
        done
 else   err_exit 'hash -r failed'
 fi
--- old/usr/src/lib/libshell/common/tests/append.sh     Fri Sep 25 06:37:07 2009
+++ new/usr/src/lib/libshell/common/tests/append.sh     Fri Sep 25 06:37:05 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
--- old/usr/src/lib/libshell/common/tests/arith.sh      Fri Sep 25 06:37:10 2009
+++ new/usr/src/lib/libshell/common/tests/arith.sh      Fri Sep 25 06:37:08 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -26,8 +26,13 @@
 alias err_exit='err_exit $LINENO'
 
 Command=${0##*/}
-trap '' FPE # NOTE: osf.alpha requires this (no ieee math)
 integer Errors=0
+
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
+trap '' FPE # NOTE: osf.alpha requires this (no ieee math)
+
 integer x=1 y=2 z=3
 if     (( 2+2 != 4 ))
 then   err_exit 2+2!=4
@@ -135,7 +140,7 @@
 then   err_exit 'floating point allowed with % operator'
 fi
 x=.125
-if     [[ $(( 4 * x/2 )) != 0.25 ]] 
+if     [[ $(( 4 * x/2 )) != 0.25 ]]
 then   err_exit '(( 4 * x/2 )) is not 0.25, with x=.125'
 fi
 if     [[ $(( pow(2,3) )) != 8 ]]
@@ -190,7 +195,7 @@
 fi
 function newscope
 {
-       float x=1.5 
+       float x=1.5
        (( x += 1 ))
        print -r -- $x
 }
@@ -342,7 +347,7 @@
 do     (( ipx = ip % 256 ))
        (( ip /= 256 ))
        (( ipx != hex[3-i] )) && err_exit "hex digit $((3-i)) not correct"
-done   
+done
 unset x
 x=010
 (( x == 8 )) || err_exit 'leading zeros not treated as octal arithmetic'
@@ -365,8 +370,7 @@
 unset i; typeset -i i=01-2
 (( i == -1 )) || err_exit "01-2 is not -1"
 
-trap 'rm -f /tmp/script$$ /tmp/data$$.[12]' EXIT
-cat > /tmp/script$$ <<-\!
+cat > $tmp/script <<-\!
 tests=$*
 typeset -A blop
 function blop.get
@@ -412,14 +416,14 @@
 }
 mkobj bla
 !
-chmod +x /tmp/script$$
-[[ $(/tmp/script$$ 1) != '( bar=2 baz=3 foo=1 )' ]] 2>/dev/null && err_exit 
'compound var arithmetic failed'
-[[ $(/tmp/script$$ 2) != '( faz=0 )' ]] 2>/dev/null && err_exit 'compound var 
arithmetic failed'
-[[ $(/tmp/script$$ 3) != '( foz=777 )' ]] 2>/dev/null && err_exit 'compound 
var arithmetic failed'
-[[ $(/tmp/script$$ 4) != '( foz=777 )' ]] 2>/dev/null && err_exit 'compound 
var arithmetic failed'
-[[ $(/tmp/script$$ 5) != '( fuz=777 )' ]] 2>/dev/null && err_exit 'compound 
var arithmetic failed'
-[[ $(/tmp/script$$ 6) != '0' ]] 2>/dev/null && err_exit 'compound var 
arithmetic failed'
-[[ $(/tmp/script$$ 7) != '0' ]] 2>/dev/null && err_exit 'compound var 
arithmetic failed'
+chmod +x $tmp/script
+[[ $($tmp/script 1) != '( bar=2 baz=3 foo=1 )' ]] 2>/dev/null && err_exit 
'compound var arithmetic failed'
+[[ $($tmp/script 2) != '( faz=0 )' ]] 2>/dev/null && err_exit 'compound var 
arithmetic failed'
+[[ $($tmp/script 3) != '( foz=777 )' ]] 2>/dev/null && err_exit 'compound var 
arithmetic failed'
+[[ $($tmp/script 4) != '( foz=777 )' ]] 2>/dev/null && err_exit 'compound var 
arithmetic failed'
+[[ $($tmp/script 5) != '( fuz=777 )' ]] 2>/dev/null && err_exit 'compound var 
arithmetic failed'
+[[ $($tmp/script 6) != '0' ]] 2>/dev/null && err_exit 'compound var arithmetic 
failed'
+[[ $($tmp/script 7) != '0' ]] 2>/dev/null && err_exit 'compound var arithmetic 
failed'
 unset foo
 typeset -F1 foo=123456789.19
 [[ $foo == 123456789.2 ]] || err_exit 'typeset -F1 not working correctly'
@@ -434,7 +438,7 @@
 do     [[ $( ( $SHELL -c "( print -r -- \$(($expr)) )" ) 2>/dev/null ) == 2 ]] 
|| err_exit "invalid value for: $expr"
 done
 [[ $((5||0)) == 1 ]] || err_exit '$((5||0))'" == $((5||0)) should be 1"
-$SHELL -c 'integer x=3 y=2; (( (y += x += 2) == 7  && x==5))' 2> /dev/null || 
err_exit '((y += x += 2)) not working' 
+$SHELL -c 'integer x=3 y=2; (( (y += x += 2) == 7  && x==5))' 2> /dev/null || 
err_exit '((y += x += 2)) not working'
 $SHELL -c 'b=0; [[ $((b?a=1:b=9)) == 9 ]]' 2> /dev/null || err_exit 'b?a=1:b=9 
not working'
 unset x
 (( x = 4*atan(1.0) ))
@@ -483,4 +487,41 @@
 $SHELL -c '(( x+=));:' 2> /dev/null && err_exit '((x+=)) should be an error'
 $SHELL -c '(( x=+));:' 2> /dev/null && err_exit '((x=+)) should be an error'
 $SHELL -c 'x=();x.arr[0]=(z=3); ((x.arr[0].z=2))' 2> /dev/null || err_exit 
'(((x.arr[0].z=2)) should not be an error'
+
+float t
+typeset a b r
+v="-0.0 0.0 +0.0 -1.0 1.0 +1.0"
+for a in $v
+do     for b in $v
+       do      (( r = copysign(a,b) ))
+               (( t = copysign(a,b) ))
+               [[ $r == $t ]] || err_exit $(printf "float 
t=copysign(%3.1f,%3.1f) => %3.1f -- expected %3.1f\n" a b t r)
+       done
+done
+
+typeset -l y y_ascii
+(( y=sin(90) )) 
+y_ascii=$y 
+(( y == y_ascii )) || err_exit "no match,\n\t$(printf "%a\n" 
y)\n!=\n\t$(printf "%a\n" y_ascii)"
+
+( $SHELL  <<- \EOF
+       p=5
+       t[p]=6
+       while (( t[p] != 0 )) ; do
+               ((
+               p+=1 , 
+               t[p]+=2 , 
+               p+=3 , 
+               t[p]+=5 , 
+               p+=1 , 
+               t[p]+=2 , 
+               p+=1 , 
+               t[p]+=1 , 
+               p-=6  ,
+               t[p]-=1 
+               ))
+       :
+       done
+EOF) 2> /dev/null ||  err_exit 'error with comma expression'
+
 exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/arrays.sh     Fri Sep 25 06:37:13 2009
+++ new/usr/src/lib/libshell/common/tests/arrays.sh     Fri Sep 25 06:37:11 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -25,6 +25,12 @@
 }
 alias err_exit='err_exit $LINENO'
 
+Command=${0##*/}
+integer Errors=0
+
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
 function fun
 {
        integer i
@@ -34,8 +40,6 @@
        done
 }
 
-Command=${0##*/}
-integer Errors=0
 set -A x zero one two three four 'five six'
 if     [[ $x != zero ]]
 then   err_exit '$x is not element 0'
@@ -268,7 +272,7 @@
        export foo
        typeset -i foo
        [[ $($SHELL -c "print $foo") == 143 ]]'
-) 2> /dev/null || 
+) 2> /dev/null ||
                err_exit 'exporting associative array not exporting 0-th 
element'
 unset foo
 typeset -A foo
@@ -283,7 +287,7 @@
 do     : ${foo[$i]}
 done
 if     [[ ${!f...@]} != two ]]
-then   err_exit 'Error in subscript names'
+then   err_exit 'error in subscript names'
 fi
 unset x
 x=( 1 2 3)
@@ -329,10 +333,9 @@
 [[ $bam == value ]] && err_exit 'unset associative array element error'
 : only first element of an array can be exported
 unset bam
-trap 'rm -f /tmp/sharr$$' EXIT
-print 'print ${var[0]} ${var[1]}' > /tmp/sharr$$
-chmod +x /tmp/sharr$$
-[[ $($SHELL -c "var=(foo bar);export var;/tmp/sharr$$") == foo ]] || err_exit 
'export array not exporting just first element'
+print 'print ${var[0]} ${var[1]}' > $tmp/script
+chmod +x $tmp/script
+[[ $($SHELL -c "var=(foo bar);export var;$tmp/script") == foo ]] || err_exit 
'export array not exporting just first element'
 unset foo
 set -o allexport
 foo=one
@@ -339,14 +342,14 @@
 foo[1]=two
 foo[0]=three
 [[ $foo == three ]] || err_exit 'export all not working with arrays'
-cat > /tmp/sharr$$ <<- \!
+cat > $tmp/script <<- \!
        typeset -A foo
        print foo${foo[abc]}
 !
 # 04-05-24 bug fix
 unset foo
-[[ $($SHELL -c "typeset -A foo;/tmp/sharr$$")  == foo ]] 2> /dev/null || 
err_exit 'empty associative arrays not being cleared correctly before scripts'
-[[ $($SHELL -c "typeset -A foo;foo[abc]=abc;/tmp/sharr$$") == foo ]] 2> 
/dev/null || err_exit 'associative arrays not being cleared correctly before 
scripts'
+[[ $($SHELL -c "typeset -A foo;$tmp/script")  == foo ]] 2> /dev/null || 
err_exit 'empty associative arrays not being cleared correctly before scripts'
+[[ $($SHELL -c "typeset -A foo;foo[abc]=abc;$tmp/script") == foo ]] 2> 
/dev/null || err_exit 'associative arrays not being cleared correctly before 
scripts'
 unset foo
 foo=(one two)
 [[ ${f...@]:1} == two ]] || err_exit '${f...@]:1} == two'
@@ -406,7 +409,7 @@
        test_array[3]=4
        print "val=${test_array[3]}"
 ++EOF+++
-) == val=4 ]] 2> /dev/null || err_exit 'after reading array[j] and assign 
array[j] fails' 
+) == val=4 ]] 2> /dev/null || err_exit 'after reading array[j] and assign 
array[j] fails'
 [[ $($SHELL <<- \+++EOF+++
        pastebin=( typeset -a form)
        pastebin.form+=( name="name"   data="clueless" )
@@ -464,4 +467,10 @@
 [[ ${a[-1]} == six ]] || err_exit 'a[-1] should be six'
 [[ ${a[-3]} == four ]] || err_exit 'a[-3] should be four'
 [[ ${a[-3..-1]} == 'four six' ]] || err_exit "a[-3,-1] should be 'four six'"
+
+FILTER=(typeset scope)
+FILTER[0].scope=include
+FILTER[1].scope=exclude
+[[ ${#filt...@]} == 2 ]] ||  err_exit "FILTER array should have two elements 
not ${#filt...@]}"
+
 exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/arrays2.sh    Fri Sep 25 06:37:16 2009
+++ new/usr/src/lib/libshell/common/tests/arrays2.sh    Fri Sep 25 06:37:14 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
--- old/usr/src/lib/libshell/common/tests/attributes.sh Fri Sep 25 06:37:19 2009
+++ new/usr/src/lib/libshell/common/tests/attributes.sh Fri Sep 25 06:37:17 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -27,6 +27,10 @@
 
 Command=${0##*/}
 integer Errors=0
+
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
 r=readonly u=Uppercase l=Lowercase i=22 i8=10 L=abc L5=def uL5=abcdef xi=20
 x=export t=tagged H=hostname LZ5=026 RZ5=026 Z5=123 lR5=ABcdef R5=def n=l
 for option in u l i i8 L L5 LZ5 RZ5 Z5 r x H t R5 uL5 lR5 xi n
@@ -115,18 +119,18 @@
 sz=(typeset -E y=2.2)
 string="$(print $sz)"
 if [[ "${sz}" == *'typeset -E -F'* ]]
-then   err_exit 'print of exponential shows both -E and -F attributes'  
+then   err_exit 'print of exponential shows both -E and -F attributes'
 fi
-print 'typeset -i m=48/4+1;print -- $m' > /tmp/ksh$$
-chmod +x /tmp/ksh$$
+print 'typeset -i m=48/4+1;print -- $m' > $tmp/script
+chmod +x $tmp/script
 typeset -Z2 m
-if     [[ $(/tmp/ksh$$) != 13 ]]
+if     [[ $($tmp/script) != 13 ]]
 then   err_exit 'attributes not cleared for script execution'
 fi
-print 'print VAR=$VAR' > /tmp/ksh$$
+print 'print VAR=$VAR' > $tmp/script
 typeset -L70 VAR=var
-/tmp/ksh$$ > /tmp/ksh$$.1
-[[ $(< /tmp/ksh$$.1) == VAR= ]] || err_exit 'typeset -L should not be 
inherited'
+$tmp/script > $tmp/script.1
+[[ $(< $tmp/script.1) == VAR= ]] || err_exit 'typeset -L should not be 
inherited'
 typeset -Z  LAST=00
 unset -f foo
 function foo
@@ -145,7 +149,6 @@
 then   err_exit 'LAST!=2'
 fi
 [[ $(set | grep LAST) == LAST=02 ]] || err_exit "LAST not correct in set list"
-rm -rf /tmp/ksh$$*
 set -a
 unset foo
 foo=bar
@@ -195,7 +198,9 @@
 !
 [[ $v1 == "$b1" ]] || err_exit "v1=$v1 should be $b1"
 [[ $v2 == "$x" ]] || err_exit "v1=$v2 should be $x"
-[[ $(env - '!=1' $SHELL -c 'echo ok' 2>/dev/null) == ok ]] || err_exit 
'malformed environment terminates shell'
+if     env '!=1' >/dev/null 2>&1
+then   [[ $(env '!=1' $SHELL -c 'echo ok' 2>/dev/null) == ok ]] || err_exit 
'malformed environment terminates shell'
+fi
 unset var
 typeset -b var
 printf '12%Z34' | read -r -N 5 var
@@ -211,10 +216,10 @@
 unset -f fun
 function fun
 {
-       export foo=hello 
+       export foo=hello
        typeset -x  bar=world
        [[ $foo == hello ]] || err_exit 'export scoping problem in function'
-} 
+}
 fun
 [[ $(export | grep foo) == 'foo=hello' ]] || err_exit 'export not working in 
functions'
 [[ $(export | grep bar) ]] && err_exit 'typeset -x not local'
@@ -224,9 +229,9 @@
 unset x y z
 typeset -LZ3 x=abcd y z=00abcd
 y=03
-[[ $y == "3  " ]] || err_exit '-LZ3 not working for value 03' 
-[[ $x == "abc" ]] || err_exit '-LZ3 not working for value abcd' 
-[[ $x == "abc" ]] || err_exit '-LZ3 not working for value 00abcd' 
+[[ $y == "3  " ]] || err_exit '-LZ3 not working for value 03'
+[[ $x == "abc" ]] || err_exit '-LZ3 not working for value abcd'
+[[ $x == "abc" ]] || err_exit '-LZ3 not working for value 00abcd'
 unset x z
 set +a
 [[ $(typeset -p z) ]] && err_exit "typeset -p for z undefined failed"
@@ -280,4 +285,43 @@
 }
 bar=xxx
 [[ $(foo) == bar=xxx ]] || err_exit 'typeset -p not working inside a function'
+unset foo
+typeset -L5 foo
+[[ $(typeset -p foo) == 'typeset -L 5 foo' ]] || err_exit 'typeset -p not 
working for variables with attributes but without a value'
+{ $SHELL  <<- EOF
+       typeset -L3 foo=aaa
+       typeset -L6 foo=bbbbbb
+       [[ \$foo == bbbbbb ]]
+EOF
+}  || err_exit 'typeset -L should not preserve old attributes'
+{ $SHELL <<- EOF
+       typeset -R3 foo=aaa
+       typeset -R6 foo=bbbbbb
+       [[ \$foo == bbbbbb ]]
+EOF
+} 2> /dev/null || err_exit 'typeset -R should not preserve old attributes'
+
+expected='YWJjZGVmZ2hpag=='
+unset foo
+typeset -b -Z10 foo
+read foo <<< 'abcdefghijklmnop'
+[[ $foo == "$expected" ]] || err_exit 'read foo, where foo is "typeset -b 
-Z10" not working'
+unset foo
+typeset -b -Z10 foo
+read -N10 foo <<< 'abcdefghijklmnop'
+[[ $foo == "$expected" ]] || err_exit 'read -N10 foo, where foo is "typeset -b 
-Z10" not working'
+unset foo
+typeset  -b -A foo
+read -N10 foo[4] <<< 'abcdefghijklmnop'
+[[ ${foo[4]} == "$expected" ]] || err_exit 'read -N10 foo, where foo is 
"typeset  -b -A" foo not working'
+unset foo
+typeset  -b -a foo
+read -N10 foo[4] <<< 'abcdefghijklmnop'
+[[ ${foo[4]} == "$expected" ]] || err_exit 'read -N10 foo, where foo is 
"typeset  -b -a" foo not working'
+[[ $(printf %B foo[4]) == abcdefghij ]] || err_exit 'printf %B for binary 
associative array element not working'
+[[ $(printf %B foo[4]) == abcdefghij ]] || err_exit 'printf %B for binary 
indexed array element not working'
+unset foo
+
+$SHELL 2> /dev/null -c 'export foo=(bar=3)' && err_exit 'compound variables 
cannot be exported'
+
 exit   $((Errors))
--- old/usr/src/lib/libshell/common/tests/basic.sh      Fri Sep 25 06:37:22 2009
+++ new/usr/src/lib/libshell/common/tests/basic.sh      Fri Sep 25 06:37:20 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -25,9 +25,13 @@
 }
 alias err_exit='err_exit $LINENO'
 
-# test basic file operations like redirection, pipes, file expansion
 Command=${0##*/}
 integer Errors=0
+
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
+# test basic file operations like redirection, pipes, file expansion
 set -- \
        go+r    0000    \
        go-r    0044    \
@@ -53,11 +57,9 @@
 if     [[ $(umask -S) != u=rwx,g=rx,o=rx ]]
 then   err_exit 'umask -S incorrect'
 fi
-mkdir  /tmp/ksh$$ || err_exit "mkdir /tmp/ksh$$ failed" 
-trap "cd /; rm -rf /tmp/ksh$$" EXIT
 pwd=$PWD
 [[ $SHELL != /* ]] && SHELL=$pwd/$SHELL
-cd /tmp/ksh$$ || err_exit "cd /tmp/ksh$$ failed"
+cd $tmp || { err_exit "cd $tmp failed"; exit 1; }
 um=$(umask -S)
 ( umask 0777; > foobar )
 rm -f foobar
@@ -70,11 +72,11 @@
 for i in 1 2
 do      print foobar*
         rm -f foobar
-done > out$$
-if      [[ "$(<out$$)"  != "foobar"$'\n'"foobar*" ]]
+done > out
+if      [[ "$(<out)"  != "foobar"$'\n'"foobar*" ]]
 then    print -u2 "optimizer bug with file expansion"
 fi
-rm -f out$$ foobar
+rm -f out foobar
 mkdir dir
 if     [[ $(print */) != dir/ ]]
 then   err_exit 'file expansion with trailing / not working'
@@ -100,7 +102,7 @@
 if     (( $# != 5 ))
 then   err_exit "dat* matches only $# files"
 fi
-if     (command > foo\\abc) 2> /dev/null 
+if     (command > foo\\abc) 2> /dev/null
 then   set -- foo*
        if      [[ $1 != 'foo\abc' ]]
        then    err_exit 'foo* does not match foo\abc'
@@ -113,15 +115,14 @@
        fi
 fi
 cd ~- || err_exit "cd back failed"
-cat > /tmp/ksh$$/script <<- !
+cat > $tmp/script <<- !
        #! $SHELL
        print -r -- \$0
 !
-chmod 755 /tmp/ksh$$/script
-if     [[ $(/tmp/ksh$$/script) != "/tmp/ksh$$/script" ]]
+chmod 755 $tmp/script
+if     [[ $($tmp/script) != "$tmp/script" ]]
 then   err_exit '$0 not correct for #! script'
 fi
-rm -r /tmp/ksh$$ || err_exit "rm -r /tmp/ksh$$ failed"
 bar=foo
 eval foo=\$bar
 if     [[ $foo != foo ]]
@@ -140,9 +141,9 @@
 ( sleep 2; cat <<!
 foobar
 !
-) | cat > /tmp/foobar$$ &
+) | cat > $tmp/foobar &
 wait $!
-foobar=$( < /tmp/foobar$$) 
+foobar=$( < $tmp/foobar)
 if     [[ $foobar != foobar ]]
 then   err_exit "$foobar is not foobar"
 fi
@@ -150,26 +151,26 @@
        print foo
        /bin/echo bar
        print bam
-} > /tmp/foobar$$
-if     [[ $( < /tmp/foobar$$) != $'foo\nbar\nbam' ]]
-then   err_exit "Output file pointer not shared correctly."
+} > $tmp/foobar
+if     [[ $( < $tmp/foobar) != $'foo\nbar\nbam' ]]
+then   err_exit "output file pointer not shared correctly"
 fi
-cat > /tmp/foobar$$ <<\!
+cat > $tmp/foobar <<\!
        print foo
        /bin/echo bar
        print bam
 !
-chmod +x /tmp/foobar$$
-if     [[ $(/tmp/foobar$$) != $'foo\nbar\nbam' ]]
-then   err_exit "Script not working."
+chmod +x $tmp/foobar
+if     [[ $($tmp/foobar) != $'foo\nbar\nbam' ]]
+then   err_exit "script not working"
 fi
-if     [[ $(/tmp/foobar$$ | /bin/cat) != $'foo\nbar\nbam' ]]
-then   err_exit "Script | cat not working."
+if     [[ $($tmp/foobar | /bin/cat) != $'foo\nbar\nbam' ]]
+then   err_exit "script | cat not working"
 fi
-if     [[ $( /tmp/foobar$$) != $'foo\nbar\nbam' ]]
-then   err_exit "Output file pointer not shared correctly."
+if     [[ $( $tmp/foobar) != $'foo\nbar\nbam' ]]
+then   err_exit "output file pointer not shared correctly"
 fi
-rm -f /tmp/foobar$$
+rm -f $tmp/foobar
 x=$( (print foo) ; (print bar) )
 if     [[ $x != $'foo\nbar' ]]
 then   err_exit " ( (print foo);(print bar ) failed"
@@ -182,7 +183,7 @@
 if     [[ $x != $'foo\nbar' ]]
 then   err_exit " ( (/bin/echo);(/bin/echo bar ) failed"
 fi
-cat > /tmp/ksh$$ <<\!
+cat > $tmp/script <<\!
 if     [[ -p /dev/fd/0 ]]
 then   builtin cat
        cat - > /dev/null
@@ -190,33 +191,30 @@
 else   print no
 fi
 !
-chmod +x /tmp/ksh$$
-case $( (print) | /tmp/ksh$$;:) in
+chmod +x $tmp/script
+case $( (print) | $tmp/script;:) in
 ok)    ;;
 no)    err_exit "[[ -p /dev/fd/0 ]] fails for standard input pipe" ;;
 *)     err_exit "builtin replaces standard input pipe" ;;
 esac
-print 'print $0' > /tmp/ksh$$
-print ". /tmp/ksh$$" > /tmp/ksh$$x
-chmod +x /tmp/ksh$$x
-if     [[ $(/tmp/ksh$$x) != /tmp/ksh$$x ]]
+print 'print $0' > $tmp/script
+print ". $tmp/script" > $tmp/scriptx
+chmod +x $tmp/scriptx
+if     [[ $($tmp/scriptx) != $tmp/scriptx ]]
 then   err_exit '$0 not correct for . script'
 fi
-rm -r /tmp/ksh$$ /tmp/ksh$$x
-mkdir  /tmp/ksh$$ || err_exit "mkdir /tmp/ksh$$ failed" 
-cd /tmp/ksh$$ || err_exit "cd /tmp/ksh$$ failed"
-print ./b > ./a; print ./c > b; print ./d > c; print ./e > d; print "echo 
\"hello there\"" > e 
+cd $tmp || { err_exit "cd $tmp failed"; exit 1; }
+print ./b > ./a; print ./c > b; print ./d > c; print ./e > d; print "echo 
\"hello there\"" > e
 chmod 755 a b c d e
 x=$(./a)
 if     [[ $x != "hello there" ]]
-then   err_exit "nested scripts failed" 
+then   err_exit "nested scripts failed"
 fi
 x=$( (./a) | cat)
 if     [[ $x != "hello there" ]]
-then   err_exit "scripts in subshells fail" 
+then   err_exit "scripts in subshells fail"
 fi
 cd ~- || err_exit "cd back failed"
-rm -r /tmp/ksh$$ || err_exit "rm -r /tmp/ksh$$ failed"
 x=$( (/bin/echo foo) 2> /dev/null )
 if     [[ $x != foo ]]
 then   err_exit "subshell in command substitution fails"
@@ -239,29 +237,29 @@
 if     [[ $x != hello ]]
 then   err_exit "subshell in command substitution with 1 closed fails"
 fi
-cat > /tmp/ksh$$ <<- \!
+cat > $tmp/script <<- \!
 read line 2> /dev/null
 print done
 !
-if     [[ $($SHELL /tmp/ksh$$ <&-) != done ]]
+if     [[ $($SHELL $tmp/script <&-) != done ]]
 then   err_exit "executing script with 0 closed fails"
 fi
 trap '' INT
-cat > /tmp/ksh$$ <<- \!
+cat > $tmp/script <<- \!
 trap 'print bad' INT
 kill -s INT $$
 print good
 !
-chmod +x /tmp/ksh$$
-if     [[ $($SHELL  /tmp/ksh$$) != good ]]
+chmod +x $tmp/script
+if     [[ $($SHELL  $tmp/script) != good ]]
 then   err_exit "traps ignored by parent not ignored"
 fi
 trap - INT
-cat > /tmp/ksh$$ <<- \!
+cat > $tmp/script <<- \!
 read line
 /bin/cat
 !
-if     [[ $($SHELL /tmp/ksh$$ <<!
+if     [[ $($SHELL $tmp/script <<!
 one
 two
 !
@@ -305,7 +303,7 @@
 sleep 20 &
 pids=$!
 if     [[ $(jobs -p) != $! ]]
-then   err_exit 'jobs -p not reporting a background job' 
+then   err_exit 'jobs -p not reporting a background job'
 fi
 sleep 20 &
 pids="$pids $!"
@@ -323,18 +321,17 @@
 command exec 3<> /dev/null
 if     cat /dev/fd/3 >/dev/null 2>&1
 then   [[ $($SHELL -c 'cat <(print foo)' 2> /dev/null) == foo ]] || err_exit 
'process substitution not working'
-       [[ $($SHELL -c 'print $(cat <(print foo) )' 2> /dev/null) == foo ]] || 
err_exit 'process substitution in subshell not working'
-       [[ $($SHELL -c  $'tee >(grep \'1$\' > /tmp/ksh'$$'x) > /dev/null <<-  
\!!!
+       [[ $($SHELL -c  $'tee >(grep \'1$\' > '$tmp/scriptx$') > /dev/null <<-  
\!!!
        line0
        line1
        line2
        !!!
        wait
-       cat /tmp/ksh'$$x 2> /dev/null)  == line1 ]] || err_exit '>() process 
substitution fails'
-       > /tmp/ksh$$x
+       cat '$tmp/scriptx 2> /dev/null)  == line1 ]] || err_exit '>() process 
substitution fails'
+       > $tmp/scriptx
        [[ $($SHELL -c  $'
        for i in 1
-       do      tee >(grep \'1$\' > /tmp/ksh'$$'x) > /dev/null  <<-  \!!!
+       do      tee >(grep \'1$\' > '$tmp/scriptx$') > /dev/null  <<-  \!!!
                line0
                line1
                line2
@@ -341,14 +338,14 @@
                !!!
        done
        wait
-       cat /tmp/ksh'$$x 2>> /dev/null) == line1 ]] || err_exit '>() process 
substitution fails in for loop'
+       cat '$tmp/scriptx 2>> /dev/null) == line1 ]] || err_exit '>() process 
substitution fails in for loop'
        [[ $({ $SHELL -c 'cat <(for i in x y z; do print $i; done)';} 2> 
/dev/null) == $'x\ny\nz' ]] ||
                err_exit 'process substitution of compound commands not working'
 fi
 [[ $($SHELL -r 'command -p :' 2>&1) == *restricted* ]]  || err_exit 'command 
-p not restricted'
-print cat >  /tmp/ksh$$x
-chmod +x /tmp/ksh$$x
-[[ $($SHELL -c "print foo | /tmp/ksh$$x ;:" 2> /dev/null ) == foo ]] || 
err_exit 'piping into script fails'
+print cat >  $tmp/scriptx
+chmod +x $tmp/scriptx
+[[ $($SHELL -c "print foo | $tmp/scriptx ;:" 2> /dev/null ) == foo ]] || 
err_exit 'piping into script fails'
 [[ $($SHELL -c 'X=1;print -r -- ${X:=$(expr "a(0)" : '"'a*(\([^)]\))')}'" 2> 
/dev/null) == 1 ]] || err_exit 'x=1;${x:=$(..."...")} failure'
 [[ $($SHELL -c 'print -r -- ${X:=$(expr "a(0)" : '"'a*(\([^)]\))')}'" 2> 
/dev/null) == 0 ]] || err_exit '${x:=$(..."...")} failure'
 exec 3<&-
@@ -357,19 +354,18 @@
        $SHELL -c '[[ $(for i in 1;do cat <(print hello);done ) == hello ]]' 2> 
/dev/null|| err_exit "process substitution not working in for or while loop"
 fi
 exec 3> /dev/null
-print 'print foo "$@"' > /tmp/ksh$$x
-[[ $( print "(/tmp/ksh$$x bar)" | $SHELL 2>/dev/null) == 'foo bar' ]] || 
err_exit 'script pipe to shell fails'
-print "#! $SHELL" > /tmp/ksh$$x
-print 'print  -- $0' >> /tmp/ksh$$x
-chmod +x /tmp/ksh$$x
-[[ $(/tmp/ksh$$x) == /tmp/ksh$$x ]] || err_exit  "\$0 is $0 instead of 
/tmp/ksh$$x"
-cat > /tmp/ksh$$x <<- \EOF
+print 'print foo "$@"' > $tmp/scriptx
+[[ $( print "($tmp/scriptx bar)" | $SHELL 2>/dev/null) == 'foo bar' ]] || 
err_exit 'script pipe to shell fails'
+print "#! $SHELL" > $tmp/scriptx
+print 'print  -- $0' >> $tmp/scriptx
+chmod +x $tmp/scriptx
+[[ $($tmp/scriptx) == $tmp/scriptx ]] || err_exit  "\$0 is $0 instead of 
$tmp/scriptx"
+cat > $tmp/scriptx <<- \EOF
        myfilter() { x=$(print ok | cat); print  -r -- $SECONDS;}
        set -o pipefail
        sleep 3 | myfilter
 EOF
-(( $($SHELL /tmp/ksh$$x) > 2.0 )) && err_exit 'command substitution causes 
pipefail option to hang'
-rm -f /tmp/ksh$$x
+(( $($SHELL $tmp/scriptx) > 2.0 )) && err_exit 'command substitution causes 
pipefail option to hang'
 exec 3<&-
 ( typeset -r foo=bar) 2> /dev/null || err_exit 'readonly variables set in a 
subshell cannot unset'
 $SHELL -c 'x=${ print hello;}; [[ $x == hello ]]' 2> /dev/null || err_exit '${ 
command;} not supported'
@@ -406,13 +402,8 @@
 EOF
 
 unset foo
-function foo
-{
-       print bar
-}
-[[ ${foo} == bar ]] || err_exit '${foo} is not command substitution when foo 
unset' 
-[[ ! ${f...@]} ]] || err_exit '${f...@]} is not empty when foo is unset' 
-[[ ! ${foo[3]} ]] || err_exit '${foo[3]} is not empty when foo is unset' 
+[[ ! ${f...@]} ]] || err_exit '${f...@]} is not empty when foo is unset'
+[[ ! ${foo[3]} ]] || err_exit '${foo[3]} is not empty when foo is unset'
 [[ $(print  "[${ print foo }]") == '[foo]' ]] || err_exit '${...} not working 
when } is followed by ]'
 [[ $(print  "${ print "[${ print foo }]" }") == '[foo]' ]] || err_exit 'nested 
${...} not working when } is followed by ]'
 unset foo
@@ -421,10 +412,57 @@
 got=$(print -n fore;(sleep 2;print back)&)
 [[ $got == $expected ]] || err_exit "command substitution background process 
output error -- got '$got', expected '$expected'"
 
-for false in false $(whence -p false)
+binfalse=$(whence -p false)
+for false in false $binfalse
 do     x=$($false) && err_exit "x=\$($false) should fail"
        $($false) && err_exit "\$($false) should fail"
        $($false) > /dev/null && err_exit "\$($false) > /dev/null should fail"
 done
-[[ $(env 'x-a=y'  $SHELL -c 'env | grep x-a') == *x-a=y* ]] || err_exit 
'invalid environment variables not preserved'
+if     env x-a=y >/dev/null 2>&1
+then   [[ $(env 'x-a=y'  $SHELL -c 'env | grep x-a') == *x-a=y* ]] || err_exit 
'invalid environment variables not preserved'
+fi
+float s=SECONDS
+sleep=$(whence -p sleep)
+for i in 1 2
+do      print $i
+done | while read sec; do ( $sleep $sec; $sleep $sec) done
+(( (SECONDS-s)  < 4)) && err_exit '"command | while read...done" finishing too 
fast'
+s=SECONDS
+set -o pipefail
+for ((i=0; i < 30; i++))
+do     print hello
+       sleep .1
+done |  $sleep 1
+(( (SECONDS-s) < 2 )) || err_exit 'early termination not causing broken pipe'
+[[ $({ trap 'print trap' 0; print -n | $(whence -p cat); } & wait $!) == trap 
]] || err_exit 'trap on exit not getting triggered'
+var=$({ trap 'print trap' ERR; print -n | $binfalse; } & wait $!)
+[[ $var == trap ]] || err_exit 'trap on ERR not getting triggered'
+
+exp=
+got=$(
+       function fun
+       {
+               $binfalse && echo FAILED
+       }
+       : works if this line deleted : |
+       fun
+       : works if this line deleted :
+)
+[[ $got == $exp ]] || err_exit "pipe to function with conditional fails -- 
expected '$exp', got '$got'"
+got=$(
+       : works if this line deleted : |
+       { $binfalse && echo FAILED; }
+       : works if this line deleted :
+)
+[[ $got == $exp ]] || err_exit "pipe to { ... } with conditional fails -- 
expected '$exp', got '$got'"
+
+got=$(
+       : works if this line deleted : |
+       ( $binfalse && echo FAILED )
+       : works if this line deleted :
+)
+[[ $got == $exp ]] || err_exit "pipe to ( ... ) with conditional fails -- 
expected '$exp', got '$got'"
+
+( $SHELL -c 'trap : DEBUG; x=( $foo); exit 0') 2> /dev/null  || err_exit 'trap 
DEBUG fails'
+
 exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/bracket.sh    Fri Sep 25 06:37:25 2009
+++ new/usr/src/lib/libshell/common/tests/bracket.sh    Fri Sep 25 06:37:23 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -27,17 +27,19 @@
 
 Command=${0##*/}
 integer Errors=0
+
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
 null=''
 if     [[ ! -z $null ]]
 then   err_exit "-z: null string should be of zero length"
 fi
-file=/tmp/regresso$$
-newer_file=/tmp/regressn$$
+file=$tmp/original
+newer_file=$tmp/newer
 if     [[ -z $file ]]
 then   err_exit "-z: $file string should not be of zero length"
 fi
-trap "rm -f $file $newer_file" EXIT
-rm -f $file
 if     [[ -a $file ]]
 then   err_exit "-a: $file shouldn't exist"
 fi
@@ -119,11 +121,11 @@
 if     [[ $file -nt $newer_file ]]
 then   err_exit "$newer_file should be newer than $file"
 fi
-if     [[ $file != /tmp/* ]]
-then   err_exit "$file should match /tmp/*"
+if     [[ $file != $tmp/* ]]
+then   err_exit "$file should match $tmp/*"
 fi
-if     [[ $file = '/tmp/*' ]]
-then   err_exit "$file should not equal /tmp/*"
+if     [[ $file = $tmp'/*' ]]
+then   err_exit "$file should not equal $tmp'/*'"
 fi
 [[ ! ( ! -z $null && ! -z x) ]]        || err_exit "negation and grouping"
 [[ -z '' || -z '' || -z '' ]]  || err_exit "three ors not working"
@@ -211,17 +213,17 @@
        [[ aaaa == {2,5}(a) ]] || err_exit 'aaaa != {2,4}(a)'
        [[ abcdcdabcd == {3,6}(ab|cd) ]] || err_exit 'abcdcdabcd == 
{3,4}(ab|cd)'
        [[ abcdcdabcde == {5}(ab|cd)e ]] || err_exit 'abcdcdabcd == {5}(ab|cd)e'
-) || err_exit 'Errors with {..}(...) patterns'
+) || err_exit 'errors with {..}(...) patterns'
 [[ D290.2003.02.16.temp == D290.+(2003.02.16).temp* ]] || err_exit 'pattern 
match bug with +(...)'
 rm -rf $file
 {
-[[ -N $file ]] && err_exit 'test -N /tmp/*: st_mtime>st_atime after creat'
+[[ -N $file ]] && err_exit 'test -N $tmp/*: st_mtime>st_atime after creat'
 sleep 2
 print 'hello world'
-[[ -N $file ]] || err_exit 'test -N /tmp/*: st_mtime<=st_atime after write'
+[[ -N $file ]] || err_exit 'test -N $tmp/*: st_mtime<=st_atime after write'
 sleep 2
 read
-[[ -N $file ]] && err_exit 'test -N /tmp/*: st_mtime>st_atime after read'
+[[ -N $file ]] && err_exit 'test -N $tmp/*: st_mtime>st_atime after read'
 } > $file < $file
 if     rm -rf "$file" && ln -s / "$file"
 then   [[ -L "$file" ]] || err_exit '-L not working'
@@ -242,4 +244,80 @@
 test '(' = ')' && err_exit '"test ( = )" should not be true'
 [[ $($SHELL -c 'case  F in ~(Eilr)[a-z0-9#]) print ok;;esac' 2> /dev/null) == 
ok ]] || err_exit '~(Eilr) not working in case command'
 [[ $($SHELL -c "case  Q in ~(Fi)q |  \$'\E') print ok;;esac" 2> /dev/null) == 
ok ]] || err_exit '~(Fi)q | \E  not working in case command'
+
+for l in C en_US.ISO8859-15
+do     [[ $($SHELL -c "LC_COLLATE=$l" 2>&1) ]] && continue
+       export LC_COLLATE=$l
+       set -- \
+               'A'   0 1 1   0 1 1      1 0 0   1 0 0   \
+               'Z'   0 1 1   0 1 1      1 0 0   1 0 0   \
+               '/'   0 0 0   0 0 0      1 1 1   1 1 1   \
+               '.'   0 0 0   0 0 0      1 1 1   1 1 1   \
+               '_'   0 0 0   0 0 0      1 1 1   1 1 1   \
+               '-'   1 1 1   1 1 1      0 0 0   0 0 0   \
+               '%'   0 0 0   0 0 0      1 1 1   1 1 1   \
+               '@'   0 0 0   0 0 0      1 1 1   1 1 1   \
+               '!'   0 0 0   0 0 0      1 1 1   1 1 1   \
+               '^'   0 0 0   0 0 0      1 1 1   1 1 1   \
+               # retain this line #
+       while   (( $# >= 13 ))
+       do      c=$1
+               shift
+               for p in \
+                       '[![.-.]]' \
+                       '[![.-.][:upper:]]' \
+                       '[![.-.]A-Z]' \
+                       '[!-]' \
+                       '[!-[:upper:]]' \
+                       '[!-A-Z]' \
+                       '[[.-.]]' \
+                       '[[.-.][:upper:]]' \
+                       '[[.-.]A-Z]' \
+                       '[-]' \
+                       '[-[:upper:]]' \
+                       '[-A-Z]' \
+                       # retain this line #
+               do      e=$1
+                       shift
+                       [[ $c == $p ]]
+                       g=$?
+                       [[ $g == $e ]] || err_exit "[[ '$c' == $p ]] for 
LC_COLLATE=$l failed -- expected $e, got $g"
+               done
+       done
+done
+integer n
+if     ( : < /dev/tty ) 2>/dev/null && exec {n}< /dev/tty
+then   [[ -t  $n ]] || err_exit "[[ -t  n ]] fails when n > 9"
+fi
+foo=([1]=a [2]=b [3]=c)
+[[ -v foo[1] ]] ||  err_exit 'foo[1] should be set'
+[[ ${foo[1]+x} ]] ||  err_exit '${foo[1]+x} should be x'
+[[ ${f...@]+x} ]] ||  err_exit '${f...@]+x} should be x'
+unset foo[1]
+[[ -v foo[1] ]] && err_exit 'foo[1] should not be set'
+[[ ${foo[1]+x} ]] &&  err_exit '${foo[1]+x} should be empty'
+bar=(a b c)
+[[ -v bar[1] ]]  || err_exit 'bar[1] should be set'
+[[ ${bar[1]+x} ]] ||  err_exit '${foo[1]+x} should be x'
+unset bar[1]
+[[ ${bar[1]+x} ]] &&  err_exit '${foo[1]+x} should be empty'
+[[ -v bar ]] || err_exit 'bar should be set'
+[[ -v bar[1] ]] && err_exit 'bar[1] should not be set'
+integer z=( 1 2 4)
+[[ -v z[1] ]] || err_exit 'z[1] should be set'
+unset z[1]
+[[ -v z[1] ]] && err_exit 'z[1] should not be set'
+typeset -si y=( 1 2 4)
+[[ -v y[6] ]] && err_exit 'y[6] should not be set'
+[[ -v y[1] ]] ||  err_exit  'y[1] should be set'
+unset y[1]
+[[ -v y[1] ]] && err_exit 'y[1] should not be set'
+x=abc
+[[ -v x[0] ]] || err_exit  'x[0] should be set'
+[[ ${x[0]+x} ]] || err_exit print  '${x[0]+x} should be x'
+[[ -v x[3] ]] && err_exit 'x[3] should not be set'
+[[ ${x[3]+x} ]] && err_exit  '${x[0]+x} should be Empty'
+unset x
+[[ $...@]+x} ]] && err_exit  '$...@]+x} should be Empty'
+unset x y z foo bar
 exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/builtins.sh   Fri Sep 25 06:37:28 2009
+++ new/usr/src/lib/libshell/common/tests/builtins.sh   Fri Sep 25 06:37:26 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -25,9 +25,13 @@
 }
 alias err_exit='err_exit $LINENO'
 
-# test shell builtin commands
 Command=${0##*/}
 integer Errors=0
+
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
+# test shell builtin commands
 builtin getconf
 : ${foo=bar} || err_exit ": failed"
 [[ $foo = bar ]] || err_exit ": side effects failed"
@@ -171,30 +175,31 @@
 then   err_exit        'command -v not working'
 fi
 read -r var <<\!
-       
+
 !
 if     [[ $var != "" ]]
 then   err_exit "read -r of blank line not working"
 fi
-mkdir -p /tmp/ksh$$/a/b/c 2>/dev/null || err_exit  "mkdir -p failed"
-$SHELL -c "cd /tmp/ksh$$/a/b; cd c" 2>/dev/null || err_exit "initial script 
relative cd fails"
-rm -r /tmp/ksh$$ || err_exit "rm -r /tmp/ksh$$ failed"
-trap 'print HUP' HUP
-if     [[ $(trap) != "trap -- 'print HUP' HUP" ]]
-then   err_exit '$(trap) not working'
-fi
-if     [[ $(trap -p HUP) != 'print HUP' ]]
-then   err_exit '$(trap -p HUP) not working'
-fi
+mkdir -p $tmp/a/b/c 2>/dev/null || err_exit  "mkdir -p failed"
+$SHELL -c "cd $tmp/a/b; cd c" 2>/dev/null || err_exit "initial script relative 
cd fails"
+
+trap 'print TERM' TERM
+exp=$'trap -- \'print TERM\' TERM\ntrap -- \'cd /; rm -rf '$tmp$'\' EXIT'
+got=$(trap)
+[[ $got == $exp ]] || err_exit "\$(trap) failed -- expected \"$exp\", got 
\"$got\""
+exp='print TERM'
+got=$(trap -p TERM)
+[[ $got == $exp ]] || err_exit "\$(trap -p TERM) failed -- expected \"$exp\", 
got \"$got\""
+
 [[ $($SHELL -c 'trap "print ok" SIGTERM; kill -s SIGTERM $$' 2> /dev/null) == 
ok ]] || err_exit 'SIGTERM not recognized'
 [[ $($SHELL -c 'trap "print ok" sigterm; kill -s sigterm $$' 2> /dev/null) == 
ok ]] || err_exit 'SIGTERM not recognized'
 [[ $($SHELL -c '( trap "" TERM);kill $$;print bad' == bad) ]] 2> /dev/null && 
err_exit 'trap ignored in subshell causes it to be ignored by parent'
 ${SHELL} -c 'kill -1 -$$' 2> /dev/null
-[[ $(kill -l $?) == HUP ]] || err_exit 'kill -1 -pid not working' 
+[[ $(kill -l $?) == HUP ]] || err_exit 'kill -1 -pid not working'
 ${SHELL} -c 'kill -1 -$$' 2> /dev/null
-[[ $(kill -l $?) == HUP ]] || err_exit 'kill -n1 -pid not working' 
+[[ $(kill -l $?) == HUP ]] || err_exit 'kill -n1 -pid not working'
 ${SHELL} -c 'kill -s HUP -$$' 2> /dev/null
-[[ $(kill -l $?) == HUP ]] || err_exit 'kill -HUP -pid not working' 
+[[ $(kill -l $?) == HUP ]] || err_exit 'kill -HUP -pid not working'
 n=123
 typeset -A base
 base[o]=8#
@@ -266,23 +271,23 @@
 if     [[ $(getopts  $'[+?X\ffoobar\fX]' v --man 2>&1) != *'Xhello world'X* ]]
 then   err_exit '\f...\f not working in getopts usage strings'
 fi
-if     [[      $(printf '%H\n' $'<>"& \'\tabc') != 
'&lt;&gt;&quot;&amp;&nbsp;&apos;&#9;abc' ]]
+if     [[ $(printf '%H\n' $'<>"& \'\tabc') != 
'&lt;&gt;&quot;&amp;&nbsp;&apos;&#9;abc' ]]
 then   err_exit 'printf %H not working'
 fi
-if     [[      $(printf '%R %R %R %R\n' 'a.b' '*.c' '^'  '!(*.*)') != '^a\.b$ 
\.c$ ^\^$ ^(.*\..*)!$' ]]
+if     [[ $(printf '%R %R %R %R\n' 'a.b' '*.c' '^'  '!(*.*)') != '^a\.b$ \.c$ 
^\^$ ^(.*\..*)!$' ]]
 then   err_exit 'printf %R not working'
 fi
 if     [[ $(printf '%..:c\n' abc) != a:b:c ]]
-then   err_exit        "printf '%..:c' not working"
+then   err_exit "printf '%..:c' not working"
 fi
 if     [[ $(printf '%..*c\n' : abc) != a:b:c ]]
-then   err_exit        "printf '%..*c' not working"
+then   err_exit "printf '%..*c' not working"
 fi
 if     [[ $(printf '%..:s\n' abc def ) != abc:def ]]
-then   err_exit        "printf '%..:s' not working"
+then   err_exit "printf '%..:s' not working"
 fi
 if     [[ $(printf '%..*s\n' : abc def) != abc:def ]]
-then   err_exit        "printf '%..*s' not working"
+then   err_exit "printf '%..*s' not working"
 fi
 [[ $(printf '%q\n') == '' ]] || err_exit 'printf "%q" with missing arguments'
 # we won't get hit by the one second boundary twice, right?
@@ -296,12 +301,18 @@
 }
 print $'line1\nline2' | behead
 if     [[ $left != line2 ]]
-then   err_exit  "read reading ahead on a pipe"
+then   err_exit "read reading ahead on a pipe"
 fi
-print -n $'{ read -r line;print $line;}\nhello' > /tmp/ksh$$
-chmod 755 /tmp/ksh$$
-trap 'rm -rf /tmp/ksh$$' EXIT
-if     [[ $($SHELL < /tmp/ksh$$) != hello ]]
+read -n1 y <<!
+abc
+!
+exp=a
+if      [[ $y != $exp ]]
+then    err_exit "read -n1 failed -- expected '$exp', got '$y'"
+fi
+print -n $'{ read -r line;print $line;}\nhello' > $tmp/script
+chmod 755 $tmp/script
+if     [[ $($SHELL < $tmp/script) != hello ]]
 then   err_exit 'read of incomplete line not working correctly'
 fi
 set -f
@@ -321,19 +332,13 @@
 (( $? == 1 )) || err_exit "wait not saving exit value"
 wait $pid2
 (( $? == 127 )) || err_exit "subshell job known to parent"
-set --noglob
-ifs=$IFS
-IFS=,
-set -- $(getconf LIBPATH)
-IFS=$ifs
 env=
-for v
-do     IFS=:
-       set -- $v
-       IFS=$ifs
-       eval [[ \$$2 ]] && env="$env $2=\"\$$2\""
+v=$(getconf LIBPATH)
+for v in ${v//,/ }
+do     v=${v#*:}
+       v=${v%%:*}
+       eval [[ \$$v ]] && env="$env $v=\"\$$v\""
 done
-set --glob
 if     [[ $(foo=bar; eval foo=\$foo $env exec -c \$SHELL -c \'print \$foo\') 
!= bar ]]
 then   err_exit '"name=value exec -c ..." not working'
 fi
@@ -364,7 +369,7 @@
                err=$(printf "$fmt" "$arg" 2>&1 >/dev/null)
                printf "$fmt" "$arg" >/dev/null 2>&1
                ret=$?
-               [[ $out == $val ]] || err_exit "printf $fmt $arg failed -- 
expected $val, got $out"
+               [[ $out == $val ]] || err_exit "printf $fmt $arg failed -- 
expected '$val', got '$out'"
                if      (( $code ))
                then    [[ $err ]] || err_exit "printf $fmt $arg failed, error 
message expected"
                else    [[ $err ]] && err_exit "$err: printf $fmt $arg failed, 
error message not expected -- got '$err'"
@@ -398,6 +403,50 @@
        *)      err_exit "getopts $options failed -- got flag $opt" ;;
        esac
 done
+
+unset a
+{ read -N3 a; read -N1 b;}  <<!
+abcdefg
+!
+exp=abc
+[[ $a == $exp ]] || err_exit "read -N3 here-document failed -- expected 
'$exp', got '$a'"
+exp=d
+[[ $b == $exp ]] || err_exit "read -N1 here-document failed -- expected 
'$exp', got '$b'"
+read -n3 a <<!
+abcdefg
+!
+exp=abc
+[[ $a == $exp ]] || err_exit "read -n3 here-document failed -- expected 
'$exp', got '$a'"
+#(print -n a;sleep 1; print -n bcde) | { read -N3 a; read -N1 b;}
+#[[ $a == $exp ]] || err_exit "read -N3 from pipe failed -- expected '$exp', 
got '$a'"
+#exp=d
+#[[ $b == $exp ]] || err_exit "read -N1 from pipe failed -- expected '$exp', 
got '$b'"
+#(print -n a;sleep 1; print -n bcde) | read -n3 a
+#exp=a
+#[[ $a == $exp ]] || err_exit "read -n3 from pipe failed -- expected '$exp', 
got '$a'"
+#rm -f $tmp/fifo
+#if    mkfifo $tmp/fifo 2> /dev/null
+#then  (print -n a; sleep 1;print -n bcde)  > $tmp/fifo &
+#      {
+#      read -u5 -n3 -t2 a || err_exit 'read -n3 from fifo timedout'
+#      read -u5 -n1 -t2 b || err_exit 'read -n1 from fifo timedout'
+#      } 5< $tmp/fifo
+#      exp=a
+#      [[ $a == $exp ]] || err_exit "read -n3 from fifo failed -- expected 
'$exp', got '$a'"
+#      rm -f $tmp/fifo
+#      mkfifo $tmp/fifo 2> /dev/null
+#      (print -n a; sleep 1;print -n bcde) > $tmp/fifo &
+#      {
+#      read -u5 -N3 -t2 a || err_exit 'read -N3 from fifo timed out'
+#      read -u5 -N1 -t2 b || err_exit 'read -N1 from fifo timedout'
+#      } 5< $tmp/fifo
+#      exp=abc
+#      [[ $a == $exp ]] || err_exit "read -N3 from fifo failed -- expected 
'$exp', got '$a'"
+#      exp=d
+#      [[ $b == $exp ]] || err_exit "read -N1 from fifo failed -- expected 
'$exp', got '$b'"
+#fi
+#rm -f $tmp/fifo
+
 function longline
 {
        integer i
@@ -437,33 +486,43 @@
 [[ $($SHELL -c 'echo -3') == -3 ]] || err_exit "echo -3 not working in ucb 
universe"
 typeset -F3 start_x=SECONDS total_t delay=0.02
 typeset reps=50 leeway=5
-sleep $(( 2 * leeway * reps * delay )) |
-for (( i=0 ; i < reps ; i++ )) 
-do     read -N1 -t $delay
-done
-(( total_t = SECONDS - start_x ))
-if     (( total_t > leeway * reps * delay ))
-then   err_exit "read -t in pipe taking $total_t secs - $(( reps * delay )) 
minimum - too long" 
-elif   (( total_t < reps * delay ))
-then   err_exit "read -t in pipe taking $total_t secs - $(( reps * delay )) 
minimum - too fast" 
-fi
-$SHELL -c 'sleep $(printf "%a" .95)' 2> /dev/null || err_exit "sleep doesn't 
except %a format constants"
-$SHELL -c 'test \( ! -e \)' 2> /dev/null ; [[ $? == 1 ]] || err_exit 'test \( 
! -e \) not working'
+#sleep $(( 2 * leeway * reps * delay )) |
+#for (( i=0 ; i < reps ; i++ ))
+#do    read -N1 -t $delay
+#done
+#(( total_t = SECONDS - start_x ))
+#if    (( total_t > leeway * reps * delay ))
+#then  err_exit "read -t in pipe taking $total_t secs - $(( reps * delay )) 
minimum - too long"
+#elif  (( total_t < reps * delay ))
+#then  err_exit "read -t in pipe taking $total_t secs - $(( reps * delay )) 
minimum - too fast"
+#fi
+#$SHELL -c 'sleep $(printf "%a" .95)' 2> /dev/null || err_exit "sleep doesn't 
except %a format constants"
+#$SHELL -c 'test \( ! -e \)' 2> /dev/null ; [[ $? == 1 ]] || err_exit 'test \( 
! -e \) not working'
 [[ $(ulimit) == "$(ulimit -fS)" ]] || err_exit 'ulimit is not the same as 
ulimit -fS'
-tmpfile=${TMP-/tmp}/ksh$$.2
-trap 'rm -f /tmp/ksh$$ "$tmpfile"' EXIT
+tmpfile=$tmp/file.2
 print $'\nprint -r -- "${.sh.file} ${LINENO} ${.sh.lineno}"' > $tmpfile
 [[ $( . "$tmpfile") == "$tmpfile 2 1" ]] || err_exit 'dot command not working'
 print -r -- "'xxx" > $tmpfile
 [[ $($SHELL -c ". $tmpfile"$'\n print ok' 2> /dev/null) == ok ]] || err_exit 
'syntax error in dot command affects next command'
 
-float sec=$SECONDS del=4
-exec 3>&2 2>/dev/null
-$SHELL -c "( sleep 1; kill -ALRM \$\$ ) & sleep $del" 2> /dev/null
-exitval=$?
-(( sec = SECONDS - sec ))
-exec 2>&3-
-(( exitval )) && err_exit "sleep doesn't exit 0 with ALRM interupt"
-(( sec > (del - 1) )) || err_exit "ALRM signal causes sleep to terminate 
prematurely -- expected 3 sec, got $sec"
+#float sec=$SECONDS del=4
+#exec 3>&2 2>/dev/null
+#$SHELL -c "( sleep 1; kill -ALRM \$\$ ) & sleep $del" 2> /dev/null
+#exitval=$?
+#(( sec = SECONDS - sec ))
+#exec 2>&3-
+#(( exitval )) && err_exit "sleep doesn't exit 0 with ALRM interupt"
+#(( sec > (del - 1) )) || err_exit "ALRM signal causes sleep to terminate 
prematurely -- expected 3 sec, got $sec"
+typeset -r z=3
+y=5
+for i in 123 z  %x a.b.c
+do     ( unset $i)  2>/dev/null && err_exit "unset $i should fail"
+done
+a=()
+for i in y y  y[8] t[abc] y.d a.b  a
+do     unset $i ||  print -u2  "err_exit unset $i should not fail"
+done
+[[ $($SHELL -c 'y=3; unset 123 y;print $?$y') == 1 ]] 2> /dev/null ||  
err_exit 'y is not getting unset with unset 123 y'
+[[ $($SHELL -c 'trap foo TERM; (trap;(trap) )') == 'trap -- foo TERM' ]] || 
err_exit 'traps not getting reset when subshell is last process'
 
 exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/case.sh       Fri Sep 25 06:37:31 2009
+++ new/usr/src/lib/libshell/common/tests/case.sh       Fri Sep 25 06:37:29 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
--- old/usr/src/lib/libshell/common/tests/comvar.sh     Fri Sep 25 06:37:34 2009
+++ new/usr/src/lib/libshell/common/tests/comvar.sh     Fri Sep 25 06:37:32 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -85,7 +85,7 @@
 if     [[ ${foo} != *x=3* ]]
 then   err_exit "compound variable with integer subvariable not working"
 fi
-$SHELL -c $'x=(foo=bar)\n[[ x == x ]]' 2> /dev/null || 
+$SHELL -c $'x=(foo=bar)\n[[ x == x ]]' 2> /dev/null ||
        err_exit '[[ ... ]] not working after compound assignment'
 unset foo
 [[ ${!f...@} ]] && err_exit 'unset compound variable leaves subvariables'
@@ -194,7 +194,7 @@
 [[ $($SHELL -c 'foo=();foo.[x]=(y z); print ${foo...@]}') == 'y z' ]] 2> 
/dev/null || err_exit 'foo=( [x]=(y z)  not working'
 function staticvar
 {
-       if      [[ $1 ]] 
+       if      [[ $1 ]]
        then    print -r -- "$point"
                return
        fi
@@ -291,7 +291,7 @@
 )
 eval foo2="$foo"
 foo2.hello=notok foo2.yes.yex=no foo2.extra=yes.
-typeset -C bar bam 
+typeset -C bar bam
 {
        read -Cu3 bar
        read -Cu3 bam
@@ -422,5 +422,120 @@
        command2="grrrr2"
 )
 
-[[ $data == %(()) ]] || err_exit "unbalanced parenthesis with compound 
variable containing array of compound variables" 
+[[ $data == %(()) ]] || err_exit "unbalanced parenthesis with compound 
variable containing array of compound variables"
+typeset -C  -A hello=( [foo]=bar)
+[[ $(typeset -p hello) == 'typeset -C -A hello=([foo]=bar)' ]] || err_exit 
'typeset -A -C with intial assignment not working'
+# this caused a core dump before ksh93t+
+[[ $($SHELL -c 'foo=(x=3 y=4);function bar { typeset z=4;: $z;};bar;print 
${!f...@}') == 'foo.x foo.y' ]] 2> /dev/null || err_exit '${!f...@} after 
function not working'
+
+function foo
+{
+       typeset tmp
+       read -C tmp
+       read -C tmp
+}
+foo 2> /dev/null <<-  \EOF ||  err_exit 'deleting compound variable in 
function failed'
+       (
+               typeset -A myarray3=(
+                       [a]=( foo=bar)
+                       [b]=( foo=bar)
+                       [c d]=( foo=bar)
+                       [e]=( foo=bar)
+                       [f]=( foo=bar)
+                       [g]=( foo=bar)
+                       [h]=( foo=bar)
+                       [i]=( foo=bar)
+                       [j]=( foo=bar)
+               )
+       )
+       hello
+EOF
+
+typeset -C -a mica01
+mica01[4]=( a_string="foo bar" )
+typeset -C more_content=(
+       some_stuff="hello"
+)
+mica01[4]+=more_content
+expected=$'typeset -C -a mica01=([4]=(a_string=\'foo bar\';some_stuff=hello;))'
+[[ $(typeset -p mica01) == "$expected" ]] || err_exit 'appened to indexed 
array compound variable not working'
+
+unset x
+compound x=( integer x ; )
+[[ ! -v x.x ]] && err_exit 'x.x should be set'
+expected=$'(\n\ttypeset -l -i x=0\n)'
+[[ $(print -v x) == "$expected" ]] || err_exit "'print -v x' should be 
$expected"
+
+typeset -C -A hello19=(
+       [19]=(
+               one="xone 19"
+               two="xtwo 19"
+       )
+       [23]=(
+               one="xone 23"
+               two="xtwo 23"
+       )
+)
+expected="typeset -C -A hello19=([19]=(one='xone 19';two='xtwo 19';) 
[23]=(one='xone 23';two='xtwo 23';))"
+[[ $(typeset -p hello19) == "$expected" ]] || print -u2 'typeset -p hello19 
incorrect'
+expected=$'(\n\tone=\'xone 19\'\n\ttwo=\'xtwo 19\'\n) (\n\tone=\'xone 
23\'\n\ttwo=\'xtwo 23\'\n)'
+[[ ${hello...@]} == "$expected" ]] || print -u2 '${hello...@]} incorrect'
+
+typeset -C -A foo1=( abc="alphabet" ) foo2=( abc="alphabet" )
+function add_one
+{
+       nameref left_op=$1
+       typeset -C info
+       info.hello="world"
+       nameref x=info
+       left_op+=x
+}
+nameref node1="foo1[1234]"
+add_one "node1"
+add_one "foo2[1234]"
+[[ "${foo1[1234]}" == "${foo2[1234]}" ]] || err_exit "test failed\n$(diff -u 
<( print -r -- "${foo1[1234]}") <(print -r -- "${foo2[1234]}"))."
+
+typeset -C tree
+function f1
+{
+        nameref tr=$1
+        typeset -A tr.subtree
+        typeset -C node
+        node.one="hello"
+        node.two="world"
+        
+        # move local note into the array
+        typeset -m tr.subtree["a_node"]=node
+}
+f1 tree
+expected=$'(\n\ttypeset -A 
subtree=(\n\t\t[a_node]=(\n\t\t\tone=hello\n\t\t\ttwo=world\n\t\t)\n\t)\n)'
+[[ $tree == "$expected" ]] ||  err_exit 'move of compound local variable to 
global variable not working'
+
+typeset -C -A array
+float array[12].amount=2.9 
+expected='typeset -C -A array=([12]=(typeset -l -E amount=2.9;))'
+[[ $(typeset -p array) == "$expected" ]] || err_exit 'typeset with compound  
variable with compound variable array not working'
+
+typeset -T foo_t=(
+        function diff
+        {
+               print 1.0
+                return 0
+        }
+)
+foo_t sw
+compound output=(
+        integer one=1
+        float mydiff=sw.diff
+        float end=.314
+)
+[[ $output == *end=* ]] ||  err_exit "The field 'name' end is missing"
+
+compound cpv1=( integer f=2 ) 
+compound x=(
+       integer a=1
+       compound b=cpv1 
+) 
+[[ $x == *f=2* ]] ||  err_exit "The field b containg 'f=2' is missing"
+
 exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/coprocess.sh  Fri Sep 25 06:37:37 2009
+++ new/usr/src/lib/libshell/common/tests/coprocess.sh  Fri Sep 25 06:37:35 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -29,6 +29,9 @@
 Command=${0##*/}
 integer Errors=0
 
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
 if     [[ -d /cygdrive ]]
 then   err_exit cygwin detected - coprocess tests disabled - enable at the 
risk of wedging your system
        exit $((Errors))
@@ -46,11 +49,11 @@
 cat |&
 print -p "hello"
 read -p line
-[[ $line == hello ]] || err_exit 'coprocessing fails' 
+[[ $line == hello ]] || err_exit 'coprocessing fails'
 exec 5>&p 6<&p
 print -u5 'hello again' || err_exit 'write on u5 fails'
 read -u6 line
-[[ $line == 'hello again' ]] || err_exit 'coprocess after moving fds fails' 
+[[ $line == 'hello again' ]] || err_exit 'coprocess after moving fds fails'
 exec 5<&- 6<&-
 wait $!
 
@@ -87,8 +90,7 @@
 done
 kill $(jobs -p) 2>/dev/null
 
-file=/tmp/regress$$
-trap "rm -f $file" EXIT
+file=$tmp/regress
 cat > $file  <<\!
 /bin/cat |&
 !
@@ -100,15 +102,24 @@
 kill $(jobs -p) 2>/dev/null
 
 ${SHELL-ksh} |&
-print -p  $'print hello | cat\nprint Done'
+cop=$!
+exp=Done
+print -p $'print hello | cat\nprint '$exp
 read -t 5 -p
 read -t 5 -p
-if     [[ $REPLY != Done ]]
-then   err_exit "${SHELL-ksh} coprocess not working"
+got=$REPLY
+if     [[ $got != $exp ]]
+then   err_exit "${SHELL-ksh} coprocess io failed -- got '$got', expected 
'$exp'"
 fi
 exec 5<&p 6>&p
 exec 5<&- 6>&-
-wait $!
+{ sleep 4; kill $cop; } 2>/dev/null &
+spy=$!
+if     wait $cop 2>/dev/null
+then   kill $spy 2>/dev/null
+else   err_exit "coprocess hung after 'exec 5<&p 6>&p; exec 5<&- 6>&-'"
+fi
+wait
 
 {
 echo line1 | grep 'line2'
@@ -123,7 +134,7 @@
 fi
 wait $!
 
-( sleep 3 |& sleep 1 && kill $!; sleep 1; sleep 3 |& sleep 1 && kill $! ) || 
+( sleep 3 |& sleep 1 && kill $!; sleep 1; sleep 3 |& sleep 1 && kill $! ) ||
        err_exit "coprocess cleanup not working correctly"
 { : |& } 2>/dev/null ||
        err_exit "subshell coprocess lingers in parent"
@@ -163,7 +174,7 @@
        print -u6 ok
        exec 6>&-
        sleep 1
-       kill $! 2> /dev/null 
+       kill $! 2> /dev/null
 ) && err_exit 'coprocess with subshell would hang'
 for sig in IOT ABRT
 do     if      ( trap - $sig ) 2> /dev/null
@@ -178,7 +189,7 @@
                                        kill -$sig $$
                                        kill $pid
                                        sleep 2
-                                       kill  $$
+                                       kill $$
                                ) &
                                read -p
                        ++EOF++
@@ -206,7 +217,7 @@
 trap 'sleep_pid=; kill $pid; err_exit "coprocess 2 hung"' TERM
 { sleep 5; kill $$; } &
 sleep_pid=$!
-cat |& 
+cat |&
 pid=$!
 print foo >&p 2> /dev/null || err_exit 'first write of foo to coprocess failed'
 print foo >&p 2> /dev/null || err_exit 'second write of foo to coprocess 
failed'
@@ -218,7 +229,7 @@
 trap 'sleep_pid=; kill $pid; err_exit "coprocess 3 hung"' TERM
 { sleep 5; kill $$; } &
 sleep_pid=$!
-cat |& 
+cat |&
 pid=$!
 print -p foo
 print -p bar
@@ -231,4 +242,72 @@
 trap - TERM
 [[ $sleep_pid ]] && kill $sleep_pid
 
+exp=ksh
+got=$(print -r $'#00315
+COATTRIBUTES=\'label=make \'
+# @(#)$Id: libcoshell (AT&T Research) 2008-04-28 $
+_COSHELL_msgfd=5
+{ { (eval \'function fun { trap \":\" 0; return 1; }; trap \"exit 0\" 0; fun; 
exit 1\') && PATH= print -u$_COSHELL_msgfd ksh; } || { times && echo bsh 
>&$_COSHELL_msgfd; } || { echo osh >&$_COSHELL_msgfd; }; } >/dev/null 2>&1' | 
$SHELL 5>&1)
+[[ $got == $exp ]] || err_exit "coshell(3) identification sequence failed -- 
expected '$exp', got '$got'"
+
+function cop
+{
+       read
+       print ok
+}
+
+exp=ok
+
+cop |&
+pid=$!
+if     print -p yo 2>/dev/null
+then   read -p got
+else   got='no coprocess'
+fi
+[[ $got == $exp ]] || err_exit "main coprocess main query failed -- expected 
$exp, got '$got'"
+kill $pid 2>/dev/null
+wait
+
+cop |&
+pid=$!
+(
+if     print -p yo 2>/dev/null
+then   read -p got
+else   got='no coprocess'
+fi
+[[ $got == $exp ]] || err_exit "main coprocess subshell query failed -- 
expected $exp, got '$got'"
+)
+kill $pid 2>/dev/null
+wait
+
+exp='no coprocess'
+
+(
+cop |&
+print $! > $tmp/pid
+)
+pid=$(<$tmp/pid)
+if     print -p yo 2>/dev/null
+then   read -p got
+else   got=$exp
+fi
+[[ $got == $exp ]] || err_exit "subshell coprocess main query failed -- 
expected $exp, got '$got'"
+kill $pid 2>/dev/null
+wait
+
+(
+cop |&
+print $! > $tmp/pid
+)
+pid=$(<$tmp/pid)
+(
+if     print -p yo 2>/dev/null
+then   read -p got
+else   got=$exp
+fi
+[[ $got == $exp ]] || err_exit "subshell coprocess subshell query failed -- 
expected $exp, got '$got'"
+kill $pid 2>/dev/null
+wait
+)
+
 exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/cubetype.sh   Fri Sep 25 06:37:39 2009
+++ new/usr/src/lib/libshell/common/tests/cubetype.sh   Fri Sep 25 06:37:38 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -120,7 +120,7 @@
 for ((i=0; i < n; i++))
 do
 Box_t b=(name=box2)
-[[ ${b.name} == box2 ]] || err_exit "\${b.name} incorrect -- expected box2, 
got '${b.name}'" 
+[[ ${b.name} == box2 ]] || err_exit "\${b.name} incorrect -- expected box2, 
got '${b.name}'"
 (( b.len == 5 )) || err_exit "b.len incorrect for box2 -- expected 5, got '$(( 
b.len ))'"
 (( b.count == 1 )) || err_exit "b.count incorrect -- expected 1, got '$(( 
b.count ))'"
 Cube_t c=(name=cube1)
@@ -134,7 +134,7 @@
 (( c.count == 2 )) || err_exit 'c.count != 2'
 (( c.count == b.count )) || err_exit 'c.count != b.count'
 c.count=0
-Cube_t d=c 
+Cube_t d=c
 [[ $d == "$c" ]] || err_exit '$d != $c'
 eval "Cube_t zzz=$c"
 [[ $zzz == "$c" ]] || err_exit '$zzz != $c'
@@ -149,6 +149,7 @@
 do
 Cube_t cc
 cc[2]=(x=2 y=3 name=two colors+=([table]=white) items+=(pencil) z=6)
+[[ ${cc[0].x} == 8 ]] || err_exit 'cc[0].x !=8'
 [[ ${cc[2].y} == 3 ]] || err_exit '${cc[2].y} != 3'
 (( cc[2].y == 3 )) || err_exit '(( cc[2].y != 3))'
 [[ ${cc[2].colors[table]} == white ]] || err_exit '${cc[2].colors[table]} != 
white'
@@ -162,7 +163,7 @@
 (( cc[2].len == cc.len )) || err_exit 'cc[2].len != cc.len'
 (( cc[2].count == 6 )) || err_exit 'cc[2].count != 6'
 unset cc[2].name cc[2].colors cc[2].items
-[[ $cc == "${cc[2]}" ]] || err_exit '$cc != ${cc[2]}' 
+[[ $cc == "${cc[2]}" ]] || err_exit '$cc != ${cc[2]}'
 cc.count=0
 unset cc
 Cube_t -A cc
@@ -181,7 +182,7 @@
 (( cc[two].len == cc[one].len )) || err_exit 'cc[two].len != cc[one].len'
 (( cc[two].count == 4 )) || err_exit 'cc[two].count != 4'
 unset cc[two].name unset cc[two].colors cc[two].items
-[[ ${cc[one]} == "${cc[two]}" ]] || err_exit '${cc[one]} != ${cc[two]}' 
+[[ ${cc[one]} == "${cc[two]}" ]] || err_exit '${cc[one]} != ${cc[two]}'
 cc[two].count=0
 unset cc
 Cube_t cc=(
--- old/usr/src/lib/libshell/common/tests/enum.sh       Fri Sep 25 06:37:42 2009
+++ new/usr/src/lib/libshell/common/tests/enum.sh       Fri Sep 25 06:37:41 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -43,8 +43,8 @@
 [[ $x == orange ]] || err_exit '$x is no longer orange'
 Color_t -A y
 y[foo]=yellow
-[[ ${y[foo]} == yellow ]] || err_exit '${y[foo]} != yellow' 
-(( y[foo] == 4 )) || err_exit '(( y[foo] != 4))' 
+[[ ${y[foo]} == yellow ]] || err_exit '${y[foo]} != yellow'
+(( y[foo] == 4 )) || err_exit '(( y[foo] != 4))'
 unset y
 typeset -a [Color_t] z
 z[green]=xyz
--- old/usr/src/lib/libshell/common/tests/exit.sh       Fri Sep 25 06:37:45 2009
+++ new/usr/src/lib/libshell/common/tests/exit.sh       Fri Sep 25 06:37:43 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -25,6 +25,12 @@
 }
 alias err_exit='err_exit $LINENO'
 
+Command=${0##*/}
+integer Errors=0
+
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
 function abspath
 {
         base=$(basename $SHELL)
@@ -34,12 +40,9 @@
         print $newdir/$base
 }
 #test for proper exit of shell
-Command=${0##*/}
-integer Errors=0
 builtin getconf
 ABSHELL=$(abspath)
-mkdir /tmp/ksh$$ || err_exit "mkdir /tmp/ksh$$ failed"
-cd /tmp/ksh$$ || err_exit "cd /tmp/ksh$$ failed"
+cd $tmp || { err_exit "cd $tmp failed"; exit 1; }
 print exit 0 >.profile
 ${ABSHELL}  <<!
 HOME=$PWD \
@@ -46,16 +49,11 @@
 PATH=$PATH \
 SHELL=$ABSSHELL \
 $(
-       set --noglob
-       ifs=$IFS
-       IFS=,
-       set -- $(getconf LIBPATH)
-       IFS=$ifs
-       for v
-       do      IFS=:
-               set -- $v
-               IFS=$ifs
-               eval [[ \$$2 ]] && eval print -n \" \"\$2=\"\$$2\"
+       v=$(getconf LIBPATH)
+       for v in ${v//,/ }
+       do      v=${v#*:}
+               v=${v%%:*}
+               eval [[ \$$v ]] && eval print -n \" \"\$v=\"\$$v\"
        done
 ) \
 exec -c -a -ksh ${ABSHELL} -c "exit 1" 1>/dev/null 2>&1
@@ -77,6 +75,6 @@
 then   err_exit 'subshell trap on exit overwrites parent trap'
 fi
 cd ~- || err_exit "cd back failed"
-rm -r /tmp/ksh$$ || err_exit "rm -r /tmp/ksh$$ failed"
 $SHELL -c 'builtin -f cmd getconf; getconf --"?-version"; exit 0' >/dev/null 
2>&1 || err_exit 'ksh plugin exit failed -- was ksh built with 
CCFLAGS+=$(CC.EXPORT.DYNAMIC)?'
+
 exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/expand.sh     Fri Sep 25 06:37:48 2009
+++ new/usr/src/lib/libshell/common/tests/expand.sh     Fri Sep 25 06:37:46 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
--- old/usr/src/lib/libshell/common/tests/functions.sh  Fri Sep 25 06:37:51 2009
+++ new/usr/src/lib/libshell/common/tests/functions.sh  Fri Sep 25 06:37:49 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -28,13 +28,11 @@
 integer Errors=0
 Command=${0##*/}
 
-tmp=/tmp/kshtf$$
-function cleanup
-{
-       rm -rf $tmp
-}
-mkdir $tmp || err_exit "mkdir $tmp failed"
+ulimit -c 0
 
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
 integer foo=33
 bar=bye
 # check for global variables and $0
@@ -89,11 +87,11 @@
 {
        (return 0)
 }
-> $tmp/shtests$$.1
+> $tmp/test1
 {
 foobar
-if     [ -r $tmp/shtests$$.1 ]
-then   rm -r $tmp/shtests$$.1
+if     [ -r $tmp/test1 ]
+then   rm -r $tmp/test1
 else   err_exit 'return within subshell inside function error'
 fi
 }
@@ -138,37 +136,36 @@
 if     [[ $(fun) != hello ]]
 then   err_exit one line functions not working
 fi
-trap cleanup EXIT
-cat > $tmp/script$$ <<-\!
+cat > $tmp/script <<-\!
        print -r -- "$1"
 !
-chmod +x $tmp/script$$
+chmod +x $tmp/script
 function passargs
 {
-       $tmp/script$$ "$@"
+       $tmp/script "$@"
 }
 if     [[ $(passargs one) != one ]]
 then   err_exit 'passing args from functions to scripts not working'
 fi
-cat > $tmp/script$$ <<-\!
+cat > $tmp/script <<-\!
        trap 'exit 0' EXIT
        function foo
        {
-               /tmp > /dev/null  2>&1
+               /tmp > /dev/null 2>&1
        }
        foo
 !
-if     ! $tmp/script$$
-then   err_exit 'exit trap incorrectly triggered' 
+if     ! $tmp/script
+then   err_exit 'exit trap incorrectly triggered'
 fi
-if     ! $SHELL -c $tmp/script$$
-then   err_exit 'exit trap incorrectly triggered when invoked with -c' 
+if     ! $SHELL -c $tmp/script
+then   err_exit 'exit trap incorrectly triggered when invoked with -c'
 fi
-$SHELL -c "trap 'rm $tmp/script$$' EXIT"
-if     [[ -f $tmp/script$$ ]]
-then   err_exit 'exit trap not triggered when invoked with -c' 
+$SHELL -c "trap 'rm $tmp/script' EXIT"
+if     [[ -f $tmp/script ]]
+then   err_exit 'exit trap not triggered when invoked with -c'
 fi
-cat > $tmp/script$$ <<- \EOF
+cat > $tmp/script <<- \EOF
        foobar()
        {
                return
@@ -177,8 +174,8 @@
        foobar
        print -r -- "$1"
 EOF
-chmod +x $tmp/script$$
-if     [[ $( $SHELL $tmp/script$$ arg1 arg2) != arg2 ]]
+chmod +x $tmp/script
+if     [[ $( $SHELL $tmp/script arg1 arg2) != arg2 ]]
 then   err_exit 'arguments not restored by posix functions'
 fi
 function foo
@@ -212,18 +209,17 @@
 if     [[ $(foo) != 3 ]]
 then   err_exit 'variable assignment list not using parent scope'
 fi
-unset -f foo$$
-#trap "rm -f $tmp/foo$$" EXIT INT
-cat > $tmp/foo$$ <<!
-function foo$$
+unset -f foobar
+cat > $tmp/foobar <<!
+function foobar
 {
        print foo
 }
 !
-chmod +x $tmp/foo$$
+chmod +x $tmp/foobar
 FPATH=$tmp
-autoload foo$$
-if     [[ $(foo$$ 2>/dev/null) != foo ]]
+autoload foobar
+if     [[ $(foobar 2>/dev/null) != foo ]]
 then   err_exit 'autoload not working'
 fi
 unset -f foobar
@@ -233,7 +229,7 @@
        return 0
 }
 ( foobar ) 2> /dev/null || err_exit "cannot unset readonly variable in 
function"
-if     $SHELL -n 2> /dev/null <<-! 
+if     $SHELL -n 2> /dev/null <<-!
        abc()
        !
 then   err_exit 'abc() without a function body is not a syntax error'
@@ -240,7 +236,7 @@
 fi
 function winpath
 {
-       usage='q pathname ...' 
+       usage='q pathname ...'
        typeset var format=s
        while   getopts  "$usage" var
        do      case $var in
@@ -296,7 +292,7 @@
 fi
 trap - ERR
 
-function myexport 
+function myexport
 {
        nameref var=$1
        if      (( $# > 1 ))
@@ -309,7 +305,6 @@
        typeset val
        val=$(export | grep "^$1=")
        print ${val#"$1="}
-       
 }
 export dgk=base
 val=$(myexport dgk fun)
@@ -384,8 +379,26 @@
        return $r
 }
 closure 0 || err_exit -u2 'for loop function optimization bug2'
-mkdir  $tmp/ksh$$ || err_exit "mkdir $tmp/ksh$$ failed"
-cd $tmp/ksh$$ || err_exit "cd $tmp/ksh$$ failed"
+dir=$tmp/dir
+mkdir $dir
+cd $dir || { err_exit "cd $dir failed"; exit 1; }
+
+(
+       function a {
+               print a
+       }
+       function b {
+               print 1
+               a
+               print 2
+       } > /dev/null
+       typeset -ft a b
+       PS4=X
+       b 
+) > file 2>&1
+[[ $(<file) == *'Xprint 2'* ]] ||  err_exit 'function trace disabled by 
function call'
+rm -f file
+
 print 'false' > try
 chmod +x try
 cat > tst <<- EOF
@@ -400,18 +413,19 @@
 if     [[ $($SHELL < tst)  == error ]]
 then   err_exit 'ERR trap not cleared'
 fi
-FPATH=$tmp/ksh$$
-print ': This does nothing' > $tmp/ksh$$/foobar
-chmod +x $tmp/ksh$$/foobar
-unset -f  foobar
-{ foobar;} 2> /dev/null
-if     [[ $? != 126 ]]
-then   err_exit 'function file without function definition processes wrong 
error'
+FPATH=$dir
+print ': This does nothing' > foobar
+chmod +x foobar
+unset -f foobar
+{ foobar; } 2>/dev/null
+got=$?
+exp=126
+if     [[ $got != $exp ]]
+then   err_exit "function file without function definition processes wrong 
error -- expected '$exp', got '$got'"
 fi
-print 'set a b c' > dotscript 
+print 'set a b c' > dotscript
 [[ $(PATH=$PATH: $SHELL -c '. dotscript;print $#') == 3 ]] || err_exit 
'positional parameters not preserved with . script without arguments'
 cd ~- || err_exit "cd back failed"
-cd /; rm -r $tmp/ksh$$ || err_exit "rm -r $tmp/ksh$$ failed"
 function errcheck
 {
        trap 'print ERR; return 1' ERR
@@ -439,7 +453,7 @@
 b() { : ;}
 [[ $(a) == a ]] || err_exit '.sh.fun not set correctly in a function'
 print $'a(){\ndate\n}'  | $SHELL 2> /dev/null || err_exit 'parser error in 
a(){;date;}'
-cat > $tmp/data$$.1 << '++EOF'
+cat > $tmp/data1 << '++EOF'
      1  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      2  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      3  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
@@ -461,7 +475,7 @@
     19  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
     20  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 ++EOF
-cat > $tmp/script$$ << '++EOF'
+cat > $tmp/script << '++EOF'
 # XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 # XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 # XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
@@ -727,10 +741,10 @@
 {
 cat <<\M
 ++EOF
-cat $tmp/data$$.1 >> $tmp/script$$
-printf 'M\n}\n\nf\n\n' >> $tmp/script$$
-$SHELL -c $tmp/script$$  > $tmp/data$$.2
-cmp -s $tmp/data$$.[12] || err_exit 'error with long functions'
+cat $tmp/data1 >> $tmp/script
+printf 'M\n}\n\nf\n\n' >> $tmp/script
+$SHELL -c $tmp/script  > $tmp/data2
+cmp -s $tmp/data[12] || err_exit 'error with long functions'
 v=1
 function f
 {
@@ -776,7 +790,7 @@
        integer count=0
        function err_f
        {
-               if      ((count++==3))  
+               if      ((count++==3))
                then    print failed
                else    false
                fi
@@ -785,7 +799,6 @@
        false
 )
 [[ $x == failed ]] && err_exit 'ERR trap executed multiple times'
-trap cleanup EXIT
 export environment
 typeset global
 function f
@@ -819,17 +832,17 @@
 }
 f local global environment literal positional
 $SHELL -c '
-       print exit 0 > '$tmp'/script$$
-       chmod +x '$tmp'/script$$
+       print exit 0 > '$tmp'/script
+       chmod +x '$tmp'/script
        unset var
        var=( ident=1 )
        function fun
        {
-               PATH='$tmp' script$$
+               PATH='$tmp' script
        }
        fun
 ' || err_exit "compound variable cleanup before script exec failed"
-( $SHELL << \++EOF++ 
+( $SHELL << \++EOF++
 function main
 {
        typeset key
@@ -921,10 +934,7 @@
 # tests for debug functions
 basefile=${.sh.file}
 integer baseline
-cleanup
-trap 'rm $tmp' EXIT
-tmp=${TMPDIR:-/tmp}/ksh$$.1 
-cat > $tmp << \+++
+cat > $tmp/debug << \+++
        : line 1
 
        : line 3
@@ -943,7 +953,7 @@
                [[ $arg == DEBUG  ]] && ((baseline++))
                [[ $line == "$baseline" ]] || err_exit "line number for level 0 
is $line not $baseline"
        elif    ((pos==1))
-       then    [[ $filename == "$tmp" ]] ||  err_exit "filename for level 1 is 
$filename not $tmp"
+       then    [[ $filename == "$tmp/debug" ]] ||  err_exit "filename for 
level 1 is $filename not $tmp/debug"
                [[ $* == 'foo bar' ]] || err_exit "args are '$*', not 'foo bar'"
                [[ $line == $arg ]] || err_exit "line number for level 1 is 
$line not $arg"
        else    err_exit "level should be 0 or 1 but is $pos"
@@ -963,9 +973,9 @@
 
 ((baseline=LINENO+2))
 trap '_Dbg_debug_trap_handler' DEBUG
-.  $tmp  foo bar
+.  $tmp/debug foo bar
 trap '' DEBUG
-             
+
 caller() {
   integer .level=.sh.level .max=.sh.level-1
   while((--.level>=0))
@@ -978,4 +988,61 @@
 set -- $(bar)
 [[ $1 == $2 ]] && err_exit ".sh.inline optimization bug"
 ( $SHELL  -c ' function foo { typeset x=$1;print $1;};z=();z=($(foo bar)) ') 
2> /dev/null ||  err_exit 'using a function to set an array in a command sub  
fails'
+
+{
+got=$(
+s=$(ulimit -s)
+if     [[ $s == +([[:digit:]]) ]] && (( s < 16384 ))
+then   ulimit -s 16384 2>/dev/null
+fi
+$SHELL << \+++
+f()
+{
+       if      (($1>1))
+       then    x=$(f $(($1-1))) || exit 1
+       fi
+       return 0
+}
+f 257 && print ok
++++
+)
+} 2>/dev/null
+[[ $got == ok ]] || err_exit 'cannot handle comsub depth > 256 in function'
+
+tmp1=$tmp/job.1
+tmp2=$tmp/job.2
+cat > $tmp1 << +++
+#! $SHELL
+print \$\$
++++
+chmod +x $tmp1
+function foo
+{
+       typeset pid
+       $tmp1 > $tmp2 & pid=$!
+       wait $!
+       [[ $(< $tmp2) == $pid ]] || err_exit 'wrong pid for & job in function'
+}
+foo
+# make sure compiled functions work
+[[ $(tmp=$tmp $SHELL <<- \++++
+       cat > $tmp/functions <<- \EOF
+               function bar
+               {
+                       print foo
+               }
+               function foobar
+               {
+                       bar
+               }
+       EOF
+       ${SHCOMP:-${SHELL%/*}/shcomp} $tmp/functions > $tmp/foobar
+       rm -f "$tmp/functions"
+       chmod +x $tmp/foobar
+       rm $tmp/!(dir|foobar)
+       FPATH=$tmp
+       PATH=$FPATH:$PATH
+       foobar
+++++
+) == foo ]] > /dev/null  || err_exit 'functions compiled with shcomp not 
working'
 exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/glob.sh       Fri Sep 25 06:37:54 2009
+++ new/usr/src/lib/libshell/common/tests/glob.sh       Fri Sep 25 06:37:52 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -24,8 +24,12 @@
 }
 alias err_exit='err_exit $LINENO'
 
-integer aware=0 contrary=0 ignorant=0
+Command=${0##*/}
+integer aware=0 contrary=0 errors=0 ignorant=0
 
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
 function test_glob
 {
        typeset lineno expected drop arg got sep op val add del
@@ -84,17 +88,11 @@
 }
 alias test_case='test_case $LINENO'
 
-Command=${0##*/}
-tmp=/tmp/ksh$$
-integer errors=0
 unset undefined
 
 export LC_COLLATE=C
 
-mkdir $tmp || err_exit "mkdir $tmp failed"
-trap "cd /; rm -rf $tmp" EXIT
-cd $tmp || err_exit "cd $tmp failed"
-rm -rf *
+cd $tmp || { err_exit "cd $tmp failed"; exit 1; }
 
 touch B b
 set -- *
--- old/usr/src/lib/libshell/common/tests/grep.sh       Fri Sep 25 06:37:57 2009
+++ new/usr/src/lib/libshell/common/tests/grep.sh       Fri Sep 25 06:37:55 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -28,6 +28,9 @@
 Command=${0##*/}
 integer Errors=0
 
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
 function grep
 {
        #
@@ -84,8 +87,7 @@
        let tc                                  #  set the return value
 }
 
-trap 'rm -f /tmp/grep$$' EXIT
-cat > /tmp/grep$$ <<\!
+cat > $tmp/grep <<\!
 this is a food bar test
 to see how many lines find both foo and bar.
 Some line contain foo only,
@@ -96,7 +98,7 @@
 There are only two line with out foo but with bar.
 !
 
-if     (( $(grep -c 'foo*bar' /tmp/grep$$ ) != 6))
+if     (( $(grep -c 'foo*bar' $tmp/grep ) != 6))
 then   err_exit
 fi
 exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/heredoc.sh    Fri Sep 25 06:38:00 2009
+++ new/usr/src/lib/libshell/common/tests/heredoc.sh    Fri Sep 25 06:37:58 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -27,9 +27,12 @@
 
 Command=${0##*/}
 integer Errors=0
-f=/tmp/here1$$
-g=/tmp/here2$$
-trap "rm -f $f $g" EXIT
+
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
+f=$tmp/here1
+g=$tmp/here2
 cat > $f <<!
 hello world
 !
@@ -143,7 +146,7 @@
 EOF) != $'#abc\nabc' ]]
 then   err_exit 'comments not preserved in here-documents'
 fi
-cat  > "$f" <<- '!!!!' 
+cat  > "$f" <<- '!!!!'
        builtin cat
        : << EOF
        $PWD
@@ -173,7 +176,7 @@
 if     [[ $($SHELL  "$f") != abc ]]
 then   err_exit        'here document descritor was closed'
 fi
-cat  > "$f" <<- '!!!!' 
+cat  > "$f" <<- '!!!!'
        exec 0<&-
        foobar()
        {
@@ -207,9 +210,9 @@
 then   err_exit        'here document with stdin closed failed'
 fi
 printf $'cat   <<# \\!!!\n\thello\n\t\tworld\n!!!' > $f
-[[ $($SHELL "$f") == $'hello\n\tworld' ]] || err_exit "<<# not working for 
quoted here documents" 
+[[ $($SHELL "$f") == $'hello\n\tworld' ]] || err_exit "<<# not working for 
quoted here documents"
 printf $'w=world;cat   <<# !!!\n\thello\n\t\t$w\n!!!' > $f
-[[ $($SHELL "$f") == $'hello\n\tworld' ]] || err_exit "<<# not working for 
non-quoted here documents" 
+[[ $($SHELL "$f") == $'hello\n\tworld' ]] || err_exit "<<# not working for 
non-quoted here documents"
 [[ $( $SHELL  <<- \++++
        S=( typeset a )
        function S.a.get
@@ -226,4 +229,27 @@
        ${ g;}
        EOF
        ' 2> /dev/null) == ok ]] || err_exit '${ command;} not working in 
heredoc'
+script=$f
+{
+for ((i=0; i < 406; i++))
+do     print ': 23456789012345678'
+done
+print : 123456789123
+cat <<- \EOF
+eval "$(
+       { cat                                 ; } <<MARKER
+         print  hello
+       MARKER
+)"
+EOF
+} > $script
+chmod +x $script
+[[ $($SHELL $script) == hello ]] 2> /dev/null || err_exit 'heredoc embeded in 
command substitution fails at buffer boundary'
+
+got=$( cat << EOF
+\
+abc
+EOF)
+[[ $got == abc ]] || err_exit 'line continuation at start of buffer not 
working'
+
 exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/io.sh Fri Sep 25 06:38:03 2009
+++ new/usr/src/lib/libshell/common/tests/io.sh Fri Sep 25 06:38:01 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -28,29 +28,29 @@
 Command=${0##*/}
 integer Errors=0
 
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
 unset HISTFILE
 
 function fun
 {
-       while  command exec 3>&1 
-       do      break  
+       while  command exec 3>&1
+       do      break
        done 2>   /dev/null
        print -u3 good
 }
-print 'read -r a;print -r -u$1 -- "$a"' >  /tmp/mycat$$
-chmod 755 /tmp/mycat$$
+print 'read -r a;print -r -u$1 -- "$a"' > $tmp/mycat
+chmod 755 $tmp/mycat
 for ((i=3; i < 10; i++))
 do
-       eval "a=\$(print foo | /tmp/mycat$$" $i $i'>&1 > /dev/null |cat)' 2> 
/dev/null
+       eval "a=\$(print foo | $tmp/mycat" $i $i'>&1 > /dev/null |cat)' 2> 
/dev/null
        [[ $a == foo ]] || err_exit "bad file descriptor $i in comsub script"
 done
-rm -f /tmp/mycat$$
 exec 3> /dev/null
 [[ $(fun) == good ]] || err_exit 'file 3 closed before subshell completes'
 exec 3>&-
-mkdir /tmp/ksh$$ || err_exit "mkdir /tmp/ksh$$ failed"
-trap 'rm -rf /tmp/ksh$$' EXIT
-cd /tmp/ksh$$ || err_exit "cd /tmp/ksh$$ failed"
+cd $tmp || { err_exit "cd $tmp failed"; exit ; }
 print foo > file1
 print bar >> file1
 if     [[ $(<file1) != $'foo\nbar' ]]
@@ -59,19 +59,55 @@
 set -o noclobber
 exec 3<> file1
 read -u3 line
-if     [[ $line != foo ]]
-then   err_exit '<> not working right with read'
+exp=foo
+if     [[ $line != $exp ]]
+then   err_exit "read on <> fd failed -- expected '$exp', got '$line'"
 fi
 if     ( 4> file1 ) 2> /dev/null
 then   err_exit 'noclobber not causing exclusive open'
 fi
 set +o noclobber
-if     command exec 4< /dev/fd/3
-then   read -u4 line
-       if      [[ $line != bar ]]
-       then    '4< /dev/fd/3 not working correctly'
-       fi
+
+FDFS=(
+       ( dir=/proc/self/fd     semantics='open'        )
+       ( dir=/proc/$$/fd       semantics='open'        )
+       ( dir=/dev/fd           semantics='open|dup'    )
+       ( dir=/dev/fd           semantics='dup' )
+)
+for ((fdfs=0; fdfs<${#fd...@]}-1; fdfs++))
+do     [[ -e ${FDFS[fdfs].dir} ]] && { command : > ${FDFS[fdfs].dir}/1; } 
2>/dev/null && break
+done
+
+exec 3<> file1
+if     command exec 4< ${FDFS[fdfs].dir}/3
+then   read -u3 got
+       read -u4 got
+       exp='foo|bar'
+       case $got in
+       foo)    semantics='open' ;;
+       bar)    semantics='dup' ;;
+       *)      semantics='failed' ;;
+       esac
+       [[ $semantics == @(${FDFS[fdfs].semantics}) ]] || err_exit "'4< 
${FDFS[fdfs].dir}/3' $semantics semantics instead of ${FDFS[fdfs].semantics} -- 
expected '$exp', got '$got'"
 fi
+
+# 2004-11-25 ancient /dev/fd/N redirection bug fix
+got=$(
+       {
+               print -n 1
+               print -n 2 > ${FDFS[fdfs].dir}/2
+               print -n 3
+               print -n 4 > ${FDFS[fdfs].dir}/2
+       }  2>&1
+)
+exp='1234|4'
+case $got in
+1234)  semantics='dup' ;;
+4)     semantics='open' ;;
+*)     semantics='failed' ;;
+esac
+[[ $semantics == @(${FDFS[fdfs].semantics}) ]] || err_exit 
"${FDFS[fdfs].dir}/N $semantics semantics instead of ${FDFS[fdfs].semantics} -- 
expected '$exp', got '$got'"
+
 cat > close0 <<\!
 exec 0<&-
 echo $(./close1)
@@ -91,15 +127,15 @@
 !
 ./close0 2> /dev/null || err_exit "multiple exec 4< /dev/null can fail"
 $SHELL -c '
-       trap "rm -f in$$ out$$" EXIT
+       trap "rm -f in out" EXIT
        for ((i = 0; i < 1000; i++))
        do      print -r -- "This is a test"
-       done > in$$
-       > out$$
-       exec 1<> out$$
+       done > in
+       > out
+       exec 1<> out
        builtin cat
-       print -r -- "$(cat in$$)"
-       cmp -s in$$ out$$'  2> /dev/null
+       print -r -- "$(<in)"
+       cmp -s in out'  2> /dev/null
 [[ $? == 0 ]] || err_exit 'builtin cat truncates files'
 cat >| script <<-\!
 print hello
@@ -122,7 +158,7 @@
 if     [[ $line != foo ]]
 then   err_exit 'file descriptor not restored after exec in subshell'
 fi
-exec 3>&- 4>&-; cd /; rm -r /tmp/ksh$$ || err_exit "rm -r /tmp/ksh$$ failed"
+exec 3>&- 4>&-
 [[ $( {
        read -r line;print -r -- "$line"
        (
@@ -137,13 +173,13 @@
 line 3
 !) == $'line 1\nline 2\nline 3' ]] || err_exit 'read error with subshells'
 # 2004-05-11 bug fix
-cat > /tmp/io$$.1 <<- \++EOF++  
-       script=/tmp/io$$.2
-       trap 'rm -f $script' EXIT
-       exec 9> $script
+cat > $tmp/1 <<- ++EOF++
+       script=$tmp/2
+       trap "rm -f \$script" EXIT
+       exec 9> \$script
        for ((i=3; i<9; i++))
-       do      eval "while read -u$i; do : ;done $i</dev/null"
-               print -u9 "exec $i< /dev/null" 
+       do      eval "while read -u\$i; do : ;done \$i</dev/null"
+               print -u9 "exec \$i< /dev/null"
        done
        for ((i=0; i < 60; i++))
        do      print -u9 -f "%.80c\n"  ' '
@@ -150,24 +186,13 @@
        done
        print -u9 'print ok'
        exec 9<&-
-       chmod +x $script
-       $script
+       chmod +x \$script
+       \$script
 ++EOF++
-chmod +x /tmp/io$$.1
-[[ $($SHELL  /tmp/io$$.1) == ok ]]  || err_exit "parent i/o causes child 
script to fail"
-rm -rf /tmp/io$$.[12]
-# 2004-11-25 ancient /dev/fd/NN redirection bug fix
-x=$(
-       {
-               print -n 1
-               print -n 2 > /dev/fd/2
-               print -n 3
-               print -n 4 > /dev/fd/2
-       }  2>&1
-)
-[[ $x == "1234" ]] || err_exit "/dev/fd/NN redirection fails to dup"
-# 2004-12-20 redirction loss bug fix
-cat > /tmp/io$$.1 <<- \++EOF++  
+chmod +x $tmp/1
+[[ $($SHELL  $tmp/1) == ok ]]  || err_exit "parent i/o causes child script to 
fail"
+# 2004-12-20 redirection loss bug fix
+cat > $tmp/1 <<- \++EOF++
        function a
        {
                trap 'print ok' EXIT
@@ -175,12 +200,11 @@
        }
        a
 ++EOF++
-chmod +x /tmp/io$$.1
-[[ $(/tmp/io$$.1) == ok ]] || err_exit "trap on EXIT loses last command 
redirection"
-print > /dev/null {n}> /tmp/io$$.1 
-[[ ! -s /tmp/io$$.1 ]] && newio=1
-rm -rf /tmp/io$$.1
-if     [[ $newio && $(print hello | while read -u$n; do print $REPLY; done 
{n}<&0) != hello ]] 
+chmod +x $tmp/1
+[[ $($tmp/1) == ok ]] || err_exit "trap on EXIT loses last command redirection"
+print > /dev/null {n}> $tmp/1
+[[ ! -s $tmp/1 ]] && newio=1
+if     [[ $newio && $(print hello | while read -u$n; do print $REPLY; done 
{n}<&0) != hello ]]
 then   err_exit "{n}<&0 not working with for loop"
 fi
 [[ $({ read -r;read -u3 3<&0; print -- "$REPLY" ;} <<!
@@ -187,37 +211,36 @@
 hello
 world
 !) == world ]] || err_exit 'I/O not synchronized with <&'
-trap 'rm -f /tmp/seek$$; exit $((Errors+1))' EXIT
 x="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNSPQRSTUVWXYZ1234567890"
 for ((i=0; i < 62; i++))
 do     printf "%.39c\n"  ${x:i:1}
-done >  /tmp/seek$$
-if     command exec 3<> /tmp/seek$$
+done >  $tmp/seek
+if     command exec 3<> $tmp/seek
 then   (( $(3<#) == 0 )) || err_exit "not at position 0"
        (( $(3<# ((EOF))) == 40*62 )) || err_exit "not at end-of-file"
-       command exec 3<# ((40*8)) || err_exit "absolute seek fails"     
+       command exec 3<# ((40*8)) || err_exit "absolute seek fails"
        read -u3
-       [[ $REPLY == +(i) ]] || err_exit "expecting iiii..."
+       [[ $REPLY == +(i) ]] || err_exit "expected iiii..., got $REPLY"
        [[ $(3<#) == $(3<# ((CUR)) ) ]] || err_exit '$(3<#)!=$(3<#((CUR)))'
        command exec 3<# ((CUR+80))
        read -u3
-       [[ $REPLY == {39}(l) ]] || err_exit "expecting lll..."
+       [[ $REPLY == {39}(l) ]] || err_exit "expected lll..., got $REPLY"
        command exec 3<# ((EOF-80))
        read -u3
-       [[ $REPLY == +(9) ]] || err_exit "expecting 999...; got $REPLY"
+       [[ $REPLY == +(9) ]] || err_exit "expected 999..., got $REPLY"
        command exec 3># ((80))
        print -u3 -f "%.39c\n"  @
        command exec 3># ((80))
        read -u3
-       [[ $REPLY == +(@) ]] || err_exit "expecting @@@..."
+       [[ $REPLY == +(@) ]] || err_exit "expected @@@..., got $REPLY"
        read -u3
-       [[ $REPLY == +(d) ]] || err_exit "expecting ddd..."
+       [[ $REPLY == +(d) ]] || err_exit "expected ddd..., got $REPLY"
        command exec 3># ((EOF))
        print -u3 -f "%.39c\n"  ^
        (( $(3<# ((CUR-0))) == 40*63 )) || err_exit "not at extended 
end-of-file"
-       command exec 3<# ((40*62)) 
+       command exec 3<# ((40*62))
        read -u3
-       [[ $REPLY == +(^) ]] || err_exit "expecting ddd..."
+       [[ $REPLY == +(^) ]] || err_exit "expected ddd..., got $REPLY"
        command exec 3<# ((0))
        command exec 3<# *jjjj*
        read -u3
@@ -227,16 +250,16 @@
        [[  $REPLY == {39}(l) ]] || err_exit "<## pattern failed to position"
        command exec 3<# *abc*
        read -u3 && err_exit "not found pattern not positioning at eof"
-       cat /tmp/seek$$ | read -r <# *WWW*
+       cat $tmp/seek | read -r <# *WWW*
        [[ $REPLY == *WWWWW* ]] || err_exit '<# not working for pipes'
-       { < /tmp/seek$$ <# ((2358336120)) ;} 2> /dev/null || err_exit 'long 
seek not working'
-else   err_exit "/tmp/seek$$: cannot open for reading"
+       { < $tmp/seek <# ((2358336120)) ;} 2> /dev/null || err_exit 'long seek 
not working'
+else   err_exit "$tmp/seek: cannot open for reading"
 fi
 command exec 3<&- || 'cannot close 3'
 for ((i=0; i < 62; i++))
 do     printf "%.39c\n"  ${x:i:1}
-done >  /tmp/seek$$
-if     command exec {n}<> /tmp/seek$$
+done >  $tmp/seek
+if     command exec {n}<> $tmp/seek
 then   { command exec {n}<#((EOF)) ;} 2> /dev/null || err_exit '{n}<# not 
working'
        if      $SHELL -c '{n}</dev/null' 2> /dev/null
        then    (( $({n}<#) ==  40*62))  || err_exit '$({n}<#) not working'
@@ -243,8 +266,6 @@
        else    err_exit 'not able to parse {n}</dev/null'
        fi
 fi
-trap "" EXIT
-rm -f  /tmp/seek$$
 $SHELL -ic '
 {
     print -u2  || exit 2
@@ -258,9 +279,8 @@
 }  3> /dev/null 4> /dev/null 5> /dev/null 6> /dev/null 7> /dev/null 8> 
/dev/null 9> /dev/null' > /dev/null 2>&1
 exitval=$?
 (( exitval ))  && err_exit  "print to unit $exitval failed"
-trap 'rm -rf /tmp/io.sh$$*' EXIT
-$SHELL -c "{ > /tmp/io.sh$$.1 ; date;} >&- 2> /dev/null" > /tmp/io.sh$$.2
-[[ -s /tmp/io.sh$$.1 || -s /tmp/io.sh$$.2 ]] && err_exit 'commands with 
standard output closed produce output'
+$SHELL -c "{ > $tmp/1 ; date;} >&- 2> /dev/null" > $tmp/2
+[[ -s $tmp/1 || -s $tmp/2 ]] && err_exit 'commands with standard output closed 
produce output'
 $SHELL -c "$SHELL -c ': 3>&1' 1>&- 2>/dev/null" && err_exit 'closed standard 
output not passed to subshell'
 [[ $(cat  <<- \EOF | $SHELL
        do_it_all()
@@ -273,14 +293,28 @@
 EOF) == 'hello world' ]] || err_exit 'invalid readahead on stdin'
 $SHELL -c 'exec 3>; /dev/null'  2> /dev/null && err_exit '>; with exec should 
be an error'
 $SHELL -c ': 3>; /dev/null'  2> /dev/null || err_exit '>; not working with at 
all'
-print hello > /tmp/io.sh$$.1
-if     ! $SHELL -c "false >; /tmp/io.sh$$.1"  2> /dev/null
-then   [[ $(</tmp/io.sh$$.1) == hello ]] || err_exit '>; not preserving file 
on failure'
+print hello > $tmp/1
+if     ! $SHELL -c "false >; $tmp/1"  2> /dev/null
+then   [[ $(<$tmp/1) == hello ]] || err_exit '>; not preserving file on 
failure'
 fi
-if     ! $SHELL -c "sed -e 's/hello/hello world/' /tmp/io.sh$$.1" >; 
/tmp/io.sh$$.1  2> /dev/null
-then   [[ $(</tmp/io.sh$$.1) == 'hello world' ]] || err_exit '>; not updating 
file on success'
+if     ! $SHELL -c "sed -e 's/hello/hello world/' $tmp/1" >; $tmp/1  2> 
/dev/null
+then   [[ $(<$tmp/1) == 'hello world' ]] || err_exit '>; not updating file on 
success'
 fi
 
+$SHELL -c 'exec 3<>; /dev/null'  2> /dev/null && err_exit '<>; with exec 
should be an error'
+$SHELL -c ': 3<>; /dev/null'  2> /dev/null || err_exit '<>; not working with 
at all'
+print $'hello\nworld' > $tmp/1
+if      ! $SHELL -c "false <>; $tmp/1"  2> /dev/null
+then    [[ $(<$tmp/1) == $'hello\nworld' ]] || err_exit '<>; not preserving 
file on failure'
+fi
+if     ! $SHELL -c "head -1 $tmp/1" <>; $tmp/1  2> /dev/null
+then   [[ $(<$tmp/1) == hello ]] || err_exit '<>; not truncating file on 
success of head'
+fi
+print $'hello\nworld' > $tmp/1
+if     ! $SHELL -c head  < $tmp/1 <#((6)) <>; $tmp/1  2> /dev/null
+then   [[ $(<$tmp/1) == world ]] || err_exit '<>; not truncating file on 
success of behead'
+fi
+
 unset y
 read -n1 y <<!
 abc
@@ -303,25 +337,41 @@
 [[ $b == d ]] || err_exit 'read -N1 from pipe not working'
 (print -n a;sleep 1; print -n bcde) |read -n3 a
 [[ $a == a ]] || err_exit 'read -n3 from pipe not working'
-rm -f /tmp/fifo$$
-if     mkfifo /tmp/fifo$$ 2> /dev/null
-then   (print -n a; sleep 1;print -n bcde)  > /tmp/fifo$$ &
+if     mkfifo $tmp/fifo 2> /dev/null
+then   (print -n a; sleep 1;print -n bcde)  > $tmp/fifo &
        {
        read -u5 -n3  -t2 a  || err_exit 'read -n3 from fifo timedout'
        read -u5 -n1 -t2 b || err_exit 'read -n1 from fifo timedout'
-       } 5< /tmp/fifo$$
+       } 5< $tmp/fifo
        [[ $a == a ]] || err_exit 'read -n3 from fifo not working'
-       rm -f /tmp/fifo$$
-       mkfifo /tmp/fifo$$ 2> /dev/null
-       (print -n a; sleep 1;print -n bcde)  > /tmp/fifo$$ &
+       rm -f $tmp/fifo
+       mkfifo $tmp/fifo 2> /dev/null
+       (print -n a; sleep 1;print -n bcde)  > $tmp/fifo &
        {
        read -u5 -N3 -t2 a || err_exit 'read -N3 from fifo timed out'
        read -u5 -N1 -t2 b || err_exit 'read -N1 from fifo timedout'
-       } 5< /tmp/fifo$$
+       } 5< $tmp/fifo
        [[ $a == abc ]] || err_exit 'read -N3 from fifo not working'
        [[ $b == d ]] || err_exit 'read -N1 from fifo not working'
 fi
-rm -f /tmp/fifo$$
+(
+       print -n 'prompt1: '
+       sleep .1
+       print line2
+       sleep .1
+       print -n 'prompt2: '
+       sleep .1
+) | {
+       read -t2 -n 1000 line1
+       read -t2 -n 1000 line2
+       read -t2 -n 1000 line3
+       read -t2 -n 1000 line4
+}
+[[ $? == 0 ]]                  && err_exit 'should have time out'
+[[ $line1 == 'prompt1: ' ]]    || err_exit "line1 should be 'prompt1: '"
+[[ $line2 == line2 ]]          || err_exit "line2 should be line2"
+[[ $line3 == 'prompt2: ' ]]    || err_exit "line3 should be 'prompt2: '"
+[[ ! $line4 ]]                 || err_exit "line4 should be empty"
 
 if     $SHELL -c "export LC_ALL=en_US.UTF-8; c=$'\342\202\254'; [[ \${#c} == 1 
]]" 2>/dev/null
 then   lc_utf8=en_US.UTF-8
@@ -370,4 +420,32 @@
        fi
 fi
 
+exec 3<&2
+file=$tmp/file
+redirect 5>$file 2>&5
+print -u5 -f 'This is a test\n'
+print -u2 OK
+exec 2<&3
+exp=$'This is a test\nOK'
+got=$(< $file)
+[[ $got == $exp ]] || err_exit "output garbled when stderr is duped -- 
expected $(printf %q "$exp"), got $(printf %q "$got")"
+print 'hello world' > $file
+1<>; $file  1># ((5))
+(( $(wc -c < $file) == 5 )) || err_exit "$file was not truncate to 5 bytes"
+
+$SHELL -c "PS4=':2:'
+       exec 1> $tmp/21.out 2> $tmp/22.out
+       set -x
+       printf ':1:A:'
+       print \$(:)
+       print :1:Z:" 1> $tmp/11.out 2> $tmp/12.out
+[[ -s $tmp/11.out ]] && err_exit "standard output leaked past redirection"
+[[ -s $tmp/12.out ]] && err_exit "standard error leaked past redirection"
+exp=$':1:A:\n:1:Z:'
+got=$(<$tmp/21.out)
+[[ $exp == "$got" ]] || err_exit "standard output garbled -- expected $(printf 
%q "$exp"), got $(printf %q "$got")"
+exp=$':2:printf :1:A:\n:2::\n:2:print\n:2:print :1:Z:'
+got=$(<$tmp/22.out)
+[[ $exp == "$got" ]] || err_exit "standard error garbled -- expected $(printf 
%q "$exp"), got $(printf %q "$got")"
+
 exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/locale.sh     Fri Sep 25 06:38:06 2009
+++ new/usr/src/lib/libshell/common/tests/locale.sh     Fri Sep 25 06:38:04 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -40,7 +40,7 @@
 
 export LC_ALL=C
 if     (( $($SHELL -c $'export LC_ALL=en_US.UTF-8; print -r 
"\342\202\254\342\202\254\342\202\254\342\202\254w\342\202\254\342\202\254\342\202\254\342\202\254"
 | wc -m' 2>/dev/null) == 10 ))
-then   LC_ALL=en_US.UTF-8 $SHELL -c 
b1=$'"\342\202\254\342\202\254\342\202\254\342\202\254w\342\202\254\342\202\254\342\202\254\342\202\254";
 [[ ${b1:4:1} == w ]]' || err_exit 'Multibyte ${var:offset:len} not working 
correctly'
+then   LC_ALL=en_US.UTF-8 $SHELL -c 
b1=$'"\342\202\254\342\202\254\342\202\254\342\202\254w\342\202\254\342\202\254\342\202\254\342\202\254";
 [[ ${b1:4:1} == w ]]' || err_exit 'multibyte ${var:offset:len} not working 
correctly'
 fi
 
 export LC_ALL=C
@@ -99,6 +99,10 @@
                print -- \$txt
        " 2>&1)
        [[ "$u" == "$x" ]] || err_exit LC_ALL=$lc_all multibyte value/trace 
format failed
+
+       x=$'00fc\n20ac'
+       u=$(LC_ALL=$lc_all $SHELL -c $'printf "%04x\n" \$\'\"\303\274\"\' 
\$\'\"\xE2\x82\xAC\"\'')
+       [[ $u == $x ]] || err_exit LC_ALL=$lc_all multibyte %04x printf format 
failed
 fi
 
 exit $Errors
--- old/usr/src/lib/libshell/common/tests/nameref.sh    Fri Sep 25 06:38:09 2009
+++ new/usr/src/lib/libshell/common/tests/nameref.sh    Fri Sep 25 06:38:07 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -27,6 +27,10 @@
 
 Command=${0##*/}
 integer Errors=0
+
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
 function checkref
 {
        nameref foo=$1 bar=$2
@@ -80,7 +84,7 @@
 if     [[ ${!x} != .foo.bar ]]
 then   err_exit "${!x} not working"
 fi
-typeset +n x $(typeset +n) 
+typeset +n x $(typeset +n)
 unset x
 nameref x=.foo.bar
 function x.set
@@ -96,7 +100,7 @@
 if     [[ $(typeset -n) != x=.foo.bar ]]
 then   err_exit "typeset +n doesn't list values of reference variables"
 fi
-file=/tmp/shtest$$
+file=$tmp/test
 typeset +n foo bar 2> /dev/null
 unset foo bar
 export bar=foo
@@ -104,7 +108,6 @@
 if     [[ $foo != foo ]]
 then   err_exit "value of nameref foo !=  $foo"
 fi
-trap "rm -f $file" EXIT INT
 cat > $file <<\!
 print -r -- $foo
 !
@@ -113,7 +116,7 @@
 if     [[ $y != '' ]]
 then   err_exit "reference variable not cleared"
 fi
-{ 
+{
        command nameref xx=yy
        command nameref yy=xx
 } 2> /dev/null && err_exit "self reference not detected"
@@ -127,7 +130,7 @@
 fi
 unset foo bar
 bar=123
-function foobar 
+function foobar
 {
        typeset -n foo=bar
        typeset -n foo=bar
@@ -216,7 +219,7 @@
        qs=(integer  a=3; integer b=4)
 }
 local 2> /dev/null || err_exit 'function local has non-zero exit status'
-[[ ${qs.a} == 3 ]] || err_exit 'function cannot set compound global variable' 
+[[ ${qs.a} == 3 ]] || err_exit 'function cannot set compound global variable'
 unset fun i
 foo=(x=hi)
 function fun
@@ -297,4 +300,66 @@
 vars.data._1.a=a.1
 vars.data._1.b=b.1
 [[ $(a) == 'a.1 b.1' ]] || err_exit 'nameref choosing wrong scope -- '
+typeset +n bam zip foo
+unset bam zip foo
+typeset -A foo
+foo[2]=bar
+typeset -n bam=foo[2]
+typeset -n zip=bam
+[[ $zip == bar ]] || err_exit 'nameref to another nameref to array element 
fails'
+[[ -R zip ]] || err_exit '[[ -R zip ]] should detect that zip is a reference'
+[[ -R bam ]] || err_exit '[[ -R bam ]] should detect that bam is a reference'
+[[ -R zip ]] || err_exit '[[ -v zip ]] should detect that zip is set'
+[[ -v bam ]] || err_exit '[[ -v bam ]] should detect that bam is set'
+[[ -R 123 ]] && err_exit '[[ -R 123 ]] should detect that 123 is not a 
reference'
+[[ -v 123 ]] && err_exit '[[ -v 123 ]] should detect that 123 is not set'
+
+unset ref x
+typeset -n ref
+x=3
+function foobar
+{
+       typeset xxx=3
+       ref=xxx
+       return 0
+}
+foobar 2> /dev/null && err_exit 'invalid reference should cause foobar to fail'
+[[ -v ref ]] && err_exit '$ref should be unset'
+ref=x
+[[ $ref == 3 ]] || err_exit "\$ref is $ref, it should be 3"
+function foobar
+{
+        typeset fvar=()
+        typeset -n ref=fvar.foo
+        ref=ok
+        print -r $ref
+}
+[[ $(foobar) ==  ok ]] 2> /dev/null  || err_exit 'nameref in function not 
creating variable in proper scope'
+function foobar
+{
+        nameref doc=docs
+        nameref bar=doc.num
+       [[ $bar == 2 ]] || err_exit 'nameref scoping error'
+}
+
+docs=(num=2)
+foobar
+
+typeset +n x y
+unset x y
+typeset -A x
+x[a]=(b=c)  
+typeset -n y=x[a]
+[[ ${...@} == 'x[a].b' ]] || err_exit 'reference to array element not expanded 
with ${...@}'
+
+typeset +n v
+v=()
+k=a.b.c/d
+command typeset -n n=v.${k//['./']/_} 2> /dev/null || err_exit 'patterns with 
quotes not handled correctly with name reference assignment'
+
+typeset _n sp
+nameref sp=addrsp
+sp[14]=( size=1 )
+[[ -v sp[19] ]]  && err_exit '[[ -v sp[19] ]] where sp is a nameref should not 
be set'
+
 exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/options.sh    Fri Sep 25 06:38:12 2009
+++ new/usr/src/lib/libshell/common/tests/options.sh    Fri Sep 25 06:38:10 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -29,11 +29,17 @@
 integer Errors=0
 
 unset HISTFILE
+export LC_ALL=C ENV=
 
+ulimit -c 0
+
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
 if     [[ $( ${SHELL-ksh} -s hello<<-\!
                print $1
                !
-           ) != hello ]]
+        ) != hello ]]
 then   err_exit "${SHELL-ksh} -s not working"
 fi
 x=$(
@@ -42,40 +48,57 @@
        print good
 )
 if     [[ $x != good ]]
-then   err_exit 'sh -e not workuing'
+then   err_exit 'sh -e not working'
 fi
 [[ $($SHELL -D -c 'print hi; print $"hello"') == '"hello"' ]] || err_exit 'ksh 
-D not working'
 
-tmp=/tmp/ksh$$
-mkdir $tmp
+env=$tmp/.env
+print $'(print -u1 aha) &>/dev/null\n(print -u2 aha) &>/dev/null' > $env
 rc=$tmp/.kshrc
 print $'PS1=""\nfunction env_hit\n{\n\tprint OK\n}' > $rc
 
-export ENV='${nosysrc}'$rc
+export ENV=/.$env
+if     [[ ! -o privileged ]]
+then
+       got=$($SHELL -E -c : 2>/dev/null)
+       if      [[ $g ]]
+       then
+               got=$(printf %q "$got")
+               err_exit "\$ENV file &>/dev/null does not redirect stdout -- 
expected '', got $got"
+       fi
+       got=$($SHELL -E -c : 2>&1 >/dev/null)
+       if      [[ $got != *nonstandard* || $got == *$'\n'* ]]
+       then
+               got=$(printf %q "$got")
+               err_exit "\$ENV file &>/dev/null does not redirect stderr -- 
expected one diagnostic line, got $got"
+       fi
+fi
+
+export ENV=/.$rc
 if     [[ -o privileged ]]
 then
-       [[ $(print env_hit | $SHELL 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | $SHELL 2>&1) == "OK" ]] &&
                err_exit 'privileged nointeractive shell reads $ENV file'
-       [[ $(print env_hit | $SHELL -E 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | $SHELL -E 2>&1) == "OK" ]] &&
                err_exit 'privileged -E reads $ENV file'
-       [[ $(print env_hit | $SHELL +E 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | $SHELL +E 2>&1) == "OK" ]] &&
                err_exit 'privileged +E reads $ENV file'
-       [[ $(print env_hit | $SHELL --rc 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | $SHELL --rc 2>&1) == "OK" ]] &&
                err_exit 'privileged --rc reads $ENV file'
-       [[ $(print env_hit | $SHELL --norc 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | $SHELL --norc 2>&1) == "OK" ]] &&
                err_exit 'privileged --norc reads $ENV file'
 else
-       [[ $(print env_hit | $SHELL 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | $SHELL 2>&1) == "OK" ]] &&
                err_exit 'nointeractive shell reads $ENV file'
-       [[ $(print env_hit | $SHELL -E 2>/dev/null) == "OK" ]] ||
+       [[ $(print env_hit | $SHELL -E 2>&1) == "OK" ]] ||
                err_exit '-E ignores $ENV file'
-       [[ $(print env_hit | $SHELL +E 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | $SHELL +E 2>&1) == "OK" ]] &&
                err_exit '+E reads $ENV file'
-       [[ $(print env_hit | $SHELL --rc 2>/dev/null) == "OK" ]] ||
+       [[ $(print env_hit | $SHELL --rc 2>&1) == "OK" ]] ||
                err_exit '--rc ignores $ENV file'
-       [[ $(print env_hit | $SHELL --norc 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | $SHELL --norc 2>&1) == "OK" ]] &&
                err_exit '--norc reads $ENV file'
-       [[ $(print env_hit | $SHELL -i 2>/dev/null) == "OK" ]] ||
+       [[ $(print env_hit | $SHELL -i 2>&1) == "OK" ]] ||
                err_exit '-i ignores $ENV file'
 fi
 
@@ -82,26 +105,26 @@
 export ENV=
 if     [[ -o privileged ]]
 then
-       [[ $(print env_hit | HOME=$tmp $SHELL 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | HOME=$tmp $SHELL 2>&1) == "OK" ]] &&
                err_exit 'privileged nointeractive shell reads $HOME/.kshrc 
file'
-       [[ $(print env_hit | HOME=$tmp $SHELL -E 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | HOME=$tmp $SHELL -E 2>&1) == "OK" ]] &&
                err_exit 'privileged -E ignores empty $ENV'
-       [[ $(print env_hit | HOME=$tmp $SHELL +E 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | HOME=$tmp $SHELL +E 2>&1) == "OK" ]] &&
                err_exit 'privileged +E reads $HOME/.kshrc file'
-       [[ $(print env_hit | HOME=$tmp $SHELL --rc 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | HOME=$tmp $SHELL --rc 2>&1) == "OK" ]] &&
                err_exit 'privileged --rc ignores empty $ENV'
-       [[ $(print env_hit | HOME=$tmp $SHELL --norc 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | HOME=$tmp $SHELL --norc 2>&1) == "OK" ]] &&
                err_exit 'privileged --norc reads $HOME/.kshrc file'
 else
-       [[ $(print env_hit | HOME=$tmp $SHELL 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | HOME=$tmp $SHELL 2>&1) == "OK" ]] &&
                err_exit 'nointeractive shell reads $HOME/.kshrc file'
-       [[ $(print env_hit | HOME=$tmp $SHELL -E 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | HOME=$tmp $SHELL -E 2>&1) == "OK" ]] &&
                err_exit '-E ignores empty $ENV'
-       [[ $(print env_hit | HOME=$tmp $SHELL +E 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | HOME=$tmp $SHELL +E 2>&1) == "OK" ]] &&
                err_exit '+E reads $HOME/.kshrc file'
-       [[ $(print env_hit | HOME=$tmp $SHELL --rc 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | HOME=$tmp $SHELL --rc 2>&1) == "OK" ]] &&
                err_exit '--rc ignores empty $ENV'
-       [[ $(print env_hit | HOME=$tmp $SHELL --norc 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | HOME=$tmp $SHELL --norc 2>&1) == "OK" ]] &&
                err_exit '--norc reads $HOME/.kshrc file'
 fi
 
@@ -108,36 +131,35 @@
 unset ENV
 if     [[ -o privileged ]]
 then
-       [[ $(print env_hit | HOME=$tmp $SHELL 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | HOME=$tmp $SHELL 2>&1) == "OK" ]] &&
                err_exit 'privileged nointeractive shell reads $HOME/.kshrc 
file'
-       [[ $(print env_hit | HOME=$tmp $SHELL -E 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | HOME=$tmp $SHELL -E 2>&1) == "OK" ]] &&
                err_exit 'privileged -E reads $HOME/.kshrc file'
-       [[ $(print env_hit | HOME=$tmp $SHELL +E 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | HOME=$tmp $SHELL +E 2>&1) == "OK" ]] &&
                err_exit 'privileged +E reads $HOME/.kshrc file'
-       [[ $(print env_hit | HOME=$tmp $SHELL --rc 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | HOME=$tmp $SHELL --rc 2>&1) == "OK" ]] &&
                err_exit 'privileged --rc reads $HOME/.kshrc file'
-       [[ $(print env_hit | HOME=$tmp $SHELL --norc 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | HOME=$tmp $SHELL --norc 2>&1) == "OK" ]] &&
                err_exit 'privileged --norc reads $HOME/.kshrc file'
 else
-       [[ $(print env_hit | HOME=$tmp $SHELL 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | HOME=$tmp $SHELL 2>&1) == "OK" ]] &&
                err_exit 'nointeractive shell reads $HOME/.kshrc file'
-       [[ $(print env_hit | HOME=$tmp $SHELL -E 2>/dev/null) == "OK" ]] ||
+       [[ $(print env_hit | HOME=$tmp $SHELL -E 2>&1) == "OK" ]] ||
                err_exit '-E ignores $HOME/.kshrc file'
-       [[ $(print env_hit | HOME=$tmp $SHELL +E 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | HOME=$tmp $SHELL +E 2>&1) == "OK" ]] &&
                err_exit '+E reads $HOME/.kshrc file'
-       [[ $(print env_hit | HOME=$tmp $SHELL --rc 2>/dev/null) == "OK" ]] ||
+       [[ $(print env_hit | HOME=$tmp $SHELL --rc 2>&1) == "OK" ]] ||
                err_exit '--rc ignores $HOME/.kshrc file'
-       [[ $(print env_hit | HOME=$tmp $SHELL --norc 2>/dev/null) == "OK" ]] &&
+       [[ $(print env_hit | HOME=$tmp $SHELL --norc 2>&1) == "OK" ]] &&
                err_exit '--norc reads $HOME/.kshrc file'
 fi
 
-rm -rf $tmp
+rm -rf $tmp/.kshrc
 
 if     command set -G 2> /dev/null
-then   mkdir /tmp/ksh$$
-       cd /tmp/ksh$$
+then   cd $tmp
        mkdir bar foo
-       > bar.c  > bam.c
+       > bar.c > bam.c
        > bar/foo.c > bar/bam.c
        > foo/bam.c
        set -- **.c
@@ -157,50 +179,49 @@
        [[ $* == $expected ]] ||
                err_exit "-G **/bam.c failed -- expected '$expected', got '$*'"
        cd ~-
-       rm -rf /tmp/ksh$$
 fi
 
-mkdir /tmp/ksh$$
-cd /tmp/ksh$$
+cd $tmp
 t="<$$>.profile.<$$>"
 echo "echo '$t'" > .profile
 cp $SHELL ./-ksh
 if     [[ -o privileged ]]
 then
-       [[ $(HOME=$PWD $SHELL -l </dev/null 2>/dev/null) == *$t* ]] &&
+       [[ $(HOME=$PWD $SHELL -l </dev/null 2>&1) == *$t* ]] &&
                err_exit 'privileged -l reads .profile'
-       [[ $(HOME=$PWD $SHELL --login </dev/null 2>/dev/null) == *$t* ]] &&
+       [[ $(HOME=$PWD $SHELL --login </dev/null 2>&1) == *$t* ]] &&
                err_exit 'privileged --login reads .profile'
-       [[ $(HOME=$PWD $SHELL --login-shell </dev/null 2>/dev/null) == *$t* ]] 
&&
+       [[ $(HOME=$PWD $SHELL --login-shell </dev/null 2>&1) == *$t* ]] &&
                err_exit 'privileged --login-shell reads .profile'
-       [[ $(HOME=$PWD $SHELL --login_shell </dev/null 2>/dev/null) == *$t* ]] 
&&
+       [[ $(HOME=$PWD $SHELL --login_shell </dev/null 2>&1) == *$t* ]] &&
                err_exit 'privileged --login_shell reads .profile'
-       [[ $(HOME=$PWD exec -a -ksh $SHELL </dev/null 2>/dev/null) == *$t* ]]  
&&
+       [[ $(HOME=$PWD exec -a -ksh $SHELL </dev/null 2>&1) == *$t* ]] &&
                err_exit 'privileged exec -a -ksh ksh reads .profile'
-       [[ $(HOME=$PWD ./-ksh -i </dev/null 2>/dev/null) == *$t* ]] &&
+       [[ $(HOME=$PWD ./-ksh -i </dev/null 2>&1) == *$t* ]] &&
                err_exit 'privileged ./-ksh reads .profile'
-       [[ $(HOME=$PWD ./-ksh -ip </dev/null 2>/dev/null) == *$t* ]] &&
+       [[ $(HOME=$PWD ./-ksh -ip </dev/null 2>&1) == *$t* ]] &&
                err_exit 'privileged ./-ksh -p reads .profile'
 else
-       [[ $(HOME=$PWD $SHELL -l </dev/null 2>/dev/null) == *$t* ]] ||
+       [[ $(HOME=$PWD $SHELL -l </dev/null 2>&1) == *$t* ]] ||
                err_exit '-l ignores .profile'
-       [[ $(HOME=$PWD $SHELL --login </dev/null 2>/dev/null) == *$t* ]] ||
+       [[ $(HOME=$PWD $SHELL --login </dev/null 2>&1) == *$t* ]] ||
                err_exit '--login ignores .profile'
-       [[ $(HOME=$PWD $SHELL --login-shell </dev/null 2>/dev/null) == *$t* ]] 
||
+       [[ $(HOME=$PWD $SHELL --login-shell </dev/null 2>&1) == *$t* ]] ||
                err_exit '--login-shell ignores .profile'
-       [[ $(HOME=$PWD $SHELL --login_shell </dev/null 2>/dev/null) == *$t* ]] 
||
+       [[ $(HOME=$PWD $SHELL --login_shell </dev/null 2>&1) == *$t* ]] ||
                err_exit '--login_shell ignores .profile'
-       [[ $(HOME=$PWD exec -a -ksh $SHELL </dev/null 2>/dev/null) == *$t* ]]  
||
-               err_exit 'exec -a -ksh ksh ignores .profile'
-       [[ $(HOME=$PWD ./-ksh -i </dev/null 2>/dev/null) == *$t* ]] ||
+       [[ $(HOME=$PWD exec -a -ksh $SHELL </dev/null 2>/dev/null) == *$t* ]] ||
+               err_exit 'exec -a -ksh ksh 2>/dev/null ignores .profile'
+       [[ $(HOME=$PWD exec -a -ksh $SHELL </dev/null 2>&1) == *$t* ]] ||
+               err_exit 'exec -a -ksh ksh 2>&1 ignores .profile'
+       [[ $(HOME=$PWD ./-ksh -i </dev/null 2>&1) == *$t* ]] ||
                err_exit './-ksh ignores .profile'
-       [[ $(HOME=$PWD ./-ksh -ip </dev/null 2>/dev/null) == *$t* ]] &&
+       [[ $(HOME=$PWD ./-ksh -ip </dev/null 2>&1) == *$t* ]] &&
                err_exit './-ksh -p does not ignore .profile'
 fi
 cd ~-
-rm -rf /tmp/ksh$$
+rm -rf $tmp/.profile
 
-
 # { exec interactive login_shell restricted xtrace } in the following test
 
 for opt in \
@@ -333,13 +354,47 @@
 state=$(set --state)
 [[ $state == "set $restore" ]] || err_exit "set --state after restore failed: 
expected 'set $restore', got '$state'"
 
-false | true | true   || err_exit 'pipe not exiting exit value of last element'
-true | true | false   && err_exit 'pipe not exiting false'
-set -o pipefail
-false | true | true    && err_exit 'pipe with first not failing with pipefail'
-true | false | true    && err_exit 'pipe middle not failing with pipefail'
-true | true | false    && err_exit 'pipe last not failing with pipefail'
-print hi | (sleep 1;/bin/cat) > /dev/null || err_exit 'pipeline fails with 
pipefail' 
+typeset -a pipeline
+pipeline=(
+       ( nopipefail=0 pipefail=1 command='false|true|true' )
+       ( nopipefail=0 pipefail=1 command='true|false|true' )
+       ( nopipefail=1 pipefail=1 command='true|true|false' )
+       ( nopipefail=1 pipefail=1 command='false|false|false' )
+       ( nopipefail=0 pipefail=0 command='true|true|true' )
+       ( nopipefail=0 pipefail=0 command='print hi|(sleep 
1;/bin/cat)>/dev/null' )
+)
+set --nopipefail
+for ((i = 0; i < ${#pipeli...@]}; i++ ))
+do     eval ${pipeline[i].command}
+       status=$?
+       expected=${pipeline[i].nopipefail}
+       [[ $status == $expected ]] ||
+       err_exit "--nopipefail '${pipeline[i].command}' exit status $status -- 
expected $expected"
+done
+ftt=0
+set --pipefail
+for ((i = 0; i < ${#pipeli...@]}; i++ ))
+do     eval ${pipeline[i].command}
+       status=$?
+       expected=${pipeline[i].pipefail}
+       if      [[ $status != $expected ]]
+       then    err_exit "--pipefail '${pipeline[i].command}' exit status 
$status -- expected $expected"
+               (( i == 0 )) && ftt=1
+       fi
+done
+if     (( ! ftt ))
+then   exp=10
+       got=$(for((n=1;n<exp;n++))do $SHELL --pipefail -c '(sleep 
0.1;false)|true|true' && break; done; print $n)
+       [[ $got == $exp ]] || err_exit "--pipefail -c '(sleep 
0.1;false)|true|true' fails with exit status 0 (after $got/$exp iterations)"
+fi
+
+echo=$(whence -p echo)
+for ((i=0; i < 20; i++))
+do     if      ! x=$(true | $echo 123)
+       then    err_exit 'command substitution with wrong exit status with 
pipefai'
+               break
+       fi
+done
 (
        set -o pipefail
        false | true
@@ -346,31 +401,85 @@
        (( $? )) || err_exit 'pipe not failing in subshell with pipefail'
 ) | wc >/dev/null
 $SHELL -c 'set -o pipefail; false | $(whence -p true);' && err_exit 'pipefail 
not returning failure with sh -c'
-[[ $( set -o pipefail
+exp='1212 or 1221'
+got=$(
+       set --pipefail
        pipe() { date | cat > /dev/null ;}
        print $'1\n2' |
-       while   read i 
-       do      if      pipe /tmp
-               then    { print enter $i; sleep 2; print leave $i; } &
+       while   read i
+       do      if      pipe $tmp
+               then    { print -n $i; sleep 2; print -n $i; } &
                fi
        done
-       wait) == $'enter 1\nenter 2'* ]] || err_exit  '& job delayed by 
pipefail'
-$SHELL -c '[[ $- == *c* ]]' || err_exit  'option c not in $-'
-trap 'rm -f /tmp/.profile' EXIT
-> /tmp/.profile
-for i in  i l r s D E a b e f h k n r t u v  x B C G H
-do     HOME=/tmp ENV= $SHELL -$i  2> /dev/null <<- ++EOF++ || err_exit "option 
$i not in \$-"
-       [[ \$- == *$i* ]]  ||   exit 1
+       wait
+)
+[[ $got == @((12|21)(12|21)) ]] || err_exit "& job delayed by --pipefail, 
expected '$exp', got '$got'"
+$SHELL -c '[[ $- == *c* ]]' || err_exit 'option c not in $-'
+> $tmp/.profile
+for i in i l r s D E a b e f h k n t u v x B C G H
+do     HOME=$tmp ENV= $SHELL -$i >/dev/null 2>&1 <<- ++EOF++ || err_exit 
"option $i not in \$-"
+       [[ \$- == *$i* ]] || exit 1
        ++EOF++
 done
 letters=ilrabefhknuvxBCGE
 integer j=0
-for i in  interactive login restricted allexport notify errexit \
-       noglob  trackall keyword noexec nounset verbose xtrace braceexpand \
+for i in interactive login restricted allexport notify errexit \
+       noglob trackall keyword noexec nounset verbose xtrace braceexpand \
        noclobber globstar rc
-do     HOME=/tmp ENV= $SHELL   -o $i  2> /dev/null <<- ++EOF++ || err_exit 
"option $i not equivalent to ${letters:j:1}"
-       [[ \$- == *${letters:j:1}* ]]  ||   exit 1
+do     HOME=$tmp ENV= $SHELL -o $i >/dev/null 2>&1 <<- ++EOF++ || err_exit 
"option $i not equivalent to ${letters:j:1}"
+       [[ \$- == *${letters:j:1}* ]] || exit 1
        ++EOF++
        ((j++))
 done
+
+export ENV=
+histfile=$tmp/history
+exp=$(HISTFILE=$histfile $SHELL -c $'function foo\n{\ncat\n}\ntype foo')
+for var in HISTSIZE HISTFILE
+do     got=$( ( HISTFILE=$histfile $SHELL -ic $'unset '$var$'\nfunction 
foo\n{\ncat\n}\ntype foo\nexit' ) 2>&1 )
+       got=${got##*': '} 
+       [[ $got == "$exp" ]] || err_exit "function definition inside (...) with 
$var unset fails -- got '$got', expected '$exp'"
+       got=$( { HISTFILE=$histfile $SHELL -ic $'unset '$var$'\nfunction 
foo\n{\ncat\n}\ntype foo\nexit' ;} 2>&1 )
+       got=${got##*': '} 
+       [[ $got == "$exp" ]] || err_exit "function definition inside {...;} 
with $var unset fails -- got '$got', expected '$exp'"
+done
+( unset HISTFILE; $SHELL -ic "HISTFILE=$histfile" 2>/dev/null ) || err_exit 
"setting HISTFILE when not in environment fails"
+
+# the next tests loop on all combinations of
+#      { SUB PAR CMD ADD }
+
+SUB=(
+       ( BEG='$( '     END=' )'        )
+       ( BEG='${ '     END='; }'       )
+)
+PAR=(
+       ( BEG='( '      END=' )'        )
+       ( BEG='{ '      END='; }'       )
+)
+CMD=(  command-kill    script-kill     )
+ADD=(  ''              '; :'           )
+
+cd $tmp
+print $'#!'$SHELL$'\nkill -KILL $$' > command-kill
+print $'kill -KILL $$' > script-kill
+chmod +x command-kill script-kill
+export PATH=.:$PATH
+exp='Killed'
+for ((S=0; S<${#s...@]}; S++))
+do     for ((P=0; P<${#p...@]}; P++))
+       do      for ((C=0; C<${#c...@]}; C++))
+               do      for ((A=0; A<${#a...@]}; A++))
+                       do      
cmd="${SUB[S].BEG}${PAR[P].BEG}${CMD[C]}${PAR[P].END} 
2>&1${ADD[A]}${SUB[S].END}"
+                               eval got="$cmd"
+                               got=${got##*': '}
+                               got=${got%%'('*}
+                               [[ $got == "$exp" ]] || err_exit "$cmd failed 
-- got '$got', expected '$exp'"
+                       done
+               done
+       done
+done
+
+$SHELL 2> /dev/null -c '{; true ;}' || err_exit 'leading ; causes syntax error 
in brace group'
+$SHELL 2> /dev/null -c '(; true ;)' || err_exit 'leading ; causes syntax error 
in parenthesis group'
+
 exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/path.sh       Fri Sep 25 06:38:15 2009
+++ new/usr/src/lib/libshell/common/tests/path.sh       Fri Sep 25 06:38:13 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -24,12 +24,14 @@
        let Errors+=1
 }
 alias err_exit='err_exit $LINENO'
+
 Command=${0##*/}
 integer Errors=0
 
-mkdir /tmp/ksh$$
-cd /tmp/ksh$$
-trap "PATH=$PATH; cd /; rm -rf /tmp/ksh$$" EXIT
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
+cd $tmp || exit
 type /xxxxxx > out1 2> out2
 [[ -s out1 ]] && err_exit 'type should not write on stdout for not found case'
 [[ -s out2 ]] || err_exit 'type should write on stderr for not found case'
@@ -69,22 +71,21 @@
 PATH=$p
 (PATH="/bin")
 [[ $($SHELL -c 'print -r -- "$PATH"') == "$PATH" ]] || err_exit 'export PATH 
lost in subshell'
-cat > bug1 <<- \EOF
-       print print ok > /tmp/ok$$
-       /bin/chmod 755 /tmp/ok$$
-       trap 'cd /; rm -f /tmp/ok$$' EXIT
+cat > bug1 <<- EOF
+       print print ok > $tmp/ok
+       /bin/chmod 755 $tmp/ok
        function a
        {
-               typeset -x PATH=/tmp
-               ok$$
+               typeset -x PATH=$tmp
+               ok
        }
-       path=$PATH
+       path=\$PATH
        unset PATH
        a
-       PATH=$path
+       PATH=\$path
 }
 EOF
-[[ $($SHELL ./bug1  2> /dev/null) == ok ]]  || err_exit "PATH in function not 
working"
+[[ $($SHELL ./bug1 2>/dev/null) == ok ]]  || err_exit "PATH in function not 
working"
 cat > bug1 <<- \EOF
        function lock_unlock
        {
@@ -91,7 +92,7 @@
        typeset PATH=/usr/bin
        typeset -x PATH=''
        }
-       
+
        PATH=/usr/bin
        : $(PATH=/usr/bin getconf PATH)
        typeset -ft lock_unlock
@@ -98,8 +99,8 @@
        lock_unlock
 EOF
 ($SHELL ./bug1)  2> /dev/null || err_exit "path_delete bug"
-mkdir tdir$$
-if     $SHELL tdir$$ > /dev/null 2>&1
+mkdir tdir
+if     $SHELL tdir > /dev/null 2>&1
 then   err_exit 'not an error to run ksh on a directory'
 fi
 
@@ -121,7 +122,7 @@
 dir=$(basename "$var")
 for i in 1 2 3 4 5 6 7 8 9 0
 do     if      ! whence notfound$i 2> /dev/null
-       then    cmd=notfound$i          
+       then    cmd=notfound$i
                break
        fi
 done
@@ -132,7 +133,7 @@
 > foo
 chmod 755 foo
 for PATH in $path :$path $path: .:$path $path: $path:. $PWD::$path 
$PWD:.:$path $path:$PWD $path:.:$PWD
-do     
+do
 #      print path=$PATH $(whence date)
 #      print path=$PATH $(whence "$cmd")
                date
@@ -166,8 +167,8 @@
 [[ $(whence "$PWD/foo") != "$PWD/foo" ]] && err_exit 'whence $PWD/foo not 
working'
 [[ $(whence ./xxxxx) ]] && err_exit 'whence ./xxxx not working'
 PATH=$d:
-cp "$rm" kshrm$$
-if     [[ $(whence kshrm$$) != $PWD/kshrm$$  ]]
+cp "$rm" kshrm
+if     [[ $(whence kshrm) != $PWD/kshrm  ]]
 then   err_exit 'trailing : in pathname not working'
 fi
 cp "$rm" rm
@@ -196,7 +197,7 @@
        then    err_exit 'unsetting path  not working'
        fi
 fi
-PATH=/dev:/tmp/ksh$$
+PATH=/dev:$tmp
 x=$(whence rm)
 typeset foo=$(PATH=/xyz:/abc :)
 y=$(whence rm)
@@ -212,11 +213,11 @@
 [[ $(whence ls) == "$x" ]] || err_exit 'PATH search bug when :$PWD:. in path'
 cd   "${x%/ls}"
 [[ $(whence ls) == /* ]] || err_exit 'whence not generating absolute pathname'
-status=$($SHELL -c $'trap \'print $?\' EXIT;/a/b/c/d/e 2> /dev/null')
+status=$($SHELL -c $'trap \'print $?\' EXIT;/xxx/a/b/c/d/e 2> /dev/null')
 [[ $status == 127 ]] || err_exit "not found command exit status $status -- 
expected 127"
 status=$($SHELL -c $'trap \'print $?\' EXIT;/dev/null 2> /dev/null')
 [[ $status == 126 ]] || err_exit "non executable command exit status $status 
-- expected 126"
-status=$($SHELL -c $'trap \'print $?\' ERR;/a/b/c/d/e 2> /dev/null')
+status=$($SHELL -c $'trap \'print $?\' ERR;/xxx/a/b/c/d/e 2> /dev/null')
 [[ $status == 127 ]] || err_exit "not found command with ERR trap exit status 
$status -- expected 127"
 status=$($SHELL -c $'trap \'print $?\' ERR;/dev/null 2> /dev/null')
 [[ $status == 126 ]] || err_exit "non executable command ERR trap exit status 
$status -- expected 126"
@@ -231,7 +232,7 @@
 
 PATH=$path
 
-scr=/tmp/ksh$$/foo
+scr=$tmp/script
 exp=126
 
 : > $scr
--- old/usr/src/lib/libshell/common/tests/pointtype.sh  Fri Sep 25 06:38:18 2009
+++ new/usr/src/lib/libshell/common/tests/pointtype.sh  Fri Sep 25 06:38:16 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
--- old/usr/src/lib/libshell/common/tests/quoting.sh    Fri Sep 25 06:38:21 2009
+++ new/usr/src/lib/libshell/common/tests/quoting.sh    Fri Sep 25 06:38:19 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -212,12 +212,12 @@
 foo=bar
 bar=$(print -r -- ${foo+\\n\ })
 if     [[ $bar != '\n ' ]]
-then   err_exit '${foo+\\n\ } expansion error' 
+then   err_exit '${foo+\\n\ } expansion error'
 fi
 unset bar
 bar=$(print -r -- ${foo+\\n\ $bar})
 if     [[ $bar != '\n ' ]]
-then   err_exit '${foo+\\n\ $bar} expansion error with bar unset' 
+then   err_exit '${foo+\\n\ $bar} expansion error with bar unset'
 fi
 x='\\(..\\)|&\|\|\\&\\|'
 if     [[ $(print -r -- $x) != "$x" ]]
@@ -326,7 +326,7 @@
 {
 x=x
 x=${x:-`id | sed 's/^[^(]*(\([^)]*\)).*/\1/'`}
-} 2> /dev/null || err_exit 'skipping over `` failed' 
+} 2> /dev/null || err_exit 'skipping over `` failed'
 [[ $x == x ]] || err_exit 'assignment ${x:=`...`} failed'
 [[ $($SHELL -c 'print a[') == 'a[' ]] || err_exit "unbalanced '[' in command 
arg fails"
 $SHELL -c $'false && (( `wc -l /dev/null | nawk \'{print $1}\'` > 2 )) && 
true;:' 2> /dev/null ||  err_exit 'syntax error with ` in arithmetic expression'
@@ -334,4 +334,9 @@
 varname=foobarx
 x=`print '"\$'${varname}'"'`
 [[ $x == '"$foobarx"' ]] ||  err_exit $'\\$\' not handled correctly inside ``'
+
+copy1=5 copynum=1
+foo="`eval echo "$"{copy$copynum"-0}"`"
+[[ $foo == "$copy1" ]] || err_exit '$"..." not being ignored inside ``'
+
 exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/quoting2.sh   Fri Sep 25 06:38:24 2009
+++ new/usr/src/lib/libshell/common/tests/quoting2.sh   Fri Sep 25 06:38:22 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -197,11 +197,13 @@
 [[ "$" == '$' ]] || err_exit '"$" != $'
 [[ "${foo}$" == 'foo$' ]] || err_exit 'foo=foo;"${foo}$" != foo$'
 [[ "${foo}${foo}$" == 'foofoo$' ]] || err_exit 'foo=foo;"${foo}${foo}$" != 
foofoo$'
-foo='$ ' 
+foo='$ '
 [[ "$foo" == ~(Elr)(\\\$|#)\  ]] || err_exit $'\'$ \' not matching RE 
\\\\\\$|#\''
-[[ "$foo" == ~(Elr)('\$'|#)\  ]] || err_exit $'\'$ \' not matching RE 
\'\\$\'|#\'' 
+[[ "$foo" == ~(Elr)('\$'|#)\  ]] || err_exit $'\'$ \' not matching RE 
\'\\$\'|#\''
 foo='# '
-[[ "$foo" == ~(Elr)(\\\$|#)\  ]] || err_exit $'\'# \' not matching RE 
\\'\$|#\'' 
+[[ "$foo" == ~(Elr)(\\\$|#)\  ]] || err_exit $'\'# \' not matching RE 
\\'\$|#\''
 [[ "$foo" == ~(Elr)('\$'|#)\  ]] || err_exit $'\'# \' not matching RE 
\'\\$\'|#\''
 [[ '\$' == '\$'* ]] ||   err_exit $'\'\\$\' not matching \'\\$\'*'
+[[ a+a == ~(E)a\+a ]] || err_exit '~(E)a\+a not matching a+a'
+[[ a+a =~ a\+a ]] || err_exit 'RE a\+a not matching a+a'
 exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/recttype.sh   Fri Sep 25 06:38:27 2009
+++ new/usr/src/lib/libshell/common/tests/recttype.sh   Fri Sep 25 06:38:25 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
--- old/usr/src/lib/libshell/common/tests/restricted.sh Fri Sep 25 06:38:30 2009
+++ new/usr/src/lib/libshell/common/tests/restricted.sh Fri Sep 25 06:38:28 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -25,11 +25,13 @@
 }
 alias err_exit='err_exit $LINENO'
 
-# test restricted shell
 Command=${0##*/}
 integer Errors=0
-mkdir  /tmp/ksh$$ || err_exit "mkdir /tmp/ksh$$ failed" 
-trap "cd /; rm -rf /tmp/ksh$$" EXIT
+
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
+# test restricted shell
 pwd=$PWD
 case $SHELL in
 /*)    ;;
@@ -40,14 +42,14 @@
 {
        rm -f out
        rksh -c "$@" 2> out > /dev/null
-       grep restricted out  > /dev/null 2>&1 
+       grep restricted out  > /dev/null 2>&1
 }
 
 [[ $SHELL != /* ]] && SHELL=$pwd/$SHELL
-cd /tmp/ksh$$ || err_exit "cd /tmp/ksh$$ failed"
+cd $tmp || err_exit "cd $tmp failed"
 ln -s $SHELL rksh
 PATH=$PWD:$PATH
-rksh -c  '[[ -o restricted ]]' || err_exit 'restricted option not set' 
+rksh -c  '[[ -o restricted ]]' || err_exit 'restricted option not set'
 [[ $(rksh -c 'print hello') == hello ]] || err_exit 'unable to run print'
 check_restricted /bin/echo || err_exit '/bin/echo not resticted'
 check_restricted ./echo || err_exit './echo not resticted'
@@ -74,4 +76,7 @@
 !
 ! check_restricted 'script;:' ||  err_exit 'script with #! pathname should run 
in restricted mode'
 ! check_restricted 'script' ||  err_exit 'script with #! pathname should run 
in restricted mode even if last command in script'
+for i in PATH ENV FPATH
+do     check_restricted  "function foo { typeset $i=foobar;};foo" || err_exit 
"$i can be changed in function by using typeset"
+done
 exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/return.sh     Fri Sep 25 06:38:33 2009
+++ new/usr/src/lib/libshell/common/tests/return.sh     Fri Sep 25 06:38:31 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -26,14 +26,17 @@
        let Errors+=1
 }
 alias err_exit='err_exit $LINENO'
+
 Command=${0##*/}
 integer Errors=0
 
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
 unset HISTFILE
 
 foo=NOVAL bar=NOVAL
-file=/tmp/shtest$$
-trap "rm -f $file" EXIT INT
+file=$tmp/test
 function foo
 {
        typeset foo=NOEXIT
@@ -125,7 +128,7 @@
 fi
 cat > $file <<!
 : line 1
-# next line should fail and cause an exit 
+# next line should fail and cause an exit
 : > /
 exit 4
 !
--- old/usr/src/lib/libshell/common/tests/select.sh     Fri Sep 25 06:38:36 2009
+++ new/usr/src/lib/libshell/common/tests/select.sh     Fri Sep 25 06:38:34 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -27,10 +27,13 @@
 
 Command=${0##*/}
 integer Errors=0
-trap "rm -f /tmp/Sh$$*" EXIT
+
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
 PS3='ABC '
 
-cat > /tmp/Sh$$.1 <<\!
+cat > $tmp/1 <<\!
 1) foo
 2) bar
 3) bam
@@ -57,7 +60,7 @@
                ( set -u; : $i ) || err_exit "select: i not set to null" 2>&3
                break;;
        esac
-done  3>&2 2> /tmp/Sh$$.2 <<!
+done  3>&2 2> $tmp/2 <<!
 foo
 !
 exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/shtests       Fri Sep 25 06:38:38 2009
+++ new/usr/src/lib/libshell/common/tests/shtests       Fri Sep 25 06:38:37 2009
@@ -1,13 +1,15 @@
 # This program runs ksh regression tests
 # shtests [ name=value ... ] [ --all | --compile ] [ --time ] [ a.sh b.sh ... ]
 
-unset DISPLAY ENV FIGNORE
+timesensitive='*@(options|sigchld|subshell).sh'
+
+unset DISPLAY ENV FIGNORE HISTFILE
 LANG=C
 LC_ALL=C
 compile=1
 script=1
 time=1
-vmdebug=1
+vmdebug=a
 while  :
 do     case $1 in
        -a|--a*)compile=2
@@ -38,9 +40,11 @@
 done
 if     [[ ! $vmdebug ]]
 then   unset VMDEBUG
-elif   [[ ! $VMDEBUG ]]
-then   export VMDEBUG=a
+elif   [[ $VMDEBUG ]]
+then   vmdebug=$VMDEBUG
+else   export VMDEBUG=$vmdebug
 fi
+[[ $VMDEBUG ]] || timesensitive=.
 export LANG LC_ALL PATH PWD SHELL
 PWD=`pwd`
 SHELL=${SHELL-ksh}
@@ -65,9 +69,8 @@
 if     [[ $compile ]]
 then   SHCOMP=${SHCOMP:-shcomp}
        if      whence $SHCOMP > /dev/null
-       then    tmp=/tmp/ksh-$$
-               trap 'rm -rf $tmp' EXIT
-               mkdir $tmp || exit
+       then    tmp=$(mktemp -dt) || { echo mktemp -dt failed >&2; exit 1; }
+               trap "cd /; rm -rf $tmp" EXIT
        elif    [[ $compile != 1 ]]
        then    echo $0: --compile: $SHCOMP not found >&2
                exit 1
@@ -88,6 +91,9 @@
        E=error
        if      [[ $script ]]
        then    echo test $i begins ${time:+"at $(date +%Y-%m-%d+%H:%M:%S)"}
+               if      [[ $i == $timesensitive ]]
+               then    unset VMDEBUG
+               fi
                if      $SHELL $i
                then    echo test $i passed ${time:+"at $(date 
+%Y-%m-%d+%H:%M:%S)"} "[ $t $T 0 ${E}s ]"
                else    e=$?
@@ -100,6 +106,9 @@
                        fi
                        echo test $i failed ${time:+"at $(date 
+%Y-%m-%d+%H:%M:%S)"} with exit code $e "[ $t $T $e $E ]"
                fi
+               if      [[ $i == $timesensitive ]]
+               then    export VMDEBUG=$vmdebug
+               fi
        fi
 done
 if     [[ $compile ]]
@@ -114,7 +123,10 @@
                echo test $o begins ${time:+"at $(date +%Y-%m-%d+%H:%M:%S)"}
                E=error
                if      $SHCOMP $i > $tmp/$o
-               then    if      $SHELL $tmp/$o
+               then    if      [[ $i == $timesensitive ]]
+                       then    unset VMDEBUG
+                       fi
+                       if      $SHELL $tmp/$o
                        then    echo test $o passed ${time:+"at $(date 
+%Y-%m-%d+%H:%M:%S)"} "[ $t $T 0 ${E}s ]"
                        else    e=$?
                                if      (( e > 256 ))
@@ -126,6 +138,9 @@
                                fi
                                echo test $o failed ${time:+"at $(date 
+%Y-%m-%d+%H:%M:%S)"} with exit code $e "[ $t $T $e $E ]"
                        fi
+                       if      [[ $i == $timesensitive ]]
+                       then    export VMDEBUG=$vmdebug
+                       fi
                else    e=$?
                        t=1
                        T=test
--- old/usr/src/lib/libshell/common/tests/sigchld.sh    Fri Sep 25 06:38:41 2009
+++ new/usr/src/lib/libshell/common/tests/sigchld.sh    Fri Sep 25 06:38:40 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -59,7 +59,55 @@
 
 eval $s
 
-(( foreground == FOREGROUND )) || err_exit "expected $FOREGROUND foreground -- 
got $foreground (DELAY=$DELAY)"
-(( background == BACKGROUND )) || err_exit "expected $BACKGROUND background -- 
got $background (DELAY=$DELAY)"
+(( foreground == FOREGROUND )) || err_exit "expected '$FOREGROUND foreground' 
-- got '$foreground' (DELAY=$DELAY)"
+(( background == BACKGROUND )) || err_exit "expected '$BACKGROUND background' 
-- got '$background' (DELAY=$DELAY)"
 
+set --noerrexit
+
+if     [[ ${.sh.version} == Version?*([[:upper:]])J* ]]
+then
+
+       jobmax=4
+       got=$($SHELL -c '
+               JOBMAX='$jobmax' JOBCOUNT=$(('$jobmax'*2))
+               integer running=0 maxrunning=0
+               trap "((running--))" CHLD
+               for ((i=0; i<JOBCOUNT; i++))
+               do      sleep 1 &
+                       if      ((++running > maxrunning))
+                       then    ((maxrunning=running))
+                       fi
+               done
+               wait
+               print running=$running maxrunning=$maxrunning
+       ')
+       exp='running=0 maxrunning='$jobmax
+       [[ $got == $exp ]] || err_exit "SIGCHLD trap queueing failed -- 
expected '$exp', got '$got'"
+
+       got=$($SHELL -c '
+               typeset -A proc
+
+               trap "
+                       print \${proc[\$!].name} \${proc[\$!].status} \$?
+                       unset proc[\$!]
+               " CHLD
+
+               { sleep 3; print a; exit 1; } &
+               proc[$!]=( name=a status=1 )
+
+               { sleep 2; print b; exit 2; } &
+               proc[$!]=( name=b status=2 )
+
+               { sleep 1; print c; exit 3; } &
+               proc[$!]=( name=c status=3 )
+
+               while   (( ${#pr...@]} ))
+               do      sleep -s
+               done
+       ')
+       exp='c\nc 3 3\nb\nb 2 2\na\na 1 1'
+       [[ $got == $exp ]] || err_exit "SIGCHLD trap queueing failed -- 
expected $(printf %q "$exp"), got $(printf %q "$got")"
+
+fi
+
 exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/signal.sh     Fri Sep 25 06:38:44 2009
+++ new/usr/src/lib/libshell/common/tests/signal.sh     Fri Sep 25 06:38:42 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -28,14 +28,39 @@
 Command=${0##*/}
 integer Errors=0
 
-mkdir /tmp/ksh$$ || err_exit "mkdir /tmp/ksh$$ failed"
-trap 'cd /; rm -rf /tmp/ksh$$' EXIT
-cd /tmp/ksh$$ || err_exit "cd /tmp/ksh$$ failed"
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
 
+cd $tmp || err_exit "cd $tmp failed"
+
+(
+       set --pipefail
+       {
+               $SHELL 2> out2 <<- \EOF
+                       g=false
+                       trap 'print -u2 PIPED; $g && exit 0;g=true' PIPE
+                       while :
+                       do      print hello
+                       done
+               EOF
+       } | head > /dev/null
+       (( $? == 0)) ||   err_exit "SIGPIPE with wrong error code $?"
+       [[ $(<out2) == $'PIPED\nPIPED' ]] || err_exit 'SIGPIPE output on 
standard error is not correct'
+) &
+cop=$!
+{ sleep 4; kill $cop; } 2>/dev/null &
+spy=$!
+if     wait $cop 2>/dev/null
+then   kill $spy 2>/dev/null
+else   err_exit "pipe with --pipefail PIPE trap hangs"
+fi
+wait
+rm -f out2
+
 [[ $( trap 'print -n got_child' SIGCHLD
        sleep 2 &
        for     ((i=0; i < 4; i++))
-       do      sleep .9
+       do      sleep .75
                print -n $i
        done) == 01got_child23 ]] || err_exit 'SIGCHLD not working'
 
@@ -55,7 +80,8 @@
 #
 #     d call next script directly, otherwise via $SHELL -c
 #     t trap, echo, and kill self on SIGINT, otherwise x or SIGINT default if 
no x
-#     x trap, echo on SIGINT, and exit 0, otherwise SIGINT default
+#     x trap, echo on SIGINT, and tst-3 exit 0, tst-2 exit, otherwise SIGINT 
default
+#     z trap, echo on SIGINT, and tst-3 exit 0, tst-2 exit 0, otherwise SIGINT 
default
 #
 # Usage: tst [-v] [-options] shell-to-test ...
 
@@ -71,7 +97,7 @@
 function gen
 {
        typeset o t x d
-       for x in - x
+       for x in - x z
        do      case $x in
                [$1])   for t in - t
                        do      case $t in
@@ -153,6 +179,11 @@
 !
 cat > tst-2 <<'!'
 case $1 in
+*z*)   trap '
+               echo 2-intr
+               exit 0
+       ' INT
+       ;;
 *x*)   trap '
                echo 2-intr
                exit
@@ -176,7 +207,7 @@
 !
 cat > tst-3 <<'!'
 case $1 in
-*x*)   trap '
+*[xz]*)        trap '
                sleep 2
                echo 3-intr
                exit 0
@@ -206,10 +237,14 @@
 expected[--d]="3-intr"
 expected[-t-]="3-intr 2-intr 1-intr 1-0258"
 expected[-td]="3-intr 2-intr 1-intr 1-0258"
-expected[x--]="3-intr 2-intr 1-0000"
-expected[x-d]="3-intr 2-intr 1-0000"
-expected[xt-]="3-intr 2-intr 1-intr 1-0000"
-expected[xtd]="3-intr 2-intr 1-intr 1-0000"
+expected[x--]="3-intr 2-intr"
+expected[x-d]="3-intr 2-intr"
+expected[xt-]="3-intr 2-intr 1-intr 1-0258"
+expected[xtd]="3-intr 2-intr 1-intr 1-0258"
+expected[z--]="3-intr 2-intr 1-0000"
+expected[z-d]="3-intr 2-intr 1-0000"
+expected[zt-]="3-intr 2-intr 1-intr 1-0000"
+expected[ztd]="3-intr 2-intr 1-intr 1-0000"
 
 tst $SHELL > tst.got
 
@@ -218,9 +253,71 @@
 done < tst.got
 
 float s=$SECONDS
-[[ $($SHELL -c 'trap "print SIGUSR1 ; exit 0" USR1; (trap "" USR1 ; exec kill 
-USR1 $$ & sleep 5); print done') == SIGUSR1 ]] || err_exit 'subshell ignoring 
signal does not send signal to parent' 
+[[ $($SHELL -c 'trap "print SIGUSR1 ; exit 0" USR1; (trap "" USR1 ; exec kill 
-USR1 $$ & sleep 5); print done') == SIGUSR1 ]] || err_exit 'subshell ignoring 
signal does not send signal to parent'
 (( (SECONDS-s) < 4 )) && err_exit 'parent does not wait for child to complete 
before handling signal'
 ((s = SECONDS))
-[[ $($SHELL -c 'trap "print SIGUSR1 ; exit 0" USR1; (trap "exit" USR1 ; exec 
kill -USR1 $$ & sleep 5); print done') == SIGUSR1 ]] || err_exit 'subshell 
catching signal does not send signal to parent' 
+[[ $($SHELL -c 'trap "print SIGUSR1 ; exit 0" USR1; (trap "exit" USR1 ; exec 
kill -USR1 $$ & sleep 5); print done') == SIGUSR1 ]] || err_exit 'subshell 
catching signal does not send signal to parent'
 (( SECONDS-s < 4 )) && err_exit 'parent completes early'
+
+unset n s t
+for s in $(kill -l)
+do     if      ! n=$(kill -l $s 2>/dev/null)
+       then    err_exit "'kill -l $s' failed"
+               continue
+       fi
+       if      ! t=$(kill -l $n 2>/dev/null)
+       then    err_exit "'kill -l $n' failed"
+               continue
+       fi
+       if      [[ $s == ?(SIG)$t ]]
+       then    continue
+       fi
+       if      ! m=$(kill -l $t 2>/dev/null)
+       then    err_exit "'kill -l $t' failed"
+               continue
+       fi
+       if      [[ $m == $n ]]
+       then    continue
+       fi
+       err_exit "'kill -l $s' => $n, 'kill -l $n' => $t, kill -l $t => $m -- 
expected $n"
+done
+yes=$(whence -p yes)
+[[ $yes ]] && for exp in TERM VTALRM PIPE
+do { $SHELL <<- EOF
+               foo() { return 0; }
+               trap foo EXIT
+               { sleep 2; kill -$exp \$\$; sleep 1; kill -0 \$\$ && kill -KILL 
\$\$; } &
+               $yes | while read yes; do
+                       (/bin/date; sleep .1)
+               done > /dev/null
+       EOF
+    } 2>> /dev/null
+    got=$(kill -l $?)
+    [[ $exp == $got ]] || err_exit "kill -$exp \$\$ failed, required 
termination by signal '$got'"
+done
+
+SECONDS=0
+$SHELL 2> /dev/null -c 'sleep 2 && kill $$ & trap "print done;exit 3" EXIT; 
(sleep 5);print finished' > $tmp/sig
+(( $?==3)) || err_exit "wrong exit status expecting 3 got $?"
+x=$(<$tmp/sig)
+[[ $x == done ]] || err_exit "wrong result - execting done got $x"
+(( SECONDS > 3.5 )) && err_exit "took $SECONDS seconds, expecting around 2"
+
+SECONDS=0
+{ $SHELL 2> /dev/null -c 'sleep 2 && kill $$ & trap "print done;exit" EXIT; 
(sleep 5);print finished' > $tmp/sig ;} 2> /dev/null
+[[ $(kill -l $?) == TERM ]] || err_exit "wrong exit status expecting TERM got 
$(kill -l $?)"
+x=$(<$tmp/sig)
+[[ $x == done ]] || err_exit "wrong result - execting done got $x"
+(( SECONDS > 3.5 )) && err_exit "took $SECONDS seconds, expecting around 2"
+
+SECONDS=0
+x=$($SHELL 2> /dev/null -c 'sleep 2 && kill $$ & trap "print done;exit 3" 
EXIT; (sleep 5);print finished')
+(( $?==3)) || err_exit "wrong exit status expecting 3 got $?"
+[[ $x == done ]] || err_exit "wrong result - execting done got $x"
+(( SECONDS < 4 )) && err_exit "took $SECONDS seconds, expecting around 5"
+
+trap '' SIGBUS
+[[ $($SHELL -c 'trap date SIGBUS;trap -p SIGBUS') ]] && err_exit 'SIGBUS 
should not have a trap'
+trap -- - SIGBUS
+
 exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/statics.sh    Fri Sep 25 06:38:47 2009
+++ new/usr/src/lib/libshell/common/tests/statics.sh    Fri Sep 25 06:38:45 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -30,9 +30,9 @@
        typeset cmd="$2"
        typeset expected_output="$3"
        typeset output
-       
+
        output="$($SHELL -c "${cmd}" 2>&1 )"
-       
+
        [[ "${output}" != "${expected_output}" ]] && err_exit2 ${line_number} 
"${output} != ${expected_output}"
 }
 alias testfunc='testfunc $LINENO'
@@ -60,9 +60,9 @@
        function l
        {
                typeset -S s=( a=0 b=0 )
-       
+
                (( s.a++, s.b++ ))
-       
+
                $1 && printf 'a=%d, b=%d\n' s.a s.b
        }
        l false ; l false ; l true
@@ -75,9 +75,9 @@
        function ar
        {
                typeset -a -S s=( "hello" )
-       
+
                s+=( "an element" )
-       
+
                $1 && { printf '%s' "$...@]}" ; printf '\n' ; }
        }
        ar false ; ar false ; ar true
--- old/usr/src/lib/libshell/common/tests/subshell.sh   Fri Sep 25 06:38:50 2009
+++ new/usr/src/lib/libshell/common/tests/subshell.sh   Fri Sep 25 06:38:48 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -24,9 +24,15 @@
        (( Errors+=1 ))
 }
 alias err_exit='err_exit $LINENO'
+
 Command=${0##*/}
 integer Errors=0 Error_fd=2
 
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
+bincat=$(PATH=$(getconf PATH) whence -p cat)
+
 z=()
 z.foo=( [one]=hello [two]=(x=3 y=4) [three]=hi)
 z.bar[0]=hello
@@ -70,7 +76,7 @@
        [[ ${z.bar[1]} == yes ]] || err_exit 'index array assignment to 
compound variable in subshell not working'
 )
 [[ $z == "$val" ]] || err_exit 'compound variable changes after associative 
array assignment'
-       
+
 x=(
        foo=( qqq=abc rrr=def)
        bar=( zzz=no rst=fed)
@@ -97,8 +103,6 @@
 do     TEST_notfound=notfound-$RANDOM
 done
 
-tmp=/tmp/kshsubsh$$
-trap "rm -f $tmp" EXIT
 integer BS=1024 nb=64 ss=60 bs no
 for bs in $BS 1
 do     $SHELL -c '
@@ -109,8 +113,8 @@
                set -- $(printf %.'$(($BS*$nb))'c x | dd bs='$bs')
                print ${#1}
                kill $!
-       ' > $tmp 2>/dev/null
-       no=$(<$tmp)
+       ' > $tmp/sub 2>/dev/null
+       no=$(<$tmp/sub)
        (( no == (BS * nb) )) || err_exit "shell hangs on command substitution 
output size >= $BS*$nb with write size $bs -- expected $((BS*nb)), got ${no:-0}"
 done
 # this time with redirection on the trailing command
@@ -124,8 +128,8 @@
                set -- $(printf %.'$(($BS*$nb))'c x | dd bs='$bs' 2>/dev/null)
                print ${#1}
                kill $!
-       ' > $tmp 2>/dev/null
-       no=$(<$tmp)
+       ' > $tmp/sub 2>/dev/null
+       no=$(<$tmp/sub)
        (( no == (BS * nb) )) || err_exit "shell hangs on command substitution 
output size >= $BS*$nb with write size $bs and trailing redirection -- expected 
$((BS*nb)), got ${no:-0}"
 done
 
@@ -220,4 +224,230 @@
        done
 done
 
+$SHELL -c '( autoload xxxxx);print -n' ||  err_exit 'autoloaded functions in 
subshells can cause failure'
+foo=$($SHELL  <<- ++EOF++
+       (trap 'print bar' EXIT;print -n foo)
+       ++EOF++
+)
+[[ $foo == foobar ]] || err_exit 'trap on exit when last commands is subshell 
is not triggered'
+
+err=$(
+       $SHELL  2>&1  <<- \EOF
+               date=$(whence -p date)
+               function foo
+               {
+                       x=$( $date > /dev/null 2>&1 ;:)
+               }
+               # consume almost all fds to push the test to the fd limit #
+               integer max=$(ulimit --nofile)
+               (( max -= 6 ))
+               for ((i=20; i < max; i++))
+               do      exec {i}>&1
+               done
+               for ((i=0; i < 20; i++))
+               do      y=$(foo)
+               done
+       EOF
+) || {
+       err=${err%%$'\n'*}
+       err=${err#*:}
+       err=${err##[[:space:]]}
+       err_exit "nested command substitution with redirections failed -- $err"
+}
+
+exp=0
+$SHELL -c $'
+       function foobar
+       {
+               print "hello world"
+       }
+       [[ $(getopts \'[+?X\ffoobar\fX]\' v --man 2>&1) == *"Xhello worldX"* ]]
+       exit '$exp$'
+'
+got=$?
+[[ $got == $exp ]] || err_exit "getopts --man runtime callout with nonzero 
exit terminates shell -- expected '$exp', got '$got'"
+exp=ok
+got=$($SHELL -c $'
+       function foobar
+       {
+               print "hello world"
+       }
+       [[ $(getopts \'[+?X\ffoobar\fX]\' v --man 2>&1) == *"Xhello worldX"* ]]
+       print '$exp$'
+')
+[[ $got == $exp ]] || err_exit "getopts --man runtime callout with nonzero 
exit terminates shell -- expected '$exp', got '$got'"
+
+# command substitution variations #
+set -- \
+       '$('                    ')'             \
+       '${ '                   '; }'           \
+       '$(ulimit -c 0; '       ')'             \
+       '$( ('                  ') )'           \
+       '${ ('                  '); }'          \
+       '`'                     '`'             \
+       '`('                    ')`'            \
+       '`ulimit -c 0; '        '`'             \
+       # end of table #
+exp=ok
+testcase[1]='
+       if      %sexpr "NOMATCH" : ".*Z" >/dev/null%s
+       then    print error
+       else    print ok
+       fi
+       exit %s
+'
+testcase[2]='
+       function bar
+       {
+               pipeout=%1$sprintf Ok | tr O o%2$s
+               print $pipeout
+               return 0
+       }
+       foo=%1$sbar%2$s || foo="exit status $?"
+       print $foo
+       exit %3$s
+'
+while  (( $# >= 2 ))
+do     for ((TEST=1; TEST<=${#testca...@]}; TEST++))
+       do      body=${testcase[TEST]}
+               for code in 0 2
+               do      got=${ printf "$body" "$1" "$2" "$code" | $SHELL 2>&1 }
+                       status=$?
+                       if      (( status != code ))
+                       then    err_exit "test $TEST '$1...$2 exit $code' 
failed -- exit status $status, expected $code"
+                       elif    [[ $got != $exp ]]
+                       then    err_exit "test $TEST '$1...$2 exit $code' 
failed -- got '$got', expected '$exp'"
+                       fi
+               done
+       done
+       shift 2
+done
+
+# the next tests loop on all combinations of
+#      { SUB CAT INS TST APP } X { file-sizes }
+# where the file size starts at 1Ki and doubles up to and including 1Mi
+#
+# the tests and timeouts are done in async subshells to prevent
+# the test harness from hanging
+
+SUB=(
+       ( BEG='$( '     END=' )'        )
+       ( BEG='${ '     END='; }'       )
+)
+CAT=(  cat  $bincat  )
+INS=(  ""  "builtin cat; "  "builtin -d cat $bincat; "  ": > /dev/null; "  )
+APP=(  ""  "; :"  )
+TST=(
+       ( CMD='print foo | $cat'                        EXP=3           )
+       ( CMD='$cat < $tmp/lin'                                         )
+       ( CMD='cat $tmp/lin | $cat'                                     )
+       ( CMD='read v < $tmp/buf; print $v'             LIM=4*1024      )
+       ( CMD='cat $tmp/buf | read v; print $v'         LIM=4*1024      )
+)
+
+command exec 3<> /dev/null
+if     cat /dev/fd/3 >/dev/null 2>&1
+then   t=${#t...@]}
+       TST[T].CMD='$cat <(print foo)'
+       TST[T].EXP=3
+fi
+
+# prime the two data files to 512 bytes each
+# $tmp/lin has newlines every 16 bytes and $tmp/buf has no newlines
+# the outer loop doubles the file size at top
+
+buf=$'1234567890abcdef'
+lin=$'\n1234567890abcde'
+for ((i=0; i<5; i++))
+do     buf=$buf$buf
+       lin=$lin$lin
+done
+print -n "$buf" > $tmp/buf
+print -n "$lin" > $tmp/lin
+
+unset SKIP
+for ((n=1024; n<=1024*1024; n*=2))
+do     cat $tmp/buf $tmp/buf > $tmp/tmp
+       mv $tmp/tmp $tmp/buf
+       cat $tmp/lin $tmp/lin > $tmp/tmp
+       mv $tmp/tmp $tmp/lin
+       for ((S=0; S<${#s...@]}; S++))
+       do      for ((C=0; C<${#c...@]}; C++))
+               do      cat=${CAT[C]}
+                       for ((I=0; I<${#i...@]}; I++))
+                       do      for ((A=0; A<${#a...@]}; A++))
+                               do      for ((T=0; T<${#t...@]}; T++))
+                                       do      #undent...#
+
+       if      [[ ! ${SKIP[S][C][I][A][T]} ]]
+       then    eval "{ 
x=${SUB[S].BEG}${INS[I]}${TST[T].CMD}${APP[A]}${SUB[S].END}; print \${#x}; } 
>\$tmp/out &"
+               m=$!
+               { sleep 4; kill -9 $m; } &
+               k=$!
+               wait $m
+               h=$?
+               kill -9 $k
+               wait $k
+               got=$(<$tmp/out)
+               if      [[ ! $got ]] && (( h ))
+               then    got=HUNG
+               fi
+               if      [[ ${TST[T].EXP} ]]
+               then    exp=${TST[T].EXP}
+               else    exp=$n
+               fi
+               if      [[ $got != $exp ]]
+               then    # on failure skip similar tests on larger files sizes #
+                       SKIP[S][C][I][A][T]=1
+                       siz=$(printf $'%#i' $exp)
+                       cmd=${TST[T].CMD//\$cat/$cat}
+                       cmd=${cmd//\$tmp\/buf/$siz.buf}
+                       cmd=${cmd//\$tmp\/lin/$siz.lin}
+                       err_exit 
"'x=${SUB[S].BEG}${INS[I]}${cmd}${APP[A]}${SUB[S].END} && print \${#x}' failed 
-- expected '$exp', got '$got'"
+               elif    [[ ${TST[T].EXP} ]] || (( TST[T].LIM >= n ))
+               then    SKIP[S][C][I][A][T]=1
+               fi
+       fi
+
+                                               #...indent#
+                                       done
+                               done
+                       done
+               done
+       done
+done
+
+# specifics -- there's more?
+
+{
+       cmd='{ exec 5>/dev/null; print "$(eval ls -d . 2>&1 1>&5)"; } >$tmp/out 
&'
+       eval $cmd
+       m=$!
+       { sleep 4; kill -9 $m; } &
+       k=$!
+       wait $m
+       h=$?
+       kill -9 $k
+       wait $k
+       got=$(<$tmp/out)
+} 2>/dev/null
+exp=''
+if     [[ ! $got ]] && (( h ))
+then   got=HUNG
+fi
+if     [[ $got != $exp ]]
+then   err_exit "eval '$cmd' failed -- expected '$exp', got '$got'"
+fi
+
+float t1=$SECONDS
+sleep=$(whence -p sleep)
+if     [[ $sleep ]]
+then
+       $SHELL -c "( $sleep 5 </dev/null >/dev/null 2>&1 & );exit 0" | cat 
+       (( (SECONDS-t1) > 4 )) && err_exit '/bin/sleep& in subshell hanging'
+       ((t1=SECONDS))
+fi
+$SHELL -c '( sleep 5 </dev/null >/dev/null 2>&1 & );exit 0' | cat 
+(( (SECONDS-t1) > 4 )) && err_exit 'sleep& in subshell hanging'
+
 exit $Errors
--- old/usr/src/lib/libshell/common/tests/substring.sh  Fri Sep 25 06:38:53 2009
+++ new/usr/src/lib/libshell/common/tests/substring.sh  Fri Sep 25 06:38:51 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -192,7 +192,7 @@
 if     [[ ${foo//\//_} != one_two_three ]]
 then   err_exit 'escaping / in replacements failed'
 fi
-function myexport 
+function myexport
 {
        nameref var=$1
        if      (( $# > 1 ))
@@ -205,7 +205,7 @@
        typeset val
        val=$(export | grep "^$1=")
        print ${val#"$1="}
-       
+
 }
 export dgk=base
 if     [[ $(myexport dgk fun) != fun ]]
@@ -280,7 +280,7 @@
 [[ ${b//$a/\1} == 123 ]] || err_exit "\${var/pattern} not working with \[ in 
pattern"
 unset foo
 foo='(win32.i386) '
-[[ ${foo/'('/'(x11-'} == '(x11-win32.i386) ' ]] || err_exit "\${var/pattern} 
not working with ' in pattern" 
+[[ ${foo/'('/'(x11-'} == '(x11-win32.i386) ' ]] || err_exit "\${var/pattern} 
not working with ' in pattern"
 $SHELL -c $'v=\'$(hello)\'; [[ ${v//\'$(\'/-I\'$(\'} == -I"$v" ]]' 2> 
/dev/null || err_exit "\${var/pattern} not working with \$( as pattern"
 unset X
 $SHELL -c '[[ ! $...@]:0:300} ]]' 2> /dev/null || err_exit '$...@]:0:300} with 
X undefined fails'
@@ -303,7 +303,7 @@
 [[ $(string=$string $SHELL -c  ": \${string/$pattern/}; print 
\${.sh.match[26]}") == Z ]] || err_exit -u2 'sh.match[26] not Z'
 : ${string/$pattern/}
 (( ${#.sh.mat...@]} == 53 )) || err_exit '.sh.match has wrong number of 
elements'
-[[ ${.sh.mat...@]:2:4} == 'B C D E'  ]] || err_exit '${.sh.mat...@]:2:4} 
incorrect' 
+[[ ${.sh.mat...@]:2:4} == 'B C D E'  ]] || err_exit '${.sh.mat...@]:2:4} 
incorrect'
 
 D=$';' E=$'\\\\' Q=$'"' S=$'\'' M='nested pattern substitution failed'
 
@@ -501,7 +501,7 @@
 var=100
 [[ $( print $(( ${var%%00} )) ) == 1 ]] || err_exit "arithmetic with embeddded 
patterns fails"
 [[ $( print $(( ${var%%$pattern} )) ) == 1 ]] || err_exit "arithmetic with 
embeddded pattern variables fails"
-if     [[ ax == @(a)* ]] && [[ ${.sh.match[1]:0:${#.sh.match[1]}}  != a ]] 
+if     [[ ax == @(a)* ]] && [[ ${.sh.match[1]:0:${#.sh.match[1]}}  != a ]]
 then   err_exit '${.sh.match[1]:1:${#.sh.match[1]}} not expanding correctly'
 fi
 
@@ -509,10 +509,10 @@
 expected='d:\nt\box\something'
 [[ ${string/*\(+([!\)])\)*/\1} == "$expected" ]] || err_exit "substring 
expansion failed '${string/*\(+([!\)])\)*/\1}' returned -- '$expected' expected"
 if     [[ $($SHELL -c $'export LC_ALL=en_US.UTF-8; print -r 
"\342\202\254\342\202\254\342\202\254\342\202\254w\342\202\254\342\202\254\342\202\254\342\202\254"
 | wc -m' 2>/dev/null) == 10 ]]
-then   LC_ALL=en_US.UTF-8 $SHELL -c 
b1=$'"\342\202\254\342\202\254\342\202\254\342\202\254w\342\202\254\342\202\254\342\202\254\342\202\254";
 [[ ${b1:4:1} == w ]]' || err_exit 'Multibyte ${var:offset:len} not working 
correctly'
+then   LC_ALL=en_US.UTF-8 $SHELL -c 
b1=$'"\342\202\254\342\202\254\342\202\254\342\202\254w\342\202\254\342\202\254\342\202\254\342\202\254";
 [[ ${b1:4:1} == w ]]' || err_exit 'multibyte ${var:offset:len} not working 
correctly'
 fi
-{ $SHELL -c 'unset x;[[ ${SHELL:$x} == $SHELL ]]';} 2> /dev/null || err_exit 
'${var:$x} fails when x is not set' 
-{ $SHELL -c 'x=;[[ ${SHELL:$x} == $SHELL ]]';} 2> /dev/null || err_exit 
'${var:$x} fails when x is null' 
+{ $SHELL -c 'unset x;[[ ${SHELL:$x} == $SHELL ]]';} 2> /dev/null || err_exit 
'${var:$x} fails when x is not set'
+{ $SHELL -c 'x=;[[ ${SHELL:$x} == $SHELL ]]';} 2> /dev/null || err_exit 
'${var:$x} fails when x is null'
 
 #      subject         mode    pattern                 result  #
 set --                                                 \
--- /dev/null   Fri Sep 25 06:38:56 2009
+++ new/usr/src/lib/libshell/common/tests/sun_solaris_array_default_datatype.sh 
Fri Sep 25 06:38:54 2009
@@ -0,0 +1,303 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+# 
+# This test module checks whether indexed+associative arrays
+# set the default datatype correctly if someone uses the "+="
+# operator to add a value to an array element which does not
+# exist yet.
+#
+
+# test setup
+function err_exit
+{
+       print -u2 -n "\t"
+       print -u2 -r ${Command}[$1]: "${@:2}"
+       (( Errors++ ))
+}
+alias err_exit='err_exit $LINENO'
+
+# the test cannot use "nounset"
+Command=${0##*/}
+integer Errors=0
+
+compound bracketstat=(
+       integer bopen=0
+       integer bclose=0
+)
+
+function count_brackets
+{
+       typeset x="$1"
+       typeset c
+
+       integer i
+       (( bracketstat.bopen=0 , bracketstat.bclose=0 ))
+
+       for (( i=0 ; i < ${#x} ; i++ )) ; do
+               c="${x:i:1}"
+               [[ "$c" == "(" ]] && (( bracketstat.bopen++ ))
+               [[ "$c" == ")" ]] && (( bracketstat.bclose++ ))
+       done
+       
+       (( bracketstat.bopen != bracketstat.bclose )) && return 1
+       
+       return 0
+}
+
+# function to add the floating-point value 1.1 to array element "34"
+# floating-point datatypes should increment by 1.1, integers by 1
+function add_float
+{
+       nameref arr=$1
+       
+       arr[34]+=1.1
+       
+       return 0
+}
+
+# function to add a compound variable called "val" to array element arr[34]
+function add_compound
+{
+       nameref arr=$1
+       
+       arr[34]+=( float val=1.1 )
+       
+       return 0
+}
+
+# We run the tests in multiple cyles:
+# First cycle uses a normal compound variable as basis
+# Second cycle uses a nameref to a compound variable as basis
+# Third cycle uses a nameref to a nameref to a compound variable as basis
+for cycle in \
+       c1 c2 c3 c4 \
+       c2_sub c3_sub c4_sub \
+       c2_indexed_array c3_indexed_array c4_indexed_array \
+       c2_associative_array c3_associative_array c4_associative_array; do
+       case ${cycle} in
+               c1)
+                       compound mycpv
+                       ;;
+               c2)
+                       compound rootcpv
+                       nameref mycpv=rootcpv
+                       ;;
+               c3)
+                       compound rootcpv
+                       nameref namereftoroot=rootcpv
+                       nameref mycpv=namereftoroot
+                       ;;
+               c4)
+                       compound rootcpv
+                       nameref namereftoroot0=rootcpv
+                       nameref namereftoroot1=namereftoroot0
+                       nameref mycpv=namereftoroot1
+                       ;;
+               # same as cX but uses a subvariable of rootcpv
+               c2_sub)
+                       compound rootcpv
+                       compound rootcpv.sub
+                       nameref mycpv=rootcpv.sub
+                       ;;
+               c3_sub)
+                       compound rootcpv
+                       compound rootcpv.sub
+                       nameref namereftoroot=rootcpv.sub
+                       nameref mycpv=namereftoroot
+                       ;;
+               c4_sub)
+                       compound rootcpv
+                       compound rootcpv.sub
+                       nameref namereftoroot0=rootcpv.sub
+                       nameref namereftoroot1=namereftoroot0
+                       nameref mycpv=namereftoroot1
+                       ;;
+               # same as cX but uses a subvariable of an indexed array
+               c2_indexed_array)
+                       compound -a rootcpv
+                       nameref mycpv=rootcpv[4]
+                       ;;
+               c3_indexed_array)
+                       compound -a rootcpv
+                       nameref namereftoroot=rootcpv[4]
+                       nameref mycpv=namereftoroot
+                       ;;
+               c4_indexed_array)
+                       compound -a rootcpv
+                       nameref namereftoroot0=rootcpv[4]
+                       nameref namereftoroot1=namereftoroot0
+                       nameref mycpv=namereftoroot1
+                       ;;
+               # same as cX but uses a subvariable of an indexed array
+               c2_associative_array)
+                       compound -A rootcpv
+                       nameref mycpv=rootcpv["hello world"]
+                       ;;
+               c3_associative_array)
+                       compound -A rootcpv
+                       nameref namereftoroot=rootcpv["hello world"]
+                       nameref mycpv=namereftoroot
+                       ;;
+               c4_associative_array)
+                       compound -A rootcpv
+                       nameref namereftoroot0=rootcpv["hello world"]
+                       nameref namereftoroot1=namereftoroot0
+                       nameref mycpv=namereftoroot1
+                       ;;
+               *)
+                       err_exit "${cycle}: Should not happen."
+                       ;;
+       esac
+
+
+       # Test 001: Test indexed floating-point array
+       float -a mycpv.myindexedfloatarray
+
+       add_float mycpv.myindexedfloatarray
+       (( mycpv.myindexedfloatarray[34] == 1.1 )) || err_exit "${cycle}: 
mycpv.myindexedfloatarray[34] == ${mycpv.myindexedfloatarray[34]}, expected 1.1"
+       add_float mycpv.myindexedfloatarray
+       (( mycpv.myindexedfloatarray[34] == 2.2 )) || err_exit "${cycle}: 
mycpv.myindexedfloatarray[34] == ${mycpv.myindexedfloatarray[34]}, expected 2.2"
+       unset mycpv.myindexedfloatarray[34]
+       (( mycpv.myindexedfloatarray[34] == 0.0 )) || err_exit "${cycle}: 
mycpv.myindexedfloatarray[34] == ${mycpv.myindexedfloatarray[34]}, expected 0.0"
+
+       # 2nd try (we do this to check whether "unset" works properly)
+       add_float mycpv.myindexedfloatarray
+       (( mycpv.myindexedfloatarray[34] == 1.1 )) || err_exit "${cycle}: 
mycpv.myindexedfloatarray[34] == ${mycpv.myindexedfloatarray[34]}, expected 1.1"
+       add_float mycpv.myindexedfloatarray
+       (( mycpv.myindexedfloatarray[34] == 2.2 )) || err_exit "${cycle}: 
mycpv.myindexedfloatarray[34] == ${mycpv.myindexedfloatarray[34]}, expected 2.2"
+       unset mycpv.myindexedfloatarray[34]
+       (( mycpv.myindexedfloatarray[34] == 0.0 )) || err_exit "${cycle}: 
mycpv.myindexedfloatarray[34] == ${mycpv.myindexedfloatarray[34]}, expected 0.0"
+
+
+
+       # Test 002: Test associative floating-point array
+       float -A mycpv.myassociativefloatarray
+       add_float mycpv.myassociativefloatarray
+       (( mycpv.myassociativefloatarray[34] == 1.1 )) || err_exit "${cycle}: 
mycpv.myassociativefloatarray[34] == ${mycpv.myassociativefloatarray[34]}, 
expected 1.1"
+       add_float mycpv.myassociativefloatarray
+       (( mycpv.myassociativefloatarray[34] == 2.2 )) || err_exit "${cycle}: 
mycpv.myassociativefloatarray[34] == ${mycpv.myassociativefloatarray[34]}, 
expected 2.2"
+       unset mycpv.myassociativefloatarray[34]
+       (( mycpv.myassociativefloatarray[34] == 0.0 )) || err_exit "${cycle}: 
mycpv.myassociativefloatarray[34] == ${mycpv.myassociativefloatarray[34]}, 
expected 0.0"
+
+       # 2nd try (we do this to check whether "unset" works properly)
+       add_float mycpv.myassociativefloatarray
+       (( mycpv.myassociativefloatarray[34] == 1.1 )) || err_exit "${cycle}: 
mycpv.myassociativefloatarray[34] == ${mycpv.myassociativefloatarray[34]}, 
expected 1.1"
+       add_float mycpv.myassociativefloatarray
+       (( mycpv.myassociativefloatarray[34] == 2.2 )) || err_exit "${cycle}: 
mycpv.myassociativefloatarray[34] == ${mycpv.myassociativefloatarray[34]}, 
expected 2.2"
+       unset mycpv.myassociativefloatarray[34]
+       (( mycpv.myassociativefloatarray[34] == 0.0 )) || err_exit "${cycle}: 
mycpv.myassociativefloatarray[34] == ${mycpv.myassociativefloatarray[34]}, 
expected 0.0"
+
+
+
+       # Test 003: Test indexed integer array
+       integer -a mycpv.myindexedintegerarray
+
+       add_float mycpv.myindexedintegerarray
+       (( mycpv.myindexedintegerarray[34] == 1 )) || err_exit "${cycle}: 
mycpv.myindexedintegerarray[34] == ${mycpv.myindexedintegerarray[34]}, expected 
1"
+       add_float mycpv.myindexedintegerarray
+       (( mycpv.myindexedintegerarray[34] == 2 )) || err_exit "${cycle}: 
mycpv.myindexedintegerarray[34] == ${mycpv.myindexedintegerarray[34]}, expected 
2"
+       unset mycpv.myindexedintegerarray[34]
+       (( mycpv.myindexedintegerarray[34] == 0 )) || err_exit "${cycle}: 
mycpv.myindexedintegerarray[34] == ${mycpv.myindexedintegerarray[34]}, expected 
0"
+
+       # 2nd try (we do this to check whether "unset" works properly)
+       add_float mycpv.myindexedintegerarray
+       (( mycpv.myindexedintegerarray[34] == 1 )) || err_exit "${cycle}: 
mycpv.myindexedintegerarray[34] == ${mycpv.myindexedintegerarray[34]}, expected 
1"
+       add_float mycpv.myindexedintegerarray
+       (( mycpv.myindexedintegerarray[34] == 2 )) || err_exit "${cycle}: 
mycpv.myindexedintegerarray[34] == ${mycpv.myindexedintegerarray[34]}, expected 
2"
+       unset mycpv.myindexedintegerarray[34]
+       (( mycpv.myindexedintegerarray[34] == 0 )) || err_exit "${cycle}: 
mycpv.myindexedintegerarray[34] == ${mycpv.myindexedintegerarray[34]}, expected 
0"
+
+
+
+       # Test 004: Test associative integer array
+       integer -A mycpv.myassociativeintegerarray
+
+       add_float mycpv.myassociativeintegerarray
+       (( mycpv.myassociativeintegerarray[34] == 1 )) || err_exit "${cycle}: 
mycpv.myassociativeintegerarray[34] == ${mycpv.myassociativeintegerarray[34]}, 
expected 1"
+       add_float mycpv.myassociativeintegerarray
+       (( mycpv.myassociativeintegerarray[34] == 2 )) || err_exit "${cycle}: 
mycpv.myassociativeintegerarray[34] == ${mycpv.myassociativeintegerarray[34]}, 
expected 2"
+       unset mycpv.myassociativeintegerarray[34]
+       (( mycpv.myassociativeintegerarray[34] == 0 )) || err_exit "${cycle}: 
mycpv.myassociativeintegerarray[34] == ${mycpv.myassociativeintegerarray[34]}, 
expected 0"
+
+       # 2nd try (we do this to check whether "unset" works properly)
+       add_float mycpv.myassociativeintegerarray
+       (( mycpv.myassociativeintegerarray[34] == 1 )) || err_exit "${cycle}: 
mycpv.myassociativeintegerarray[34] == ${mycpv.myassociativeintegerarray[34]}, 
expected 1"
+       add_float mycpv.myassociativeintegerarray
+       (( mycpv.myassociativeintegerarray[34] == 2 )) || err_exit "${cycle}: 
mycpv.myassociativeintegerarray[34] == ${mycpv.myassociativeintegerarray[34]}, 
expected 2"
+       unset mycpv.myassociativeintegerarray[34]
+       (( mycpv.myassociativeintegerarray[34] == 0 )) || err_exit "${cycle}: 
mycpv.myassociativeintegerarray[34] == ${mycpv.myassociativeintegerarray[34]}, 
expected 0"
+
+
+
+       # Test 005: Tested indexed compound variable array
+       compound -a mycpv.myindexedcompoundarray
+       add_compound mycpv.myindexedcompoundarray
+       (( mycpv.myindexedcompoundarray[34].val == 1.1 )) || err_exit 
"${cycle}: mycpv.myindexedcompoundarray[34].val == 
${mycpv.myindexedcompoundarray[34].val}, expected 1.1"
+       # try to add it a 2nd time - since the new element will replace the old
+       # one the value will _not_ be incremented (or better: The compound
+       # variable value "val" will be added, not the value of the "val"
+       # variable)
+       add_compound mycpv.myindexedcompoundarray
+       (( mycpv.myindexedcompoundarray[34].val == 1.1 )) || err_exit 
"${cycle}: mycpv.myindexedcompoundarray[34].val == 
${mycpv.myindexedcompoundarray[34].val}, expected 1.1"
+       unset mycpv.myindexedcompoundarray[34]
+       [[ ! -v mycpv.myindexedcompoundarray[34].val ]] || err_exit "${cycle}: 
[[ ! -v mycpv.myindexedcompoundarray[34].val ]] should return failure, got $?"
+       (( mycpv.myindexedcompoundarray[34].val == 0.0 )) || err_exit 
"${cycle}: mycpv.myindexedcompoundarray[34].val == 
${mycpv.myindexedcompoundarray[34].val}, expected 0.0"
+       [[ "${mycpv.myindexedcompoundarray[34]}" == "" ]] || err_exit 
"${cycle}: mycpv.myindexedcompoundarray[34] expected to be equal to an empty 
string but contains |${mycpv.myindexedcompoundarray[34]}|"
+
+
+
+       # Test 006: Tested associative compound variable array
+       compound -A mycpv.myassociativecompoundarray
+       add_compound mycpv.myassociativecompoundarray
+       (( mycpv.myassociativecompoundarray[34].val == 1.1 )) || err_exit 
"${cycle}: mycpv.myassociativecompoundarray[34].val == 
${mycpv.myassociativecompoundarray[34].val}, expected 1.1"
+       # try to add it a 2nd time - since the new element will replace the old
+       # one the value will _not_ be incremented (or better: The compound
+       # variable value "val" will be added, not the value of the "val"
+       # variable)
+       add_compound mycpv.myassociativecompoundarray
+       (( mycpv.myassociativecompoundarray[34].val == 1.1 )) || err_exit 
"${cycle}: mycpv.myassociativecompoundarray[34].val == 
${mycpv.myassociativecompoundarray[34].val}, expected 1.1"
+       unset mycpv.myassociativecompoundarray[34]
+       [[ ! -v mycpv.myassociativecompoundarray[34].val ]] || err_exit 
"${cycle}: [[ ! -v mycpv.myassociativecompoundarray[34].val ]] should return 
failure, got $?"
+       (( mycpv.myassociativecompoundarray[34].val == 0.0 )) || err_exit 
"${cycle}: mycpv.myassociativecompoundarray[34].val == 
${mycpv.myassociativecompoundarray[34].val}, expected 0.0"
+       [[ "${mycpv.myassociativecompoundarray[34]}" == "" ]] || err_exit 
"${cycle}: mycpv.myassociativecompoundarray[34] expected to be equal to an 
empty string but contains |${mycpv.myassociativecompoundarray[34]}|"
+
+
+       # check whether the compound variable output is still Ok
+       count_brackets "${mycpv}" || err_exit "${cycle}: bracket open 
${bracketstat.bopen} != bracket close ${bracketstat.bclose}"
+       count_brackets "$(print -v mycpv)" || err_exit "${cycle}: print -v 
mycpy: bracket open ${bracketstat.bopen} != bracket close ${bracketstat.bclose}"
+       count_brackets "$(print -C mycpv)" || err_exit "${cycle}: print -C 
mycpy: bracket open ${bracketstat.bopen} != bracket close ${bracketstat.bclose}"
+
+
+       # reset
+       unset mycpv
+       [[ ! -v mycpv ]] || err_exit "${cycle}: mycpy should not exist"
+       [[ "${mycpv}" == "" ]] || err_exit "${cycle}: mycpv expected to be 
empty"
+done
+
+
+# tests done
+exit $((Errors))
--- /dev/null   Fri Sep 25 06:38:59 2009
+++ new/usr/src/lib/libshell/common/tests/sun_solaris_builtin_poll.sh   Fri Sep 
25 06:38:57 2009
@@ -0,0 +1,72 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Test whether the ksh93/poll builtin works as expected
+#
+
+# test setup
+function err_exit
+{
+       print -u2 -n "\t"
+       print -u2 -r ${Command}[$1]: "${@:2}"
+       (( Errors++ ))
+}
+alias err_exit='err_exit $LINENO'
+
+set -o nounset
+Command=${0##*/}
+integer Errors=0
+
+
+builtin -f libshell.so.1 poll || err_exit "poll builtin not found."
+
+compound d1=(
+       compound -A u=(
+               [y]=( fd=5 events="POLLIN" revents="" )
+               [x]=( fd=5 events="POLLIN" revents="" )
+       )
+)
+
+# test 1:
+cat /dev/zero | { redirect 5<&0 ; poll -e d1.res -t 5. d1.u ; } || err_exit 
"poll returned non-zero exit code $?"
+[[ "${d1.u[x].revents}" == "POLLIN" ]] || err_exit "d1.u[x].revents contains 
'${d1.u[x].revents}', not POLLIN"
+[[ "${d1.u[y].revents}" == "POLLIN" ]] || err_exit "d1.u[y].revents contains 
'${d1.u[y].revents}', not POLLIN"
+[[ "${d1.res[*]}" == "x y" ]] || err_exit "d1.res contains '${d1.res[*]}', not 
'x y'"
+
+# test 2:
+unset d1.res
+
+d1.u[z]=( fd=5 events="POLLOUT" revents="" )
+{ poll -e d1.res -t 5. d1.u ; } 5</dev/null 5>/dev/null || err_exit "poll 
returned non-zero exit code $?"
+[[ "${d1.u[x].revents}" == "POLLIN"             ]] || err_exit 
"d1.u[x].revents contains '${d1.u[x].revents}', not 'POLLIN'"
+[[ "${d1.u[y].revents}" == "POLLIN"             ]] || err_exit 
"d1.u[y].revents contains '${d1.u[y].revents}', not 'POLLIN'"
+[[ "${d1.u[z].revents}" == "POLLOUT|POLLWRNORM" ]] || err_exit 
"d1.u[z].revents contains '${d1.u[z].revents}', not 'POLLOUT|POLLWRNORM,'"
+[[ "${d1.res[*]}" == "x y z" ]] || err_exit "d1.res contains '${d1.res[*]}', 
not 'x y z'"
+
+
+# tests done
+exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/sun_solaris_builtin_sum.sh    Fri Sep 
25 06:39:02 2009
+++ new/usr/src/lib/libshell/common/tests/sun_solaris_builtin_sum.sh    Fri Sep 
25 06:39:00 2009
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -29,6 +29,7 @@
 # Solaris/SystemV /usr/bin/sum
 #
 
+# test setup
 function err_exit
 {
        print -u2 -n "\t"
@@ -37,9 +38,11 @@
 }
 alias err_exit='err_exit $LINENO'
 
+set -o nounset
 Command=${0##*/}
 integer Errors=0
 
+
 typeset x
 
 builtin sum || err_exit "sum builtin not found"
--- /dev/null   Fri Sep 25 06:39:05 2009
+++ new/usr/src/lib/libshell/common/tests/sun_solaris_builtin_tail.sh   Fri Sep 
25 06:39:03 2009
@@ -0,0 +1,446 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Test whether the ksh93/libcmd tail builtin is compatible to
+# Solaris/SystemV { /usr/bin/tail, /usr/xpg4/bin/tail } and
+# POSIX "tail"
+#
+
+# test setup
+function err_exit
+{
+       print -u2 -n "\t"
+       print -u2 -r ${Command}[$1]: "${@:2}"
+       (( Errors++ ))
+}
+alias err_exit='err_exit $LINENO'
+
+set -o nounset
+Command=${0##*/}
+integer Errors=0
+
+# common functions
+function isvalidpid
+{
+        kill -0 ${1} 2>/dev/null && return 0
+        return 1
+}
+
+function waitpidtimeout
+{
+       integer pid=$1
+       float timeout=$2
+       float i
+       float -r STEP=0.5 # const
+
+       (( timeout=timeout/STEP ))
+       
+       for (( i=0 ; i < timeout ; i+=STEP )) ; do
+               isvalidpid ${pid} || break
+               sleep ${STEP}
+       done
+       
+       return 0
+}
+
+function myintseq
+{
+        integer i
+       float arg1=$1
+       float arg2=$2
+       float arg3=$3
+
+        case $# in
+                1)
+                        for (( i=1 ; i <= arg1 ; i++ )) ; do
+                                printf "%d\n" i
+                        done
+                        ;;
+                2)
+                        for (( i=arg1 ; i <= arg2 ; i++ )) ; do
+                                printf "%d\n" i
+                        done
+                        ;;
+                3)
+                        for (( i=arg1 ; i <= arg3 ; i+=arg2 )) ; do
+                                printf "%d\n" i
+                        done
+                        ;;
+                *)
+                        print -u2 -f "%s: Illegal number of arguments %d\n" 
"$0" $#
+                       return 1
+                        ;;
+        esac
+        
+        return 0
+}
+
+# quote input string but use double-backslash that "err_exit" prints
+# the strings correctly
+function doublebackslashquote
+{
+       typeset s
+       s="$(printf "%q\n" "$1")"
+       s="${s//\\/\\\\}"
+       print -r "$s"
+       return 0
+}
+
+
+# main
+builtin mktemp || err_exit "mktemp builtin not found"
+builtin rm || err_exit "rm builtin not found"
+builtin tail || err_exit "tail builtin not found"
+
+typeset ocwd
+typeset tmpdir
+
+# create temporary test directory
+ocwd="$PWD"
+tmpdir="$(mktemp -d "test_sun_solaris_builtin_tail.XXXXXXXX")" || err_exit 
"Cannot create temporary directory"
+
+cd "${tmpdir}" || err_exit "cd ${tmpdir} failed."
+
+
+# run tests:
+
+# test1: basic tests
+compound -a testcases=(
+       (
+               name="reverse_n"
+               input=$'hello\nworld'
+               compound -A tail_args=(
+                       [legacy]=(   argv=( "-r"  ) )
+               )
+               expected_output=$'world\nhello'
+       )
+       (
+               name="revlist0n"
+               input=$'1\n2\n3\n4'
+               compound -A tail_args=(
+                       [legacy]=(   argv=( "-0"         ) )
+                       [std_like]=( argv=( "-n" "0" ) ) 
+               )
+               expected_output=$''
+       )
+       (
+               name="revlist0nr"
+               input=$'1\n2\n3\n4'
+               compound -A tail_args=(
+                       [legacy]=(       argv=( "-0r"         ) )
+                       [std_like]=(     argv=( "-n" "0" "-r" ) )
+                       [long_options]=( argv=( "--lines" "0" "--reverse" ) )
+               )
+               expected_output=$'' )
+       (
+               name="revlist1n"
+               input=$'1\n2\n3\n4'
+               compound -A tail_args=(
+                       [legacy]=(       argv=( "-1"     ) )
+                       [std_like]=(     argv=( "-n" "1" ) )
+                       [long_options]=( argv=( "--lines" "1" ) )
+               )
+               expected_output=$'4' )
+       (
+               name="revlist1nr"
+               input=$'1\n2\n3\n4'
+               compound -A tail_args=(
+                       [legacy]=(       argv=( "-1r" ) )
+                       [std_like]=(     argv=( "-n" "1" "-r" ) )
+                       [long_options]=( argv=( "--lines" "1" "--reverse" ) )
+               )
+               expected_output=$'4'
+       )
+       (
+               name="revlist2n"
+               input=$'1\n2\n3\n4'
+               compound -A tail_args=(
+                       [legacy]=(   argv=( "-2"  ) )
+                       [std_like]=( argv=( "-n" "2" ) )
+               )
+               expected_output=$'3\n4'
+       )
+       (
+               name="revlist2nr"
+               input=$'1\n2\n3\n4'
+               compound -A tail_args=(
+                       [legacy]=(   argv=( "-2r" ) )
+                       [std_like]=( argv=( "-n" "2" "-r" ) )
+                       )
+               expected_output=$'4\n3'
+       )
+       (
+               name="revlist3nr"
+               input=$'1\n2\n3\n4'
+               compound -A tail_args=(
+                       [legacy]=(   argv=( "-3r" ) )
+                       [std_like]=( argv=( "-n" "3" "-r" ) )
+               )
+               expected_output=$'4\n3\n2'
+       )
+       (
+               name="revlist2p"
+               input=$'1\n2\n3\n4'
+               compound -A tail_args=(
+                       [legacy]=(   argv=( "+2"  ) )
+                       [std_like]=( argv=( "-n" "+2" ) )
+                       )
+               expected_output=$'2\n3\n4'
+       )
+       (
+               name="revlist2pr"
+               input=$'1\n2\n3\n4'
+               compound -A tail_args=(
+                       [legacy]=(   argv=( "+2r" ) )
+                       [std_like]=( argv=( "-n" "+2" "-r" ) )
+               )
+               expected_output=$'4\n3\n2'
+       )
+       (
+               name="revlist3p"
+               input=$'1\n2\n3\n4'
+               compound -A tail_args=(
+                       [legacy]=(   argv=( "+3"  ) )
+                       [std_like]=( argv=( "-n" "+3"  ) )
+               )
+               expected_output=$'3\n4'
+       )
+       (
+               name="revlist3pr"
+               input=$'1\n2\n3\n4'
+               compound -A tail_args=(
+                       [legacy]=(   argv=( "+3r" ) )
+                       [std_like]=( argv=( "-n" "+3" "-r" ) )
+               )
+               expected_output=$'4\n3'
+       )
+       (
+               name="revlist4p"
+               input=$'1\n2\n3\n4'
+               compound -A tail_args=(
+                       [legacy]=(   argv=( "+4"  ) )
+                       [std_like]=( argv=( "-n" "+4"  ) )
+               )
+               expected_output=$'4'
+       )
+       (
+               name="revlist4pr"
+               input=$'1\n2\n3\n4'
+               compound -A tail_args=(
+                       [legacy]=(   argv=( "+4r" ) )
+                       [std_like]=( argv=( "-n" "+4" "-r" ) )
+               )
+               expected_output=$'4'
+       )
+       (
+               name="revlist5p"
+               input=$'1\n2\n3\n4'
+               compound -A tail_args=(
+                       [legacy]=(   argv=( "+5"  ) )
+                       [std_like]=( argv=( "-n" "+5"  ) )
+               )
+               expected_output=$''
+       )
+       (
+               name="revlist5pr"
+               input=$'1\n2\n3\n4'
+               compound -A tail_args=(
+                       [legacy]=(   argv=( "+5r" ) )
+                       [std_like]=( argv=( "-n" "+5" "-r" ) )
+               )
+               expected_output=$''
+       )
+)
+
+for testid in "${!testcas...@]}" ; do
+       nameref tc=testcases[${testid}]
+
+       for argv_variants in "${!tc.tail_ar...@]}" ; do
+               nameref argv=tc.tail_args[${argv_variants}].argv
+               output=$(
+                               set -o pipefail
+                               print -r -- "${tc.input}" | tail "${ar...@]}"
+                       ) || err_exit "test ${tc.name}/${argv_variants}: 
command failed with exit code $?"
+       
+               [[ "${output}" == "${tc.expected_output}" ]] || err_exit "test 
${tc.name}/${argv_variants}: Expected $(doublebackslashquote 
"${tc.expected_output}"), got $(doublebackslashquote "${output}")"
+       done
+done
+
+
+# test2: test "tail -r </etc/profile | rev -l" vs. "cat </etc/profile"
+[[ "$(tail -r </etc/profile | rev -l)" == "$( cat /etc/profile )" ]] || 
err_exit "'tail -r </etc/profile | rev -l' output does not match 'cat 
/etc/profile'" 
+
+
+# test 3: ast-ksh.2009-05-05 "tail" builtin may crash if we pass unsupported 
long options
+$SHELL -o errexit -c 'builtin tail ; print "hello" | tail 
--attack_of_chicken_monsters' >/dev/null 2>&1
+(( $? == 2 )) || err_exit "expected exit code 2 for unsupported long option, 
got $?" 
+
+
+# test 4: FIFO tests
+
+# FIFO test functions
+# (we use functions here to do propper garbage collection)
+function test_tail_fifo_1
+{
+       typeset tail_cmd="$1"
+       integer i
+       integer tail_pid=-1
+       
+       # cleanup trap
+       trap "rm -f tailtestfifo tailout" EXIT
+
+       # create test FIFO
+       mkfifo tailtestfifo
+
+       ${tail_cmd} -f <tailtestfifo >tailout &
+       tail_pid=$!
+
+       myintseq 20 >tailtestfifo
+
+       waitpidtimeout ${tail_pid} 5
+
+       if isvalidpid ${tail_pid} ; then
+               err_exit "test_tail_fifo_1: # tail hung (not expected)"
+               kill -KILL ${tail_pid}
+       fi
+
+       wait || err_exit "tail child returned non-zero exit code=$?"
+       
+       [[ "$(cat tailout)" == $'11\n12\n13\n14\n15\n16\n17\n18\n19\n20' ]] || 
err_exit "test_tail_fifo_1: Expected $(doublebackslashquote 
'11\n12\n13\n14\n15\n16\n17\n18\n19\n20'), got $(doublebackslashquote "$(cat 
tailout)")"
+
+       return 0
+}
+
+function test_tail_fifo_2
+{
+       typeset tail_cmd="$1"
+       integer i
+       integer tail_pid=-1
+       
+       # cleanup trap
+       trap "rm -f tailtestfifo tailout" EXIT
+
+       # create test FIFO
+       mkfifo tailtestfifo
+
+       ${tail_cmd} -f tailtestfifo >tailout &
+       tail_pid=$!
+
+       myintseq 14 >tailtestfifo
+
+       waitpidtimeout ${tail_pid} 5
+
+       if isvalidpid ${tail_pid} ; then
+               [[ "$(cat tailout)" == $'5\n6\n7\n8\n9\n10\n11\n12\n13\n14' ]] 
|| err_exit "test_tail_fifo_2: Expected $(doublebackslashquote 
$'5\n6\n7\n8\n9\n10\n11\n12\n13\n14'), got $(doublebackslashquote "$(cat 
tailout)")"
+
+               myintseq 15 >>tailtestfifo
+
+               waitpidtimeout ${tail_pid} 5
+
+               if isvalidpid ${tail_pid} ; then
+                       kill -KILL ${tail_pid}
+               else
+                       err_exit "test_tail_fifo_2: # tail exit with return 
code $? (not expected)"
+               fi
+       fi
+
+       wait || err_exit "tail child returned non-zero exit code=$?"
+       
+       [[ "$(cat tailout)" == 
$'5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15'
 ]] || err_exit "test_tail_fifo_2: Expected $(doublebackslashquote 
$'5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15'),
 got $(doublebackslashquote "$(cat tailout)")"
+
+       return 0
+}
+
+# fixme: This should test /usr/bin/tail and /usr/xpg4/bin/tail in Solaris
+test_tail_fifo_1 "tail"
+test_tail_fifo_2 "tail"
+
+
+# test 5: "tail -f" tests
+function followtest1
+{
+       typeset -r FOLLOWFILE="followfile.txt"
+       typeset -r OUTFILE="outfile.txt"
+
+       typeset title="$1"
+       typeset testcmd="$2"
+       typeset usenewline=$3
+       typeset followstr=""
+       typeset newline=""
+       integer i
+       integer tailchild=-1
+
+       if ${usenewline} ; then
+               newline=$'\n'
+       fi
+       
+       rm -f "${FOLLOWFILE}" "${OUTFILE}"
+       print -n "${newline}" > "${FOLLOWFILE}"
+
+       ${testcmd} -f "${FOLLOWFILE}" >"${OUTFILE}" &
+       (( tailchild=$! ))
+
+       for (( i=0 ; i < 10 ; i++)) ; do
+               followstr+="${newline}${i}"
+               print -n "${i}${newline}" >>"${FOLLOWFILE}"
+               sleep 2
+
+               [[ "$( < "${OUTFILE}")" == "${followstr}" ]] || err_exit 
"${title}: Expected $(doublebackslashquote "${followstr}"), got 
"$(doublebackslashquote "$( < "${OUTFILE}")")""
+       done
+
+       #kill -TERM ${tailchild} 2>/dev/null
+       kill -KILL ${tailchild} 2>/dev/null
+       waitpidtimeout ${tailchild} 5
+       
+       if isvalidpid ${tailchild} ; then
+               err_exit "${title}: tail pid=${tailchild} hung."
+               kill -KILL ${tailchild} 2>/dev/null
+       fi
+       
+       wait ${tailchild} 2>/dev/null
+       
+       rm -f "${FOLLOWFILE}" "${OUTFILE}"
+
+       return 0
+}
+
+followtest1 "test5a" "tail" true
+# fixme: later we should test this, too:
+#followtest1 "test5b" "tail" false
+#followtest1 "test5c" "/usr/xpg4/bin/tail" true
+#followtest1 "test5d" "/usr/xpg4/bin/tail" false
+#followtest1 "test5e" "/usr/bin/tail" true
+#followtest1 "test5f" "/usr/bin/tail" false
+
+
+# cleanup
+cd "${ocwd}"
+rmdir "${tmpdir}" || err_exit "Cannot remove temporary directory ${tmpdir}".
+
+
+# tests done
+exit $((Errors))
--- /dev/null   Fri Sep 25 06:39:07 2009
+++ new/usr/src/lib/libshell/common/tests/sun_solaris_command_substitution.sh   
Fri Sep 25 06:39:05 2009
@@ -0,0 +1,291 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Written by Roland Mainz <roland.mainz at nrubsig.org>
+#
+
+# test setup
+function err_exit
+{
+       print -u2 -n "\t"
+       print -u2 -r ${Command}[$1]: "${@:2}"
+       (( Errors++ ))
+}
+alias err_exit='err_exit $LINENO'
+
+set -o nounset
+Command=${0##*/}
+integer Errors=0
+
+
+function isvalidpid
+{
+       kill -0 ${1} 2>/dev/null && return 0
+       return 1
+}
+integer testfilesize i maxwait
+typeset tmpfile
+integer testid
+
+
+########################################################################
+#### test set 001:
+# run loop and check various temp filesizes
+# (Please keep this test syncted with 
sun_solaris_cr_6800929_large_command_substitution_hang.sh)
+
+# test 1: run loop and check various temp filesizes
+tmpfile="$(mktemp "/tmp/ksh93_tests_command_substitution.${PPID}.$$.XXXXXX")" 
|| err_exit "Cannot create temporary file."
+
+compound test1=(
+       compound -a testcases=(
+               # test 1a: Run test child for $(...)
+               # (note the pipe chain has to end in a builtin command, an 
external command may not trigger the bug)
+               ( name="test1a" cmd="builtin cat ; print -- \"\$(cat 
\"${tmpfile}\" | cat)\" ; true" )
+               # test 1b: Same as test1a but uses ${... ; } instead if $(...)
+               ( name="test1b" cmd="builtin cat ; print -- \"\${ cat 
\"${tmpfile}\" | cat ; }\" ; true" )
+               # test 1c: Same as test1a but does not use a pipe
+               ( name="test1c" cmd="builtin cat ; print -- \"\$(cat 
\"${tmpfile}\" ; true)\" ; true" )
+               # test 1d: Same as test1a but does not use a pipe
+               ( name="test1d" cmd="builtin cat ; print -- \"\${ cat 
\"${tmpfile}\" ; true ; }\" ; true" )
+
+               # test 1e: Same as test1a but uses an external "cat" command
+               ( name="test1e" cmd="builtin -d cat /bin/cat ; print -- 
\"\$(cat \"${tmpfile}\" | cat)\" ; true" )
+               # test 1f: Same as test1a but uses an external "cat" command
+               ( name="test1f" cmd="builtin -d cat /bin/cat ; print -- \"\${ 
cat \"${tmpfile}\" | cat ; }\" ; true" )
+               # test 1g: Same as test1a but uses an external "cat" command
+               ( name="test1g" cmd="builtin -d cat /bin/cat ; print -- 
\"\$(cat \"${tmpfile}\" ; true)\" ; true" )
+               # test 1h: Same as test1a but uses an external "cat" command
+               ( name="test1h" cmd="builtin -d cat /bin/cat ; print -- \"\${ 
cat \"${tmpfile}\" ; true ; }\" ; true" )
+       )
+)
+
+for (( testfilesize=1*1024 ; testfilesize <= 1024*1024 ; testfilesize*=2 )) ; 
do
+       # Create temp file
+       {
+               for (( i=0 ; i < testfilesize ; i+=64 )) ; do
+                       print 
"0123456789abcdef01234567890ABCDEF0123456789abcdef01234567890ABCDE"
+               done
+       } >"${tmpfile}"
+
+       # wait up to log2(i) seconds for the child to terminate
+       # (this is 10 seconds for 1KB and 19 seconds for 512KB)
+       (( maxwait=log2(testfilesize) ))
+               
+       for testid in "${!test1.testcas...@]}" ; do
+               nameref currtst=test1.testcases[testid]
+               ${SHELL} -o errexit -c "${currtst.cmd}" >"${tmpfile}.out" &
+               (( childpid=$! ))
+
+               for (( i=0 ; i < maxwait ; i++ )) ; do
+                       isvalidpid ${childpid} || break
+                       sleep 0.25
+               done
+
+               if isvalidpid ${childpid} ; then
+                       err_exit "${currtst.name}: child (pid=${childpid}) 
still busy, filesize=${testfilesize}."
+                       kill -KILL ${childpid} 2>/dev/null
+               fi
+               wait || err_exit "${currtst.name}: Child returned non-zero exit 
code." # wait for child (and/or avoid zombies/slime)
+
+               # compare input/output
+               cmp -s "${tmpfile}" "${tmpfile}.out" || err_exit 
"${currtst.name}: ${tmpfile} and ${tmpfile}.out differ, 
filesize=${testfilesize}."
+               rm "${tmpfile}.out"
+       done
+
+       # Cleanup
+       rm "${tmpfile}"
+done
+
+
+########################################################################
+#### test set 002:
+# If a command substitution calls a function and that function contains
+# a command substitution which contains a piped command, the original
+# command substitution calling the function will return 127 instead of 0.
+# This is causing problems in several VSC tests.
+# If we remove the piped command from the simple
+# case in the attached script, it returns 0.
+
+typeset str
+typeset testbody
+typeset testout
+
+testbody=$(
+# <CS> means command substitution start, <CE> means command substitution end
+cat <<EOF
+myfunc ()
+{ 
+       pipedcmd=<CS> printf "hi" | tr "h" "H" <CE>
+       echo \$pipedcmd
+
+       return 0
+}
+
+foo=<CS>myfunc<CE>
+retval=\$?
+
+if [ "\$foo"X != "HiX" ]; then
+       echo "myfunc returned '\${foo}'; expected 'Hi'"
+fi
+
+if [ \$retval -ne 0 ]; then
+       echo "command substitution calling myfunc returned \"\${retval}\"; 
expected 0"
+else
+       echo "command substitution calling myfunc successfully returned 0"
+fi
+EOF
+)
+
+
+# Test 002/a: Plain test
+testout=${ printf "%B\n" testbody | sed 's/<CS>/$(/g;s/<CE>/)/g' | ${SHELL} 
2>&1 || err_exit "command returned exit code $?" }
+[[ "${testout}" == "command substitution calling myfunc successfully returned 
0" ]] || err_exit "Expected 'command substitution calling myfunc successfully 
returned 0', got ${testout}"
+
+# Test 002/b: Same as test002/a but replaces "$(" with "${"
+testout=${ printf "%B\n" testbody | sed 's/<CS>/${ /g;s/<CE>/ ; }/g' | 
${SHELL} 2>&1 || err_exit "command returned exit code $?" }
+[[ "${testout}" == "command substitution calling myfunc successfully returned 
0" ]] || err_exit "Expected 'command substitution calling myfunc successfully 
returned 0', got ${testout}"
+
+# Test 002/c: Same as test002/a but forces |fork()| for a subshell via "ulimit 
-c 0"
+testout=${ printf "%B\n" testbody | sed 's/<CS>/$( ulimit -c 0 ; 
/g;s/<CE>/)/g' | ${SHELL} 2>&1 || err_exit "command returned exit code $?" }
+[[ "${testout}" == "command substitution calling myfunc successfully returned 
0" ]] || err_exit "Expected 'command substitution calling myfunc successfully 
returned 0', got ${testout}"
+
+# Test 002/d: Same as test002/a but uses extra subshell
+testout=${ printf "%B\n" testbody | sed 's/<CS>/$( ( /g;s/<CE>/) )/g' | 
${SHELL} 2>&1 || err_exit "command returned exit code $?" }
+[[ "${testout}" == "command substitution calling myfunc successfully returned 
0" ]] || err_exit "Expected 'command substitution calling myfunc successfully 
returned 0', got ${testout}"
+
+# Test 002/e: Same as test002/b but uses extra subshell after "${ " 
+testout=${ printf "%B\n" testbody | sed 's/<CS>/${ ( /g;s/<CE>/) ; }/g' | 
${SHELL} 2>&1 || err_exit "command returned exit code $?" }
+[[ "${testout}" == "command substitution calling myfunc successfully returned 
0" ]] || err_exit "Expected 'command substitution calling myfunc successfully 
returned 0', got ${testout}"
+
+
+
+
+########################################################################
+#### test set 003:
+# An expression within backticks which should return false, instead
+# returns true (0).
+
+typeset str
+typeset testbody
+typeset testout
+
+testbody=$(
+# <CS> means command substitution start, <CE> means command substitution end
+cat <<EOF
+if <CS>expr "NOMATCH" : ".*Z" > /dev/null<CE> ; then
+        echo "xerror"
+else
+        echo "xok"
+fi
+EOF
+)
+
+
+# Test 003/a: Plain test
+testout=${ printf "%B\n" testbody | sed 's/<CS>/$(/g;s/<CE>/)/g' | ${SHELL} 
2>&1 || err_exit "command returned exit code $?" }
+[[ "${testout}" == "xok" ]] || err_exit "Expected 'xok', got ${testout}"
+
+# Test 003/b: Same as test003/a but replaces "$(" with "${"
+testout=${ printf "%B\n" testbody | sed 's/<CS>/${ /g;s/<CE>/ ; }/g' | 
${SHELL} 2>&1 || err_exit "command returned exit code $?" }
+[[ "${testout}" == "xok" ]] || err_exit "Expected 'xok', got ${testout}"
+
+# Test 003/c: Same as test003/a but forces |fork()| for a subshell via "ulimit 
-c 0"
+testout=${ printf "%B\n" testbody | sed 's/<CS>/$( ulimit -c 0 ; 
/g;s/<CE>/)/g' | ${SHELL} 2>&1 || err_exit "command returned exit code $?" }
+[[ "${testout}" == "xok" ]] || err_exit "Expected 'xok', got ${testout}"
+
+# Test 003/d: Same as test003/a but uses extra subshell
+testout=${ printf "%B\n" testbody | sed 's/<CS>/$( ( /g;s/<CE>/) )/g' | 
${SHELL} 2>&1 || err_exit "command returned exit code $?" }
+[[ "${testout}" == "xok" ]] || err_exit "Expected 'xok', got ${testout}"
+
+# Test 003/e: Same as test003/b but uses extra subshell after "${ " 
+testout=${ printf "%B\n" testbody | sed 's/<CS>/${ ( /g;s/<CE>/) ; }/g' | 
${SHELL} 2>&1 || err_exit "command returned exit code $?" }
+[[ "${testout}" == "xok" ]] || err_exit "Expected 'xok', got ${testout}"
+
+
+########################################################################
+#### test set 004:
+# test pipe within ${... ; } command subtitution ending in a
+# non-builtin command (therefore we use "/bin/cat" instead of "cat" below
+# to force the use of the external "cat" command). ast-ksh.2009-01-20
+# had a bug which caused this test to fail.
+testout=$( ${SHELL} -c 'pipedcmd=${ printf "hi" | /bin/cat ; } ; print 
$pipedcmd' )
+[[ "${testout}" == "hi" ]] || err_exit "test004: Expected 'hi', got 
'${testout}'"
+
+
+########################################################################
+#### test set 005:
+# Test whether the shell may hang in a
+# 'exec 5>/dev/null; print $(eval ls -d . 2>&1 1>&5)'
+# Originally discovered with ast-ksh.2009-05-05 which hung in
+# the "configure" script of postgresql-8.3.7.tar.gz (e.g. 
+# configure --enable-thread-safety --without-readline)
+compound test5=(
+       compound -a testcases=(
+               # gsf's reduced testcase
+               ( name="test5_a" cmd='exec 5>/dev/null; print $(eval ls -d . 
2>&1 1>&5)done' )
+               # gisburn's reduced testcase
+               ( name="test5_b" cmd='exec 5>/dev/null; print $(eval 
"/bin/printf hello\n" 2>&1 1>&5)done' )
+
+               ## The following tests do not trigger the problem but are 
included here for completeness
+               ## and to make sure we don't get other incarnations of the same 
problem later...
+
+               # same as test5_a but uses ${ ... ; } instead of $(...)
+               ( name="test5_c" cmd='exec 5>/dev/null; print "${ eval ls -d . 
2>&1 1>&5 ;}done"' )
+               # same as test5_b but uses ${ ... ; } instead of $(...)
+               ( name="test5_d" cmd='exec 5>/dev/null; print "${ eval 
"/bin/printf hello\n" 2>&1 1>&5 ;}done"' )
+               # same as test5_a but uses "ulimit -c 0" to force the shell to 
use a seperare process for $(...)
+               ( name="test5_e" cmd='exec 5>/dev/null; print $(ulimit -c 0 ; 
eval ls -d . 2>&1 1>&5)done' )
+               # same as test5_b but uses "ulimit -c 0" to force the shell to 
use a seperare process for $(...)
+               ( name="test5_f" cmd='exec 5>/dev/null; print $(ulimit -c 0 ; 
eval "/bin/printf hello\n" 2>&1 1>&5)done' )
+       )
+)
+
+maxwait=5
+for testid in "${!test5.testcas...@]}" ; do
+       nameref currtst=test5.testcases[testid]
+       ${SHELL} -o errexit -c "${currtst.cmd}" >"${tmpfile}.out" &
+       (( childpid=$! ))
+
+       for (( i=0 ; i < maxwait ; i++ )) ; do
+               isvalidpid ${childpid} || break
+               sleep 0.25
+       done
+
+       if isvalidpid ${childpid} ; then
+               err_exit "${currtst.name}: child (pid=${childpid}) still busy."
+               kill -KILL ${childpid} 2>/dev/null
+       fi
+       wait || err_exit "${currtst.name}: Child returned non-zero exit code." 
# wait for child (and/or avoid zombies/slime)
+
+       testout="$( < "${tmpfile}.out")"
+       rm "${tmpfile}.out" || err_exit "File '${tmpfile}.out' could not be 
removed."
+       [[ "${testout}" == "done" ]] || err_exit "test '${currtst.name}' 
failed, expected 'done', got '${testout}'"
+done
+
+
+# tests done
+exit $((Errors))
--- /dev/null   Fri Sep 25 06:39:10 2009
+++ new/usr/src/lib/libshell/common/tests/sun_solaris_compound_nameref.sh       
Fri Sep 25 06:39:08 2009
@@ -0,0 +1,215 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+
+
+# test setup
+function err_exit
+{
+       print -u2 -n "\t"
+       print -u2 -r ${Command}[$1]: "${@:2}"
+       (( Errors++ ))
+}
+alias err_exit='err_exit $LINENO'
+
+set -o nounset
+Command=${0##*/}
+integer Errors=0
+
+#
+# name reference test #001
+# Note we run this test in a seperate shell to make sure the memory
+# corruption originally reported can be reproduced (which precisely
+# depends on ordering in the testcase)
+(
+cat <<EOF
+       function err_exit
+       {
+               print -u2 -n "\t"
+               print -u2 -r \${Command}[\$1]: "\${@:2}"
+               (( Errors++ ))
+       }
+       alias err_exit='err_exit \$LINENO'
+
+       function function2
+       {
+               nameref v=\$1
+
+               v.x=19
+               v.y=20
+       }
+
+       function function1
+       {
+               typeset compound_var=()
+
+               function2 compound_var
+
+               printf "x=%d, y=%d\n" compound_var.x compound_var.y 
+       }
+
+       x="\$(function1)"
+
+       [[ "\$x" == 'x=19, y=20' ]] || err_exit "expected 'x=19, y=20', got 
'\${x}'"
+
+EOF
+) | ${SHELL}
+(( Errors+=$? ))
+
+
+#
+# name reference test #002
+# Originally derived from the xmldocumenttree1.sh demo which failed
+# with ast-ksh.2009-04-15 since the nodepath+nodesnum nameref calls
+# were removing the compound variable members nodes+nodesnum (caused
+# by a scoping bug)
+#
+(
+cat <<EOF
+       compound xdoc
+       compound -A xdoc.nodes
+       integer xdoc.nodesnum=0
+
+       function test1
+       {
+               nameref doc=xdoc
+               nameref nodepath="doc.nodes"
+               nameref nodesnum="doc.nodesnum"
+               print -v doc
+       }
+
+       test1
+EOF
+) | out=$( ${SHELL} ) || err_exit "shell returned exit code $?"
+
+(( ${ wc -l <<<"${out}" ; } == 4 )) || err_exit "Expected four lines of 
output, got ${out}"
+(set -o errexit ; read -C tmp <<<"${out}" ; [[ "$(typeset +p tmp.nodes)" == 
*-A* ]]) || err_exit "missing variable tmp.nodes"
+(set -o errexit ; read -C tmp <<<"${out}" ; [[ -v tmp.nodesnum                 
  ]]) || err_exit "missing variable tmp.nodesnum"
+
+
+#
+# name reference test #003a
+# ast-ksh.2009-06-30 failed with the following compound variable/nameref test
+#
+(
+cat <<EOF
+       compound -A addrsp
+
+       nameref sp=addrsp
+        
+       sp[14]=( size=1 )
+        
+       if [[ -v sp[19] ]] ; then
+               print "should not happen"
+       else
+               print "Ok"
+       fi
+EOF
+) | out=$( ${SHELL} ) || err_exit "shell returned exit code $?"
+[[ "${out}" == "Ok" ]] || err_exit "Expected 'Ok', got ${out}"
+
+
+#
+# name reference test #003b
+# (same as test #003a but uses a function)
+# ast-ksh.2009-06-30 failed with the following compound variable/nameref test
+#
+(
+cat <<EOF
+       compound -A addrsp
+       
+       function t1
+       {
+               nameref sp=\$1
+        
+               sp[14]=( size=1 )
+        
+               if [[ -v sp[19] ]] ; then
+                       print "should not happen"
+               else
+                       print "Ok"
+               fi
+       }
+
+       t1 addrsp
+EOF
+) | out=$( ${SHELL} ) || err_exit "shell returned exit code $?"
+[[ "${out}" == "Ok" ]] || err_exit "Expected 'Ok', got ${out}"
+
+
+#
+# name reference test #004a
+# (same as #003a but uses an indexed array instead of an associative one)
+# ast-ksh.2009-06-30 failed with the following compound variable/nameref test
+#
+(
+cat <<EOF
+       compound -a addrsp
+
+       nameref sp=addrsp
+        
+       sp[14]=( size=1 )
+        
+       if [[ -v sp[19] ]] ; then
+               print "should not happen"
+       else
+               print "Ok"
+       fi
+EOF
+) | out=$( ${SHELL} ) || err_exit "shell returned exit code $?"
+[[ "${out}" == "Ok" ]] || err_exit "Expected 'Ok', got ${out}"
+
+
+#
+# name reference test #004b
+# (same as test #004a but uses a function)
+# ast-ksh.2009-06-30 failed with the following compound variable/nameref test
+#
+(
+cat <<EOF
+       compound -a addrsp
+       
+       function t1
+       {
+               nameref sp=\$1
+        
+               sp[14]=( size=1 )
+        
+               if [[ -v sp[19] ]] ; then
+                       print "should not happen"
+               else
+                       print "Ok"
+               fi
+       }
+
+       t1 addrsp
+EOF
+) | out=$( ${SHELL} ) || err_exit "shell returned exit code $?"
+[[ "${out}" == "Ok" ]] || err_exit "Expected 'Ok', got ${out}"
+
+
+# tests done
+exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/sun_solaris_compoundvario.sh  Fri Sep 
25 06:39:13 2009
+++ new/usr/src/lib/libshell/common/tests/sun_solaris_compoundvario.sh  Fri Sep 
25 06:39:11 2009
@@ -20,20 +20,25 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
+# test setup
 function err_exit
 {
        print -u2 -n "\t"
        print -u2 -r ${Command}[$1]: "${@:2}"
-       (( Errors+=1 ))
+       (( Errors++ ))
 }
-
 alias err_exit='err_exit $LINENO'
 
-typeset -C bracketstat=(
+# "nounset" disabled for now
+#set -o nounset
+Command=${0##*/}
+integer Errors=0
+
+compound bracketstat=(
        integer bopen=0
        integer bclose=0
 )
@@ -57,8 +62,46 @@
        return 0
 }
 
-integer Errors=0
+# compound variable "cat" nr.1, using $ print "%B\n" ... #
+function cpvcat1
+{
+       set -o errexit
+       compound tmp
+       
+       while read -C tmp ; do printf "%B\n" tmp ; done
+       return 0
+}
 
+# compound variable "cat" nr.2, using $ print "%#B\n" ... #
+function cpvcat2
+{
+       set -o errexit
+       compound tmp
+       
+       while read -C tmp ; do printf "%#B\n" tmp ; done
+       return 0
+}
+
+# compound variable "cat" nr.3, using $ print -C ... #
+function cpvcat3
+{
+       set -o errexit
+       compound tmp
+       
+       while read -C tmp ; do print -C tmp ; done
+       return 0
+}
+
+# compound variable "cat" nr.4, using $ print -v ... #
+function cpvcat4
+{
+       set -o errexit
+       compound tmp
+       
+       while read -C tmp ; do print -v tmp ; done
+       return 0
+}
+
 typeset s
 
 # Test 1:
@@ -71,7 +114,7 @@
 # -- snip --
 # (additionally we test some extra stuff like bracket count)
 s=${
-       typeset -C x=(
+       compound x=(
                a=1 b=2
                typeset -a myarray=( 1 2 3 4 5 6 7 8 9 10 )
                typeset -A myarray2=( [a]=1 [b]=2 ["c d"]=3 [e]=4 ["f"]=5 [g]=6 
[h]=7 [i]=8 [j]=9 [k]=10 )
@@ -88,7 +131,7 @@
                                integer at=90
                        )
                        [e]=(
-                               typeset -C nested_cpv=(
+                               compound nested_cpv=(
                                        typeset -a myarray=( 1 2 3 4 5 6 7 8 9 
10 )
                                        typeset str=$'a \'string'
                                )
@@ -96,6 +139,12 @@
                        [f]=(
                                typeset g="f"
                        )
+                       [a_nan]=(
+                               float my_nan=-nan
+                       )
+                       [a_hexfloat]=(
+                              typeset -X my_hexfloat=1.1
+                       )
                )
        )
 
@@ -102,7 +151,7 @@
        {
                printf "%B\n" x
                print "hello"
-       } | {
+       } | cpvcat1 | cpvcat2 | cpvcat3 | cpvcat4 | {
                read -C y
                read s
        }
@@ -111,6 +160,8 @@
 
 [[ "${s}" == "xhellox" ]] || err_exit "Expected 'xhellox', got ${s}"
 count_brackets "$y" || err_exit "y: bracket open ${bracketstat.bopen} != 
bracket close ${bracketstat.bclose}"
+count_brackets "$(print -v y)" || err_exit "y: bracket open 
${bracketstat.bopen} != bracket close ${bracketstat.bclose}"
+count_brackets "$(print -C y)" || err_exit "y: bracket open 
${bracketstat.bopen} != bracket close ${bracketstat.bclose}"
 
 # cleanup
 unset x y || err_exit "unset failed"
@@ -128,11 +179,11 @@
 # <compound var>
 # -- snip --
 s=${
-       typeset -C x=(
+       compound x=(
                a=1 b=2
                typeset -a myarray=( 1 2 3 4 5 6 7 8 9 10 )
                typeset -A myarray2=( [a]=1 [b]=2 ["c d"]=3 [e]=4 ["f"]=5 [g]=6 
[h]=7 [i]=8 [j]=9 [k]=10 )
-               typeset -A myarray3=(
+               compound -A myarray3=(
                        [a]=(
                                float m1=0.5
                                float m2=0.6
@@ -145,7 +196,7 @@
                                integer at=90
                        )
                        [e]=(
-                               typeset -C nested_cpv=(
+                               compound nested_cpv=(
                                        typeset -a myarray=( 1 2 3 4 5 6 7 8 9 
10 )
                                        typeset str=$'a \'string'
                                )
@@ -153,6 +204,12 @@
                        [f]=(
                                typeset g="f"
                        )
+                       [a_nan]=(
+                               float my_nan=-nan
+                       )
+                       [a_hexfloat]=(
+                              typeset -X my_hexfloat=1.1
+                       )
                )
        )
 
@@ -160,7 +217,7 @@
                printf "%B\n" x
                print "hello"
                printf "%B\n" x
-       } | {
+       } | cpvcat1 | cpvcat2 | cpvcat3 | cpvcat4 | {
                read -C y1
                read s
                read -C y2
@@ -170,10 +227,22 @@
 } || err_exit "test returned exit code $?"
 
 [[ "${s}" == "xhellox" ]] || err_exit "Expected 'xhellox', got ${s}."
+[[ "${y1.myarray3[b].foo}" == "bar" ]] || err_exit "y1.myarray3[b].foo != bar"
+[[ "${y2.myarray3[b].foo}" == "bar" ]] || err_exit "y2.myarray3[b].foo != bar"
 [[ "$y1" != "" ]] || err_exit "y1 is empty"
 [[ "$y2" != "" ]] || err_exit "y2 is empty"
+(( ${#y1.myarray3[e].nested_cpv.myarr...@]} == 10 )) || err_exit "Expected 10 
elements in y1.myarray3[e].nested_cpv, got ${#y1.myarray3[e].nested_c...@]}"
+(( ${#y2.myarray3[e].nested_cpv.myarr...@]} == 10 )) || err_exit "Expected 10 
elements in y2.myarray3[e].nested_cpv, got ${#y2.myarray3[e].nested_c...@]}"
+(( isnan(y1.myarray3[a_nan].my_nan) ))   || err_exit 
"y1.myarray3[a_nan].my_nan not a NaN"
+(( isnan(y2.myarray3[a_nan].my_nan) ))   || err_exit 
"y2.myarray3[a_nan].my_nan not a NaN"
+(( signbit(y1.myarray3[a_nan].my_nan) )) || err_exit 
"y1.myarray3[a_nan].my_nan not negative"
+(( signbit(y2.myarray3[a_nan].my_nan) )) || err_exit 
"y2.myarray3[a_nan].my_nan not negative"
 count_brackets "$y1" || err_exit "y1: bracket open ${bracketstat.bopen} != 
bracket close ${bracketstat.bclose}"
+count_brackets "$(print -v y1)" || err_exit "y1: bracket open 
${bracketstat.bopen} != bracket close ${bracketstat.bclose}"
+count_brackets "$(print -C y1)" || err_exit "y1: bracket open 
${bracketstat.bopen} != bracket close ${bracketstat.bclose}"
 count_brackets "$y2" || err_exit "y2: bracket open ${bracketstat.bopen} != 
bracket close ${bracketstat.bclose}"
+count_brackets "$(print -v y2)" || err_exit "y2: bracket open 
${bracketstat.bopen} != bracket close ${bracketstat.bclose}"
+count_brackets "$(print -C y2)" || err_exit "y2: bracket open 
${bracketstat.bopen} != bracket close ${bracketstat.bclose}"
 [[ "$y1" == "$y2" ]] || err_exit "Expected $(printf "%q\n" "${y1}") == 
$(printf "%q\n" "${y2}")."
 [[ "$x"  == "$y1" ]] || err_exit "Expected $(printf "%q\n" "${x}") == $(printf 
"%q\n" "${y}")."
 
@@ -185,11 +254,11 @@
 
 
 # Test 3: Test compound variable copy operator vs. "read -C"
-typeset -C x=(
+compound x=(
        a=1 b=2
        typeset -a myarray=( 1 2 3 4 5 6 7 8 9 10 )
        typeset -A myarray2=( [a]=1 [b]=2 ["c d"]=3 [e]=4 ["f"]=5 [g]=6 [h]=7 
[i]=8 [j]=9 [k]=10 )
-       typeset -A myarray3=(
+       compound -A myarray3=(
                [a]=(
                        float m1=0.5
                        float m2=0.6
@@ -202,7 +271,7 @@
                        integer at=90
                )
                [e]=(
-                       typeset -C nested_cpv=(
+                       compound nested_cpv=(
                                typeset -a myarray=( 1 2 3 4 5 6 7 8 9 10 )
                                typeset str=$'a \'string'
                        )
@@ -210,16 +279,25 @@
                [f]=(
                        typeset g="f"
                )
+               [a_nan]=(
+                       float my_nan=-nan
+               )
+               [a_hexfloat]=(
+                      typeset -X my_hexfloat=1.1
+               )
        )
 )
 
-typeset -C x_copy=x || err_exit "x_copy copy failed"
+compound x_copy=x || err_exit "x_copy copy failed"
 [[ "${x_copy}" != "" ]] || err_exit "x_copy should not be empty"
 count_brackets "${x_copy}" || err_exit "x_copy: bracket open 
${bracketstat.bopen} != bracket close ${bracketstat.bclose}"
+count_brackets "$(print -v x_copy)" || err_exit "x_copy: bracket open 
${bracketstat.bopen} != bracket close ${bracketstat.bclose}"
+count_brackets "$(print -C x_copy)" || err_exit "x_copy: bracket open 
${bracketstat.bopen} != bracket close ${bracketstat.bclose}"
 
-typeset -C nested_cpv_copy
+compound nested_cpv_copy
 
 nested_cpv_copy=x.myarray3[e].nested_cpv || err_exit "x.myarray3[e].nested_cpv 
copy failed"
+(( ${#nested_cpv_copy.myarr...@]} == 10 )) || err_exit "Expected 10 elements 
in nested_cpv_copy.myarray, got ${#nested_cpv_copy.myarr...@]}"
 
 # unset branch "x.myarray3[e].nested_cpv" of the variable tree "x" ...
 unset x.myarray3[e].nested_cpv || err_exit "unset x.myarray3[e].nested_cpv 
failed"
@@ -226,11 +304,16 @@
 [[ "${x.myarray3[e].nested_cpv}" == "" ]] || err_exit 
"x.myarray3[e].nested_cpv still has a value"
 
 # ... and restore it from the saved copy
-printf "%B\n" nested_cpv_copy | read -C x.myarray3[e].nested_cpv || err_exit 
"read failed"
+printf "%B\n" nested_cpv_copy | cpvcat1 | cpvcat2 | cpvcat3 | cpvcat4 | read 
-C x.myarray3[e].nested_cpv || err_exit "read failed"
 
 # compare copy of the original tree and the modified one
 [[ "${x}" == "${x_copy}" ]] || err_exit "x != x_copy"
 count_brackets "${x}" || err_exit "x: bracket open ${bracketstat.bopen} != 
bracket close ${bracketstat.bclose}"
+count_brackets "$(print -v x)" || err_exit "x: bracket open 
${bracketstat.bopen} != bracket close ${bracketstat.bclose}"
+count_brackets "$(print -C x)" || err_exit "x: bracket open 
${bracketstat.bopen} != bracket close ${bracketstat.bclose}"
+(( ${#x.myarray3[e].nested_cpv.myarr...@]} == 10 )) || err_exit "Expected 10 
elements in x.myarray3[e].nested_cpv, got ${#x.myarray3[e].nested_c...@]}"
+(( isnan(x.myarray3[a_nan].my_nan) ))   || err_exit "x.myarray3[a_nan].my_nan 
not a NaN"
+(( signbit(x.myarray3[a_nan].my_nan) )) || err_exit "x.myarray3[a_nan].my_nan 
not negative"
 
 # cleanup
 unset x x_copy nested_cpv_copy || err_exit "unset failed"
@@ -238,14 +321,15 @@
 
 # Test 4: Test "read -C" failure for missing bracket at the end
 typeset s
-s=$($SHELL -c 'typeset -C myvar ; print "( unfinished=1" | read -C myvar 
2>/dev/null || print "error $?"') || err_exit "shell failed"
+s=$($SHELL -c 'compound myvar ; print "( unfinished=1" | read -C myvar 
2>/dev/null || print "error $?"') || err_exit "shell failed"
 [[ "$s" == "error 3" ]] || err_exit "compound_read: expected error 3, got ${s}"
 
 
 # Test 5: Test "read -C" failure for missing bracket at the beginning
 typeset s
-s=$($SHELL -c 'typeset -C myvar ; print "  unfinished=1 )" | read -C myvar 
2>/dev/null || print "error $?"') || err_exit "shell failed"
+s=$($SHELL -c 'compound myvar ; print "  unfinished=1 )" | read -C myvar 
2>/dev/null || print "error $?"') || err_exit "shell failed"
 [[ "$s" == "error 3" ]] || err_exit "compound_read: expected error 3, got ${s}"
 
+
 # tests done
 exit $((Errors))
--- 
old/usr/src/lib/libshell/common/tests/sun_solaris_cr_6687139_command_substitution_exec_redirection_allocation_loop.sh
       Fri Sep 25 06:39:16 2009
+++ 
new/usr/src/lib/libshell/common/tests/sun_solaris_cr_6687139_command_substitution_exec_redirection_allocation_loop.sh
       Fri Sep 25 06:39:14 2009
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -46,6 +46,7 @@
 # -- snip --
 #
 
+# test setup
 function err_exit
 {
        print -u2 -n "\t"
@@ -54,6 +55,10 @@
 }
 alias err_exit='err_exit $LINENO'
 
+set -o nounset
+Command=${0##*/}
+integer Errors=0
+
 function isvalidpid
 {
        kill -0 ${1} 2>/dev/null && return 0
@@ -60,9 +65,6 @@
        return 1
 }
 
-Command=${0##*/}
-integer Errors=0
-
 integer childpid
 typeset testdir
 integer childretval
@@ -208,5 +210,6 @@
 cd /tmp
 rmdir "${testdir}" || err_exit "Could not remove temporary test directory 
${testdir}"
 
+
 # tests done
 exit $((Errors))
--- 
old/usr/src/lib/libshell/common/tests/sun_solaris_cr_6713682_compound_var_bleeds_through_subshell.sh
        Fri Sep 25 06:39:19 2009
+++ 
new/usr/src/lib/libshell/common/tests/sun_solaris_cr_6713682_compound_var_bleeds_through_subshell.sh
        Fri Sep 25 06:39:17 2009
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -51,17 +51,20 @@
 # ... provides the correct output.
 #
 
+# test setup
 function err_exit
 {
        print -u2 -n "\t"
        print -u2 -r ${Command}[$1]: "${@:2}"
-       (( Errors+=1 ))
+       (( Errors++ ))
 }
-
 alias err_exit='err_exit $LINENO'
 
+set -o nounset
+Command=${0##*/}
 integer Errors=0
 
+
 typeset var1 var2
 
 # use unset, l=() compound syntax and print
@@ -75,13 +78,13 @@
 [[ "${var1}" == "${var2}" ]] || err_exit "Non-fork()'ed subshell output 
differes from fork()'ed subshell output (without unset)."
 
 # use unset, typeset -C compound syntax and print
-var1="$(${SHELL} -c 'unset l ; (               typeset -C l ; l.a=1 ; l.b="BE" 
; print "$l" ) ; print $l')" || err_exit "Non-zero exit code."
-var2="$(${SHELL} -c 'unset l ; ( ulimit -c 0 ; typeset -C l ; l.a=1 ; l.b="BE" 
; print "$l" ) ; print $l')" || err_exit "Non-zero exit code."
+var1="$(${SHELL} -c 'unset l ; (               compound l ; l.a=1 ; l.b="BE" ; 
print "$l" ) ; print $l')" || err_exit "Non-zero exit code."
+var2="$(${SHELL} -c 'unset l ; ( ulimit -c 0 ; compound l ; l.a=1 ; l.b="BE" ; 
print "$l" ) ; print $l')" || err_exit "Non-zero exit code."
 [[ "${var1}" == "${var2}" ]] || err_exit "Non-fork()'ed subshell output 
differes from fork()'ed subshell output (with unset)."
 
 # do not use unset, typeset -C compound syntax and print
-var1="$(${SHELL} -c '(              typeset -C l ; l.a=1 ; l.b="BE" ; print 
"$l" ) ; print $l')" || err_exit "Non-zero exit code."
-var2="$(${SHELL} -c '( ulimit -c 0 ; typeset -C l ; l.a=1 ; l.b="BE" ; print 
"$l" ) ; print $l')" || err_exit "Non-zero exit code."
+var1="$(${SHELL} -c '(              compound l ; l.a=1 ; l.b="BE" ; print "$l" 
) ; print $l')" || err_exit "Non-zero exit code."
+var2="$(${SHELL} -c '( ulimit -c 0 ; compound l ; l.a=1 ; l.b="BE" ; print 
"$l" ) ; print $l')" || err_exit "Non-zero exit code."
 [[ "${var1}" == "${var2}" ]] || err_exit "Non-fork()'ed subshell output 
differes from fork()'ed subshell output (with unset)."
 
 # use unset, l=() compound syntax and printf "%B\n"
@@ -95,14 +98,15 @@
 [[ "${var1}" == "${var2}" ]] || err_exit "Non-fork()'ed subshell output 
differes from fork()'ed subshell output (without unset)."
 
 # use unset, typeset -C compound syntax and printf "%B\n"
-var1="$(${SHELL} -c 'unset l ; (               typeset -C l ; l.a=1 ; l.b="BE" 
; printf "%B\n" l) ; printf "%B\n" l')" || err_exit "Non-zero exit code."
-var2="$(${SHELL} -c 'unset l ; ( ulimit -c 0 ; typeset -C l ; l.a=1 ; l.b="BE" 
; printf "%B\n" l) ; printf "%B\n" l')" || err_exit "Non-zero exit code."
+var1="$(${SHELL} -c 'unset l ; (               compound l ; l.a=1 ; l.b="BE" ; 
printf "%B\n" l) ; printf "%B\n" l')" || err_exit "Non-zero exit code."
+var2="$(${SHELL} -c 'unset l ; ( ulimit -c 0 ; compound l ; l.a=1 ; l.b="BE" ; 
printf "%B\n" l) ; printf "%B\n" l')" || err_exit "Non-zero exit code."
 [[ "${var1}" == "${var2}" ]] || err_exit "Non-fork()'ed subshell output 
differes from fork()'ed subshell output (with unset)."
 
 # do not use unset, typeset -C compound syntax and printf "%B\n"
-var1="$(${SHELL} -c '(              typeset -C l ; l.a=1 ; l.b="BE" ; printf 
"%B\n" l) ; printf "%B\n" l')" || err_exit "Non-zero exit code."
-var2="$(${SHELL} -c '( ulimit -c 0 ; typeset -C l ; l.a=1 ; l.b="BE" ; printf 
"%B\n" l) ; printf "%B\n" l')" || err_exit "Non-zero exit code."
+var1="$(${SHELL} -c '(              compound l ; l.a=1 ; l.b="BE" ; printf 
"%B\n" l) ; printf "%B\n" l')" || err_exit "Non-zero exit code."
+var2="$(${SHELL} -c '( ulimit -c 0 ; compound l ; l.a=1 ; l.b="BE" ; printf 
"%B\n" l) ; printf "%B\n" l')" || err_exit "Non-zero exit code."
 [[ "${var1}" == "${var2}" ]] || err_exit "Non-fork()'ed subshell output 
differes from fork()'ed subshell output (with unset)."
 
+
 # tests done
 exit $((Errors))
--- 
old/usr/src/lib/libshell/common/tests/sun_solaris_cr_6722134_background_CHLD_trap.sh
        Fri Sep 25 06:39:22 2009
+++ 
new/usr/src/lib/libshell/common/tests/sun_solaris_cr_6722134_background_CHLD_trap.sh
        Fri Sep 25 06:39:20 2009
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -40,17 +40,20 @@
 # -- snip --
 #
 
+# test setup
 function err_exit
 {
        print -u2 -n "\t"
        print -u2 -r ${Command}[$1]: "${@:2}"
-       (( Errors+=1 ))
+       (( Errors++ ))
 }
-
 alias err_exit='err_exit $LINENO'
 
+set -o nounset
+Command=${0##*/}
 integer Errors=0
 
+
 ##
 ## test one:
 ##
@@ -115,5 +118,6 @@
 (( count=$(fgrep "got_child" <<< "$s" | wc -l) )) || err_exit "counting 
failed."
 (( count == 3 )) || err_exit "Expected count==3, got count==${count}."
 
+
 # tests done
 exit $((Errors))
--- 
old/usr/src/lib/libshell/common/tests/sun_solaris_cr_6753538_subshell_leaks_umask.sh
        Fri Sep 25 06:39:25 2009
+++ 
new/usr/src/lib/libshell/common/tests/sun_solaris_cr_6753538_subshell_leaks_umask.sh
        Fri Sep 25 06:39:23 2009
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -40,17 +40,20 @@
 # -- snip --
 
 
+# test setup
 function err_exit
 {
        print -u2 -n "\t"
        print -u2 -r ${Command}[$1]: "${@:2}"
-       (( Errors+=1 ))
+       (( Errors++ ))
 }
-
 alias err_exit='err_exit $LINENO'
 
+set -o nounset
+Command=${0##*/}
 integer Errors=0
 
+
 #
 # test set 1: Simple umask in subshell
 #
@@ -93,5 +96,6 @@
 y=$(${SHELL} -c 'umask  0; (ulimit -c 0 ; umask 20); umask') || err_exit 
"shell failed."
 [[ "$x" == "$y" ]] || err_exit "$x != $y"
 
+
 # tests done
 exit $((Errors))
--- 
old/usr/src/lib/libshell/common/tests/sun_solaris_cr_6754020_weird_square_bracket_expansion.sh
      Fri Sep 25 06:39:28 2009
+++ 
new/usr/src/lib/libshell/common/tests/sun_solaris_cr_6754020_weird_square_bracket_expansion.sh
      Fri Sep 25 06:39:26 2009
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -45,17 +45,20 @@
 # ---- snip ----
 
 
+# test setup
 function err_exit
 {
        print -u2 -n "\t"
        print -u2 -r ${Command}[$1]: "${@:2}"
-       (( Errors+=1 ))
+       (( Errors++ ))
 }
-
 alias err_exit='err_exit $LINENO'
 
+set -o nounset
+Command=${0##*/}
 integer Errors=0
 
+
 typeset s
 
 # test using "echo"
--- 
old/usr/src/lib/libshell/common/tests/sun_solaris_cr_6763594_command_failure_execs_twice.sh
 Fri Sep 25 06:39:30 2009
+++ 
new/usr/src/lib/libshell/common/tests/sun_solaris_cr_6763594_command_failure_execs_twice.sh
 Fri Sep 25 06:39:29 2009
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -63,17 +63,20 @@
 # ---- snip ----
 
 
+# test setup
 function err_exit
 {
        print -u2 -n "\t"
        print -u2 -r ${Command}[$1]: "${@:2}"
-       (( Errors+=1 ))
+       (( Errors++ ))
 }
-
 alias err_exit='err_exit $LINENO'
 
+set -o nounset
+Command=${0##*/}
 integer Errors=0
 
+
 typeset testtmpdir=/tmp/ksh93_test_cr_6763594_${PPID}_$$
 mkdir "${testtmpdir}" || { err_exit "Could not create temporary directory 
${testtmpdir}." ; exit ${Errors} ; }
 
@@ -90,6 +93,7 @@
 rm "myfoo" "out_stdout" "out_stderr" || err_exit "rm failed."
 cd ..
 rmdir "${testtmpdir}" || err_exit "Failed to remove temporary directory 
${testtmpdir}."
- 
+
+
 # tests done
 exit $((Errors))
--- 
old/usr/src/lib/libshell/common/tests/sun_solaris_cr_6766246_pattern_matching_bug.sh
        Fri Sep 25 06:39:33 2009
+++ 
new/usr/src/lib/libshell/common/tests/sun_solaris_cr_6766246_pattern_matching_bug.sh
        Fri Sep 25 06:39:32 2009
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -70,15 +70,17 @@
 # ---- snip ----
 
 
+# test setup
 function err_exit
 {
        print -u2 -n "\t"
        print -u2 -r ${Command}[$1]: "${@:2}"
-       (( Errors+=1 ))
+       (( Errors++ ))
 }
-
 alias err_exit='err_exit $LINENO'
 
+set -o nounset
+Command=${0##*/}
 integer Errors=0
 
 
@@ -168,5 +170,6 @@
        done
 done
 
+
 # tests done
 exit $((Errors))
--- /dev/null   Fri Sep 25 06:39:36 2009
+++ 
new/usr/src/lib/libshell/common/tests/sun_solaris_cr_6769332_substitutions_terminate_shell_after_257_iterations.sh
  Fri Sep 25 06:39:34 2009
@@ -0,0 +1,124 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# This test checks whether ksh93 supports more than 256 recursive
+# function+command substitution calls.
+#
+# This was reported as CR #6769332 ('Recursive function+command
+# substitutions terminate shell after 257 iterations'):
+# ------------ snip ------------
+# Recursive function+command substitutions
+# (e.g. func1() { x=$( func2 ) ; } ; x=$( func1 ) ) terminate the
+# ksh93 shell after 257 iterations with a exit code of "0" (it
+# seems the shell just "quits" after the last "return 0" statement
+# in the function).
+# Running the attached testcase terminates the shell after 257
+# iterations (g=257 in the script) while 256 iterations (replace
+# "257" with "256" in the script) just works fine.
+# The same testcase works Ok in ksh88 (=/usr/bin/ksh in
+# Solaris 10U5)
+#
+# Expected Result
+#    The script should output "done" and return the exit code 0.
+#
+# Actual Result
+#    No messsge. Exit code "0".
+#
+# Error Message(s)
+#    None (exit code is "0").
+#
+# Test Case
+#    f1()
+# {
+#         h=$1
+#         (( h=h-1 ))
+#         (( h <= 0 )) && return 0
+#         x=$(f1 "$h" "$l" "$g" d e "$l") || print -u2 "$g/$h: fail"
+#         return 0
+# }
+# l=""
+# g=257
+# i=0
+# while (( i < $g )) ; do
+#         l="${l}x"
+#         (( i=i+1 ))
+# done
+# f1 "$g" "$l" "$g" d e "$l" || print -u2 "$g: fail0"
+# print "done"
+# exit 0
+#
+# Workaround
+#    -
+# ------------ snip ------------
+#
+
+# test setup
+function err_exit
+{
+       print -u2 -n "\t"
+       print -u2 -r ${Command}[$1]: "${@:2}"
+       (( Errors++ ))
+}
+alias err_exit='err_exit $LINENO'
+
+set -o nounset
+Command=${0##*/}
+integer Errors=0
+
+#
+# test1: Testcase from CR #6769332 
+#
+(
+cat <<EOF
+# make sure we have enougth stack (needed for 64bit SPARC and SystemZ)
+ulimit -s 65536
+
+f1()
+{
+        h=\$1
+        (( h=h-1 ))
+        (( h <= 0 )) && return 0
+        x=\$(f1 "\$h" "\$l" "\$g" d e "\$l") || print -u2 "\$g/\$h: fail"
+        return 0
+}
+l=""
+g=257
+i=0
+while (( i < \$g )) ; do
+        l="\${l}x"
+        (( i=i+1 ))
+done
+f1 "\$g" "\$l" "\$g" d e "\$l" || print -u2 "\$g: fail0"
+print "done"
+EOF
+) | out="$( ${SHELL} 2>&1 ; )" || err_exit "Shell returned non-zero exit code 
$?."
+
+[[ "${out}" == "done" ]] || err_exit "Output expected to be 'done', got 
'${out}'."
+
+
+# tests done
+exit $((Errors))
--- /dev/null   Fri Sep 25 06:39:39 2009
+++ 
new/usr/src/lib/libshell/common/tests/sun_solaris_cr_6777491_lacks_arithmetric_function_iszero.sh
   Fri Sep 25 06:39:37 2009
@@ -0,0 +1,95 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# This test checks whether the arithmetric function "iszero" is available.
+#
+# This was reported as CR #6777491 ("*ksh93* lacks arithmetric function
+# iszero()"):
+# ------------ snip ------------
+# ksh93 lacks arithmetric function "iszero()" which limits the ability
+# to classify floating-point values or even correctly match against
+# zero (since IEEE754-1985/2008 floating-point math differs between
+# positive and negaive zero values).
+# Frequency
+#    Always
+# Regression
+#    No
+# Steps to Reproduce
+#    $ ksh93 -c '(( iszero(0) )) && print "0 is a zero"'
+# Expected Result
+#    Output to stdout:
+# -- snip --
+# 0 is a zero
+# -- snip --
+# Actual Result
+#    ksh93 exists with:
+# -- snip --
+# ksh93: iszero(0) : unknown function
+# -- snip --
+# Error Message(s)
+#    ksh93: iszero(0) : unknown function
+# Test Case
+#    ksh93 -c '(( iszero(0) )) && print "0 is a zero"'
+# ------------ snip ------------
+#
+
+# test setup
+function err_exit
+{
+       print -u2 -n "\t"
+       print -u2 -r ${Command}[$1]: "${@:2}"
+       (( Errors++ ))
+}
+alias err_exit='err_exit $LINENO'
+
+set -o nounset
+Command=${0##*/}
+integer Errors=0
+
+typeset str
+integer i
+
+typeset -a tests=(
+       '(( iszero(0)   )) && print "OK"'
+       '(( iszero(0.)  )) && print "OK"'
+       '(( iszero(-0)  )) && print "OK"'
+       '(( iszero(-0.) )) && print "OK"'
+       'float n=0.  ; (( iszero(n) )) && print "OK"'
+       'float n=+0. ; (( iszero(n) )) && print "OK"'
+       'float n=-0. ; (( iszero(n) )) && print "OK"'
+       'float n=1.  ; (( iszero(n) )) || print "OK"'
+       'float n=1.  ; (( iszero(n-1.) )) && print "OK"'
+       'float n=-1. ; (( iszero(n+1.) )) && print "OK"'
+)
+
+for (( i=0 ; i < ${#tes...@]} ; i++ )) ; do
+       str="$( $SHELL -o errexit -c "${tests[i]}" 2>&1 )" || err_exit "test 
$i: returned non-zero exit code $?"
+       [[ "${str}" == "OK" ]] || err_exit "test $i: expected 'OK', got 
'${str}'"
+done
+
+# tests done
+exit $((Errors))
--- /dev/null   Fri Sep 25 06:39:42 2009
+++ 
new/usr/src/lib/libshell/common/tests/sun_solaris_cr_6778077_sigthaw_trap.sh    
    Fri Sep 25 06:39:40 2009
@@ -0,0 +1,83 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# This test checks whether ksh93 supports traps for the SIGTHAW
+# signal.
+#
+# This was reported as CR #6778077 ("*ksh93* does not understand "THAW"
+# as a signal for use with trap"):
+# -- snip --
+# While ksh93 understand THAW in the list of signals for kill it does
+# not understand it for "trap'
+# 
+# : pod5.eu TS 6 $; kill -l | egrep '(THAW|FREEZE)'
+# FREEZE
+# THAW
+# : pod5.eu TS 7 $; trap "echo THAW" THAW
+# ksh93: trap: THAW: bad trap
+# : pod5.eu TS 8 $;
+# 
+# Using the signal number (35) works around this.
+# -- snip --
+#
+
+# test setup
+function err_exit
+{
+       print -u2 -n "\t"
+       print -u2 -r ${Command}[$1]: "${@:2}"
+       (( Errors++ ))
+}
+alias err_exit='err_exit $LINENO'
+
+set -o nounset
+Command=${0##*/}
+integer Errors=0
+
+
+## test one: Check whether the shell supports SIGTHAW as trap
+${SHELL} -o errexit -c 'trap "true" SIGTHAW ; true' || err_exit "SIGTHAW not 
supported."
+${SHELL} -o errexit -c 'trap "true" THAW ; true'    || err_exit "THAW not 
supported."
+${SHELL} -o errexit -c 'trap "true" 35 ; true'      || err_exit "signal 35 not 
supported."
+
+
+## test two: Check whether the shell supports SIGFREEZE as trap
+## (we check this since it is SIGTHAW's counterpart)
+${SHELL} -o errexit -c 'trap "true" SIGFREEZE ; true' || err_exit "SIGFREEZE 
not supported."
+${SHELL} -o errexit -c 'trap "true" FREEZE ; true'    || err_exit "FREEZE not 
supported."
+${SHELL} -o errexit -c 'trap "true" 34 ; true'        || err_exit "signal 34 
not supported."
+
+
+## test three: Check all other signals listed by "kill -l"
+kill -l | while read i ; do
+       str="$( ${SHELL} -c "trap true $i ; print 'ok'" 2>&1 )" || err_exit 
"shell returned code $? for trap $i"
+       [[ "${str}" == "ok" ]] || err_exit "expected 'ok', got $str"
+done
+
+
+# tests done
+exit $((Errors))
--- /dev/null   Fri Sep 25 06:39:44 2009
+++ 
new/usr/src/lib/libshell/common/tests/sun_solaris_cr_6789247_printf_hexfloat_rounding.sh
    Fri Sep 25 06:39:43 2009
@@ -0,0 +1,130 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# This test checks whether arithmetric math correctly supports
+# negative zero values
+#
+# This was reported as CR #6789247 ("libast/ksh93 1-digit hexfloat base 
conversion rounds incorrectly"):
+# ---- snip ----
+# Description
+#   [The same issue was described in 
http://mail.opensolaris.org/pipermail/ksh93-integration-discuss/2008-December/006737.html]
+#   This is basically a spin-off of 
http://bugs.opensolaris.org/view_bug.do?bug_id=6773712 ("1-digit hex fp
+#   base conversion of long double rounds incorrectly").
+#   The bug description for Solaris libc says this:
+#   > The first line of output from this program is correct.  The second line
+#   > is not.
+#   > 
+#   > leviathan% cat a.c
+#   > #include <stdio.h>
+#   > 
+#   > int main()
+#   > {
+#   >     printf("%.0a\n", 1.5);
+#   >     printf("%.0La\n", 1.5L);
+#   >     return 0;
+#   > }
+#   > leviathan% cc -o a a.c
+#   > leviathan% a
+#   > 0x1p+1
+#   > 0x1p+0
+#   > leviathan%
+#   If I compile the testcase with libast on Solaris 11/B84 SPARC (which
+#   matches ast-open.2008-11-04) I get this:
+#   -- snip --
+#   $ cc -xc99=%all -I/usr/include/ast -last a.c -o a &&
+#   ./a                                             
+#   0x1p+00
+#   0x1p+00
+#   -- snip --
+#   ... which seems to be incorrect per the bugs comment above and should
+#   be:
+#   -- snip --
+#   0x1p+1
+#   0x1p+1
+#   -- snip --
+#   ksh93 has the same problem:
+#   $ ksh93 -c 'float r=1.5 ; printf "%.0a\n" r'
+#   0x1p+00
+# Steps to Reproduce
+#    Compile and run testcase like this:
+#    -- snip --
+#    $ cc -xc99=%all -I/usr/include/ast -last a.c -o a &&
+#    ./a                                             
+#    -- snip --
+# Expected Result
+#    0x1p+1
+#    0x1p+1
+# Actual Result
+#    0x1p+00
+#    0x1p+00
+# ---- snip ----
+#
+
+# test setup
+function err_exit
+{
+       print -u2 -n "\t"
+       print -u2 -r ${Command}[$1]: "${@:2}"
+       (( Errors++ ))
+}
+alias err_exit='err_exit $LINENO'
+
+set -o nounset
+Command=${0##*/}
+integer Errors=0
+
+
+float r
+float result
+typeset str
+
+# Test #001/a - check whether the result of a rounded 1.5 is 2.0
+r=1.5
+result=$(printf "%.0a\n" r) || err_exit "printf returned non-zero exit code"
+(( result == 2.0 )) || err_exit "result expected to be 2.0, got ${result}"
+
+
+# Test #001/b - same as test #001/a but uses "%.0A\n" instead of "%.0a\n"
+r=1.5
+result=$(printf "%.0A\n" r) || err_exit "printf returned non-zero exit code"
+(( result == 2.0 )) || err_exit "result expected to be 2.0, got ${result}"
+
+
+# Test #002/a - check whether the hexfloat string value matches the expected 
pattern
+r=1.5
+str=$(printf "%.0a\n" r) || err_exit "printf returned non-zero exit code"
+[[ "${str}" == ~(Glri)0x0*1p\+0*1 ]] || err_exit "str expected to match 
~(Glri)0x0*1p\+0*1, got |${str}|"
+
+
+# Test #002/b - same as test #002/a but uses "%.0A\n" instead of "%.0a\n"
+r=1.5
+str=$(printf "%.0A\n" r) || err_exit "printf returned non-zero exit code"
+[[ "${str}" == ~(Glri)0x0*1p\+0*1 ]] || err_exit "str expected to match 
~(Glri)0x0*1p\+0*1, got |${str}|"
+
+
+# tests done
+exit $((Errors))
--- 
old/usr/src/lib/libshell/common/tests/sun_solaris_cr_6800929_large_command_substitution_hang.sh
     Fri Sep 25 06:39:47 2009
+++ 
new/usr/src/lib/libshell/common/tests/sun_solaris_cr_6800929_large_command_substitution_hang.sh
     Fri Sep 25 06:39:45 2009
@@ -35,7 +35,8 @@
 # 
 # and here's where it's hung:
 # ---8<---
-#  xxxxx at xxxxx $ pstack 204600
+#  Edward Pilatowicz <edward.pilatowicz at sun.com> 
+# $ pstack 204600
 # 204600: /bin/ksh /opt/onbld/bin/Install -o debug -k i86xpv -T domu-219:/tmp
 #  fffffd7fff2e3d1a write    (1, 4154c0, 64)
 #  fffffd7ffefdafc8 sfwr () + 2d0
@@ -70,68 +71,142 @@
 # 
 # as it turns out, i can easily reproduce this problem as follows:
 # ---8<---
-#  xxxxx at xxxxx $ ksh93
-#  xxxxx at xxxxx $ set -- `cat /etc/termcap | sort | uniq`
+# $ ksh93
+# $ set -- `cat /etc/termcap | sort | uniq`
 # <hang>
 # ---8<---
 # ---- snip ----
 
 
+# test setup
 function err_exit
 {
        print -u2 -n "\t"
        print -u2 -r ${Command}[$1]: "${@:2}"
-       (( Errors+=1 ))
+       (( Errors++ ))
 }
-
 alias err_exit='err_exit $LINENO'
 
+set -o nounset
+Command=${0##*/}
 integer Errors=0
 
-integer i j d
+# common functions/variables
+function isvalidpid
+{
+       kill -0 ${1} 2>/dev/null && return 0
+       return 1
+}
+integer testfilesize i maxwait
 typeset tmpfile
+integer testid
 
+
 # test 1: run loop and check various temp filesizes
 tmpfile="$(mktemp 
"/tmp/sun_solaris_cr_6800929_large_command_substitution_hang.${PPID}.$$.XXXXXX")"
 || err_exit "Cannot create temporary file."
 
-for (( i=1*1024 ; i <= 512*1024 ; i*=2 )) ; do
+compound -a testcases=(
+       # test 1a: Run test child for $(...)
+       # (note the pipe chain has to end in a builtin command, an external 
command may not trigger the bug)
+       ( name="test1a" cmd="builtin cat ; print -- \"\$(cat \"${tmpfile}\" | 
cat)\" ; true" )
+       # test 1b: Same as test1a but uses ${... ; } instead if $(...)
+       ( name="test1b" cmd="builtin cat ; print -- \"\${ cat \"${tmpfile}\" | 
cat ; }\" ; true" )
+       # test 1c: Same as test1a but does not use a pipe
+       ( name="test1c" cmd="builtin cat ; print -- \"\$(cat \"${tmpfile}\" ; 
true)\" ; true" )
+       # test 1d: Same as test1a but does not use a pipe
+       ( name="test1d" cmd="builtin cat ; print -- \"\${ cat \"${tmpfile}\" ; 
true ; }\" ; true" )
+
+       # test 1e: Same as test1a but uses an external "cat" command
+       ( name="test1e" cmd="builtin -d cat /bin/cat ; print -- \"\$(cat 
\"${tmpfile}\" | cat)\" ; true" )
+       # test 1f: Same as test1a but uses an external "cat" command
+       ( name="test1f" cmd="builtin -d cat /bin/cat ; print -- \"\${ cat 
\"${tmpfile}\" | cat ; }\" ; true" )
+       # test 1g: Same as test1a but uses an external "cat" command
+       ( name="test1g" cmd="builtin -d cat /bin/cat ; print -- \"\$(cat 
\"${tmpfile}\" ; true)\" ; true" )
+       # test 1h: Same as test1a but uses an external "cat" command
+       ( name="test1h" cmd="builtin -d cat /bin/cat ; print -- \"\${ cat 
\"${tmpfile}\" ; true ; }\" ; true" )
+)
+
+for (( testfilesize=1*1024 ; testfilesize <= 1024*1024 ; testfilesize*=2 )) ; 
do
        # Create temp file
        {
-               for ((j=0 ; j < i ; j+=16 )) ; do
-                       print "0123456789abcde"
+               for (( i=0 ; i < testfilesize ; i+=64 )) ; do
+                       print 
"0123456789abcdef01234567890ABCDEF0123456789abcdef01234567890ABCDE"
                done
        } >"${tmpfile}"
-       
-       # Run test child
-       ${SHELL} -c "builtin cat ; print -- \"\$(cat \"${tmpfile}\" | cat)\" ; 
true" >/dev/null &
-       (( childpid=$! ))
 
        # wait up to log2(i) seconds for the child to terminate
        # (this is 10 seconds for 1KB and 19 seconds for 512KB)
-       (( d=log2(i) ))
-       for (( j=0 ; j < d ; j++ )) ; do
-               kill -0 ${childpid} 2>/dev/null || break
-               sleep 0.5
+       (( maxwait=log2(testfilesize) ))
+               
+       for testid in "${!testcas...@]}" ; do
+               nameref currtst=testcases[testid]
+               ${SHELL} -o errexit -c "${currtst.cmd}" >"${tmpfile}.out" &
+               (( childpid=$! ))
+
+               for (( i=0 ; i < maxwait ; i++ )) ; do
+                       isvalidpid ${childpid} || break
+                       sleep 0.25
+               done
+
+               if isvalidpid ${childpid} ; then
+                       err_exit "${currtst.name}: child (pid=${childpid}) 
still busy, filesize=${testfilesize}."
+                       kill -KILL ${childpid} 2>/dev/null
+               fi
+               wait || err_exit "${currtst.name}: Child returned non-zero exit 
code." # wait for child (and/or avoid zombies/slime)
+
+               # compare input/output
+               cmp -s "${tmpfile}" "${tmpfile}.out" || err_exit 
"${currtst.name}: ${tmpfile} and ${tmpfile}.out differ, 
filesize=${testfilesize}."
+               rm "${tmpfile}.out"
        done
 
-       if kill -0 ${childpid} 2>/dev/null ; then
-               err_exit "test1: child (pid=${childpid}) still busy, 
filesize=${i}."
-               kill -KILL ${childpid} 2>/dev/null
-       fi
-       wait # wait for child (and/or avoid zombies/slime)
+       # Cleanup
        rm "${tmpfile}"
 done
 
 
-# test 2: Edward's Solaris-specific testcase
-${SHELL} -c 'builtin uniq ; set -- `cat /etc/termcap | sort | uniq` ; true' 
>/dev/null &
+# test 2a: Edward Pilatowicz <edward.pilatowicz at sun.com>'s Solaris-specific 
testcase
+${SHELL} -o errexit -c 'builtin uniq ; set -- `cat /etc/termcap | sort | uniq` 
; true' >/dev/null &
 (( childpid=$! ))
 sleep 5
-if kill -0 ${childpid} 2>/dev/null ; then
-       err_exit "test2: child (pid=${childpid}) still busy."
+if isvalidpid ${childpid} ; then
+       err_exit "test2a: child (pid=${childpid}) still busy."
        kill -KILL ${childpid} 2>/dev/null
 fi
-wait # wait for child (and/or avoid zombies/slime)
+wait || err_exit "test2a: Child returned non-zero exit code." # wait for child 
(and/or avoid zombies/slime)
 
+
+# test 2b: Same as test 2a but uses ${... ; } instead of $(...)
+${SHELL} -o errexit -c 'builtin uniq ; set -- ${ cat /etc/termcap | sort | 
uniq ; } ; true' >/dev/null &
+(( childpid=$! ))
+sleep 5
+if isvalidpid ${childpid} ; then
+       err_exit "test2b: child (pid=${childpid}) still busy."
+       kill -KILL ${childpid} 2>/dev/null
+fi
+wait || err_exit "test2b: Child returned non-zero exit code." # wait for child 
(and/or avoid zombies/slime)
+
+
+# test 2c: Same as test 2a but makes sure that "uniq" is not a builtin
+${SHELL} -o errexit -c 'builtin -d uniq /bin/uniq ; set -- `cat /etc/termcap | 
sort | uniq` ; true' >/dev/null &
+(( childpid=$! ))
+sleep 5
+if isvalidpid ${childpid} ; then
+       err_exit "test2c: child (pid=${childpid}) still busy."
+       kill -KILL ${childpid} 2>/dev/null
+fi
+wait || err_exit "test2c: Child returned non-zero exit code." # wait for child 
(and/or avoid zombies/slime)
+
+
+# test 2d: Same as test 2c but uses ${... ; } instead of $(...)
+${SHELL} -o errexit -c 'builtin -d uniq /bin/uniq ; set -- ${ cat /etc/termcap 
| sort | uniq ; } ; true' >/dev/null &
+(( childpid=$! ))
+sleep 5
+if isvalidpid ${childpid} ; then
+       err_exit "test2d: child (pid=${childpid}) still busy."
+       kill -KILL ${childpid} 2>/dev/null
+fi
+wait || err_exit "test2d: Child returned non-zero exit code." # wait for child 
(and/or avoid zombies/slime)
+
+
 # tests done
 exit $((Errors))
--- /dev/null   Fri Sep 25 06:39:50 2009
+++ 
new/usr/src/lib/libshell/common/tests/sun_solaris_cr_6805792_varmovetest1.sh    
    Fri Sep 25 06:39:48 2009
@@ -0,0 +1,152 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# This test checks whether "typeset -m" correctly moves local variables
+# into a global variable tree.
+#
+# This was reported as CR #6805792 ("XXXX"):
+# -------- snip --------
+# The following attempt to move a local node into an associative array
+# fails like this:
+# -- snip --
+# typeset -C tree
+# function f1
+# {
+#        nameref tr=$1
+# 
+#        typeset -A tr.subtree
+# 
+#        typeset -C node
+# 
+#        node.one="hello"
+#        node.two="world"
+# 
+#        # move local note into the array
+#        typeset -m tr.subtree["a_node"]=node
+# 
+#        return 0
+# }
+# f1 tree
+# printf "%B\n" tree
+# print "ok"
+# exit 0
+# -- snip --
+# The output looks like this:
+# -- snip --
+# $ ksh93
+# varmovetest1.sh
+# (
+# (
+# )
+# ok
+# -- snip --
+# ... but AFAIK it should print:
+# -- snip --
+# (
+#        typeset -A subtree=(
+#                [a_node]=(
+#                        one=hello
+#                        two=world
+#                )
+#        )
+# )
+# ok
+# -- snip --
+# -------- snip --------
+#
+
+# test setup
+function err_exit
+{
+       print -u2 -n "\t"
+       print -u2 -r ${Command}[$1]: "${@:2}"
+       (( Errors++ ))
+}
+alias err_exit='err_exit $LINENO'
+
+set -o nounset
+Command=${0##*/}
+integer Errors=0
+
+
+## test start
+compound tree1 tree2
+
+# add node to tree which uses "typeset -m" to move a local variable
+# into tree1.subtree["a_node"]
+function f1
+{
+       nameref tr=$1
+       
+       typeset -A tr.subtree
+       
+       compound node
+       
+       node.one="dummy1"
+       node.two="dummy2"
+       
+       # We use the nameref's here since ast-ksh,2008-12-12 crashes
+       # when this function returns because "nodeone" and "nodetwo"
+       # still reference "node" which was renamed.
+       # (note that "f1" must be first function and the first being
+       # called, otherwise the crash will not occur)
+       nameref nodeone=node.one
+       nameref nodetwo=node.two
+       nodeone="hello"
+       nodetwo="world"
+       
+       # move local note into the array
+       typeset -m tr.subtree["a_node"]=node
+       
+       return 0
+}
+
+# Alternative version which uses "nameref" instead of "typeset -m"
+function f2
+{
+       nameref tr=$1
+       
+       typeset -A tr.subtree
+       
+       nameref node=tr.subtree["a_node"]
+       
+       node.one="hello"
+       node.two="world"
+       
+       return 0
+}
+
+f1 tree1
+f2 tree2
+
+[[ "${tree1.subtree["a_node"].one}" == "hello" ]] || err_exit "Expected 
tree1.subtree[\"a_node\"].one == 'hello', got ${tree1.subtree["a_node"].one}"
+[[ "${tree1.subtree["a_node"].two}" == "world" ]] || err_exit "Expected 
tree1.subtree[\"a_node\"].two == 'world', got ${tree1.subtree["a_node"].two}"
+[[ "${tree1}" == "${tree2}" ]] || err_exit "tree1 and tree2 
differ:"$'\n'"$(diff -u <( printf '%B\n' tree1 ) <( printf '%B\n' tree2 ) )"
+
+
+# tests done
+exit $((Errors))
--- /dev/null   Fri Sep 25 06:39:53 2009
+++ 
new/usr/src/lib/libshell/common/tests/sun_solaris_cr_6805794_character_to_wchar_not_working.sh
      Fri Sep 25 06:39:51 2009
@@ -0,0 +1,106 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# This test checks whether arithmetric operator '<character>
+# is working
+#
+# This was reported as CR #6805794 ('[ku1] printf returns "invalid character 
constant" for $ printf "%d\n" "'<euro>"'):
+# ------------ snip ------------
+# There seems be a bug in how ast-ksh.2008-11-04's "printf" builtin
+# handles multibyte characters. For example if I try this in the
+# en_US.UTF-8 locale ("<euro>" needs to be replace with the EURO symbol):
+# -- snip --
+# $ printf "%d\n" "'<euro>"
+# -ksh93: printf: warning: ': invalid character constant
+# 226
+# -- snip --
+# AFAIK the correct behaviour was to return the numeric value of the
+# <euro> symbol in this case (hexadecimal "20ac", decimal 8364), e.g.
+# -- snip --
+# $ printf "%d\n"
+# "'<euro>"
+# 8364
+# -- snip --
+# Frequency
+#    Always
+# Regression
+#    No
+# Steps to Reproduce
+#    Enter this in an interractive shell:
+# $ printf "%d\n" "'<euro>"
+# Expected Result
+#    -- snip --
+# $ printf "%d\n"
+# "'<euro>"
+# 8364
+# -- snip --
+# Actual Result
+#    -- snip --
+# $ printf "%d\n" "'<euro>"
+# -ksh93: printf: warning: ': invalid character constant
+# 226
+# -- snip --
+# Error Message(s)
+#    printf: warning: ': invalid character constant
+# Test Case
+#    printf "%d\n" "'<euro>"
+# Workaround
+#    None.
+# ------------ snip ------------
+#
+
+# test setup
+function err_exit
+{
+       print -u2 -n "\t"
+       print -u2 -r ${Command}[$1]: "${@:2}"
+       (( Errors++ ))
+}
+alias err_exit='err_exit $LINENO'
+
+set -o nounset
+Command=${0##*/}
+integer Errors=0
+
+
+# declare variables
+typeset str
+
+# test whether the locale uses an UTF-8 (-like) encoding and override it on 
demand
+[[ "$(printf "\u[20ac]")" == $'\342\202\254' ]] || LC_ALL=en_US.UTF-8
+if [[ "$(printf "\u[20ac]")" != $'\342\202\254' ]] ; then
+       err_exit "Local overrride failed."
+       exit $((Errors))
+fi
+
+# run test
+str=$(print $'printf "%d\\\\n" "\'\342\202\254"' | source /dev/stdin)
+[[ "${str}" == "8364" ]] || err_exit "expected 8364, got ${str}"
+
+
+# tests done
+exit $((Errors))
--- /dev/null   Fri Sep 25 06:39:56 2009
+++ 
new/usr/src/lib/libshell/common/tests/sun_solaris_cr_6805795_negative_zero.sh   
    Fri Sep 25 06:39:54 2009
@@ -0,0 +1,170 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# This test checks whether arithmetric math correctly supports
+# negative zero values
+#
+# This was reported as CR #6805795 ("[ku1] ksh93 does not differ between -0 
and +0"):
+# ------------ snip ------------
+#  Original bug report was:
+# ------ snip ------
+# Is there a reason why ksh93 does not display the negative sign for the
+# value zero ? For example if I have use the C99 function "copysign"
+# (copies absolute value of operant a and sign of operant b) I get this
+# for { a=5, b=-0 }:
+# -- snip --
+# $ ksh93 -c 'float x; (( x=copysign(5, -0) )) ; printf "%f\n"
+# x'
+# -5.000000
+# -- snip --
+# Now if I swap operands a and b I get this result:
+# -- snip --
+# $ ksh93 -c 'float x; (( x=copysign(0, -5) )) ; printf "%f\n" x'
+# 0.000000
+# -- snip --
+# AFAIK this result should be "-0.000000" ... or not ?
+# BTW: Parsing of "-0" doesn't seem to work either, e.g.
+# -- snip --
+# $ ksh93 -c 'float x a=-1 b=-0; (( x=copysign(a, b) )) ; printf "%f\n"
+# x'
+# 1.000000
+# -- snip --
+# ... while AFAIK it should be "-1.000000" since the 2nd operand of
+# "copysign" defines the sign of the result.
+# ------ snip ------
+# ------------ snip ------------
+#
+
+# test setup
+function err_exit
+{
+       print -u2 -n "\t"
+       print -u2 -r ${Command}[$1]: "${@:2}"
+       (( Errors++ ))
+}
+alias err_exit='err_exit $LINENO'
+
+set -o nounset
+Command=${0##*/}
+integer Errors=0
+
+typeset str
+
+# test 1: test "copysign()" using constant values
+str=$(
+       set -o errexit
+
+       print -- $(( copysign(0, -5) ))
+       ) || err_exit "test failed."
+[[ "${str}" == "-0" ]] || err_exit "Expected copysign(0, -5) == -0, got ${str}"
+
+
+# test 2: Same as test 1 but using variables for the values
+str=$(
+       set -o errexit
+
+       float a
+       float b
+       float c
+       
+       a=0.
+       b=-5.
+       
+       (( c=copysign(a, b) ))
+
+       print -- "$c"
+       ) || err_exit "test failed."
+[[ "${str}" == "-0" ]] || err_exit "Expected c == -0, got ${str}"
+
+
+# test 3: test "signbit()"
+str=$(
+       set -o errexit
+       
+       float a
+       
+       a=-0.
+       
+       print -- $(( signbit(a) ))
+       ) || err_exit "test failed."
+[[ "${str}" == "1" ]] || err_exit "Expected signbit(a, b) == 1, got ${str}"
+
+
+# test 4: test "signbit()"
+str=$(
+       set -o errexit
+       
+       float a
+       float c
+       
+       a=-0.
+       
+       (( c=signbit(a) ))
+
+       print -- "$c"
+       ) || err_exit "test failed."
+[[ "${str}" == "1" ]] || err_exit "Expected c == 1, got ${str}"
+
+
+# test 5: test whether "typeset -X" (C99 "hexfloat") correctly recognizes
+# negative zero assigned from a "float"
+str=$(
+       set -o errexit
+       
+       float a      # float
+       typeset -X c # hexfloat
+       
+       a=-0.
+       
+       # copy value from "float" to "hexfloat"
+       (( c=a ))
+       
+       print -- "$c"
+       ) || err_exit "test failed."
+[[ "${str}" == -0x* ]] || err_exit "Expected c == -0x*, got ${str}"
+
+
+# test 6: Reverse of test 5: Test whether "float" correctly recognizes
+# a C99 "hexfloat" value
+str=$(
+       set -o errexit
+       
+       typeset -X a # hexfloat
+       float c      # float
+       
+       a=-0x0.0000000000000000000000000000p+00
+       
+       # copy value from "hexfloat" to "float"
+       (( c=a ))
+       
+       print -- "$c"
+       ) || err_exit "test failed."
+[[ "${str}" == "-0" ]] || err_exit "Expected c == -0, got ${str}"
+
+
+# tests done
+exit $((Errors))
--- /dev/null   Fri Sep 25 06:39:58 2009
+++ 
new/usr/src/lib/libshell/common/tests/sun_solaris_cr_6835835_builtin_cat_n_broken.sh
        Fri Sep 25 06:39:56 2009
@@ -0,0 +1,139 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# This test checks whether ksh93's builtin "cat" command properly
+# supports the "-n" option.
+#
+# This was reported as CR #6835835 ('ksh93 "cat" builtin does not handle "-n" 
correctly'):
+# ------------ snip ------------
+# [Originally reported in
+# 
http://mail.opensolaris.org/pipermail/ksh93-integration-discuss/2009-February/007050.html
+# by Casper Dik]
+# -- snip --
+# I just noticed this in ksh93:
+#  ksh93 -c 'yes "" | head -5|cat -n'
+#     1
+#     2
+#     3
+#     4
+# (I used this for older shells when I want to a list of all integers from 1
+# to a particular number)
+# -- snip --
+# Frequency
+#   Always
+# Regression
+#   No
+# Steps to Reproduce
+#   Execute $ ksh93 -c 'yes "" | head -5|cat -n' #
+# Expected Result
+#     1
+#     2
+#     3
+#     4
+#     5
+# Actual Result
+#
+#
+#     1
+#     2
+#
+#     3
+#
+#     4
+# Error Message(s)
+#   None.
+# Test Case
+#   See description.
+# Workaround
+#   Disable ksh93's builtin "cat" command either via using an absolute path
+#   to the "cat" command (POSIX-style workaround) or using ksh93's
+#   "builtin" command to remove "cat" from the list of builtin
+#   commands (e.g. $ builtin -d /bin/cat /usr/bin/cat #).
+# ------------ snip ------------
+#
+
+# test setup
+function err_exit
+{
+       print -u2 -n "\t"
+       print -u2 -r ${Command}[$1]: "${@:2}"
+       (( Errors++ ))
+}
+alias err_exit='err_exit $LINENO'
+
+set -o nounset
+Command=${0##*/}
+integer Errors=0
+
+#
+# test 1: Compare output of various "cat -n" combinations
+#
+integer i
+typeset expected_output
+typeset out
+
+expected_output=$( ${SHELL} -c 'for ((i=1 ; i <= 12 ; i++ )) ; do printf 
"%6d\t\n" i ; done' )
+
+compound -a testcases=(
+       # note: we have to add an extra /usr/bin/cat at the end of the pipe to 
make
+       # sure the "cat" builtin uses the correct buffering mode to trigger
+       # the error and a "true" to make sure the "cat" command isn't the last 
command
+       # of the shell
+       ( name="test1a" cmd='integer i ; builtin cat ; for ((i=1 ; i <= 12 ; 
i++ )) ; do print ; done | cat -n          | /usr/bin/cat ; true' )
+       # same as "test1a" but uses external "cat" command
+       ( name="test1b" cmd='integer i ;               for ((i=1 ; i <= 12 ; 
i++ )) ; do print ; done | /usr/bin/cat -n | /usr/bin/cat ; true' )
+
+       # same as "test1a" but without the last /usr/bin/cat in the pipe
+       ( name="test1c" cmd='integer i ; builtin cat ; for ((i=1 ; i <= 12 ; 
i++ )) ; do print ; done | cat -n ; true' )
+       # same as "test1b" but without the last /usr/bin/cat in the pipe
+       ( name="test1d" cmd='integer i ;               for ((i=1 ; i <= 12 ; 
i++ )) ; do print ; done | /usr/bin/cat -n ; true' )
+)
+
+for testid in "${!testcas...@]}" ; do
+       nameref tc=testcases[${testid}]
+
+       out="$( ${SHELL} -o errexit -c "${tc.cmd}" )" || err_exit "${tc.name}: 
Shell failed"
+       [[ "${expected_output}" == "${out}" ]] || err_exit "${tc.name}: Builtin 
output does not match expected output"
+
+       out="$( ${SHELL} +o errexit -c "${tc.cmd}" )" || err_exit "${tc.name}: 
Shell failed"
+       [[ "${expected_output}" == "${out}" ]] || err_exit "${tc.name}: Builtin 
output does not match expected output"
+done
+
+
+#
+# test 2: Casper Dik's original testcase
+# from 
http://mail.opensolaris.org/pipermail/ksh93-integration-discuss/2009-February/007050.html
+#
+
+cmp -s \
+       <( ${SHELL} -c 'yes "" | head -5 | cat -n' ) \
+       <( for ((i=1 ; i <= 5 ; i++ )) ; do printf "%6d\t\n" i ; done ) \
+       || err_exit 'yes "" | head -5 | cat -n does not match expected output.'
+
+
+# tests done
+exit $((Errors))
--- /dev/null   Fri Sep 25 06:40:01 2009
+++ 
new/usr/src/lib/libshell/common/tests/sun_solaris_cr_6848486_echo_test_with_test_undefined_executes_test_builtin.sh
 Fri Sep 25 06:39:59 2009
@@ -0,0 +1,94 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# This test checks whether ksh93 does not execute builtin command
+# "foo" when referencing variable "foo" when the variable is not
+# set (this applies to all builtin commands not bound to a
+# specific PATH element, e.g. "test", "sleep", "print" etc.).
+#
+# This was reported as CR #6848486 ('"echo ${test}" with test
+# undefined crashes the shell')
+# ------------ snip ------------
+# This is an odd one:
+#
+# $ ksh93 --version
+#   version         sh (AT&T Research) 93t 2008-11-04
+# $ ksh93
+# jl138328 at gir:~$ echo $test
+#
+# jl138328 at gir:~$ echo ${test}                                              
      
+# Segmentation Fault (core dumped)
+# ------------ snip ------------
+#
+# The bug originates from the ksh93 "type system" which allows
+# an application to define it's own types in ksh93. In such cases
+# the output of function "mytype.len" is used when type "mytype"
+# has no member variable "len" (note it requires the use of
+# ${foo} since the use of $foo does not allow "foo" to contain
+# a dot in the variable name).
+# The implementation in ast-ksh.2009-11-04 however does this
+# for _all_ types of variables and not only for those which
+# are a member of an application-defined type, therefore
+# causing this bug.
+#
+
+# test setup
+function err_exit
+{
+       print -u2 -n "\t"
+       print -u2 -r ${Command}[$1]: "${@:2}"
+       (( Errors++ ))
+}
+alias err_exit='err_exit $LINENO'
+
+set -o nounset
+Command=${0##*/}
+integer Errors=0
+
+
+# Test 1: Test whether the shell crashes when looking for an empty
+# "shell" variable.
+# (note: return code 78 was just picked randomly)
+$SHELL -c 'unset test ; print ${test} ; exit 78' >/dev/null 2>&1
+(( $? == 78 )) || err_exit "expected return code is 78, got $?"
+
+
+# Test 2: Test whether the shell can reach a point (which prints
+# "#mark") after the use of ${test} in the script.
+out=$($SHELL -o errexit -c 'unset test ; print ${test} ; print "#mark"' 2>&1 ) 
|| err_exit "Shell returned error code $?, expected 0."
+[[ "$out" == $'\n#mark' ]] || err_exit "Expected output \$'\n#mark', got 
'${out}'"
+
+
+# Test 3: Check whether the use of ${sleep} returns nothing
+# (ast-ksh.2008-11-04 will return the usage string of the sleep
+# builtin)
+out=$($SHELL -o errexit -c 'print ${sleep} ; print "#mark"' 2>&1 ) || err_exit 
"Shell returned error code $?, expected 0."
+[[ "$out" == $'\n#mark' ]] || err_exit "Expected output \$'\n#mark', got 
'${out}'"
+
+
+# tests done
+exit $((Errors))
--- /dev/null   Fri Sep 25 06:40:04 2009
+++ 
new/usr/src/lib/libshell/common/tests/sun_solaris_cr_6855875_typeset_hexfloat_has_too_few_digits.sh
 Fri Sep 25 06:40:02 2009
@@ -0,0 +1,145 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# This test checks whether arithmetric math correctly
+# converts a IEEE 754-2008 floating-point value to the C99 hexfloat format
+# and back _without_ using digits.
+#
+# This was reported as CR #6855875 ("typeset -X x ; print $x # does not
+# print sufficient digits to restore value"):
+# ------------ snip ------------
+# $ typeset -X varname # was added to ksh93 to get a reliable way
+# (using the C99 "hexfloat" format (see printf(3c)'s "%a" format)) to
+# serialise a IEEE754-2008 floating-point value to a string and later feed
+# it back into a application _without_ loosing any precision (normal
+# base10 floating-point values (e.g. used by $ typeset -E/-F-G #) cause
+# rounding errors since IEEE754-2008 |long double| uses base2).
+# However $ typeset -l -X x ; ... ; print $x # currently does not print
+# sufficient number of digits to restore the full |long double| value as
+# expected, instead some digits are missing, resulting in an unwanted
+# rounding.
+# Example:
+# -- snip --
+# $ ksh93 -c 'typeset -l -X y y_ascii; (( y=sin(90) )) ; y_ascii=$y ; (( y
+# == y_ascii )) || print "no match,\n\t$(printf "%a\n" y)\n!=\n\t$(printf
+# "%a\n" y_ascii)"'
+# no match,
+#         0x1.c9b9ee41cb8665c7890a136ace6bp-01
+# !=
+#         0x1.c9b9ee41cc000000000000000000p-01
+# -- snip --
+# Frequency
+#    Always
+# Regression
+#    No
+# Steps to Reproduce
+#    [See description]
+# Expected Result
+#    [See description]
+# Actual Result
+#    [See description]
+# Error Message(s)
+#    -
+# Test Case
+#    typeset -l -X y y_ascii
+# (( y=sin(90) ))
+# y_ascii=$y # convert y to string and store it in "y_ascii"
+# if (( y == y_ascii )) ; then
+#     print "no match,\n\t$(printf "%a\n" y)\n!=\n\t$(printf "%a\n"
+# y_ascii)"
+# fi
+# Workaround
+#    1. Manually increase the number of digits via typeset
+# -X<numdigits>
+#     OR
+# 2. Use $ printf "%a" varname #
+# ------------ snip ------------
+#
+
+# test setup
+function err_exit
+{
+       print -u2 -n "\t"
+       print -u2 -r ${Command}[$1]: "${@:2}"
+       (( Errors++ ))
+}
+alias err_exit='err_exit $LINENO'
+
+set -o nounset
+Command=${0##*/}
+integer Errors=0
+
+
+# declare variables
+typeset                str
+integer                i
+float          x
+float -a       test_values
+
+typeset -l -X  y # hexfloat
+typeset -l -E  y_restored1
+typeset -l -F  y_restored2
+typeset -l -X  y_restored3
+
+
+# create array of test values
+for (( x=-181. ; x < 361. ; x+=.1 )) ; do
+       test_values+=( x )
+done
+test_values+=( 0 -0 +0 ) # (nan -nan inf -inf) are excluded since nan!=nan is 
always "true"
+
+
+# run the tests
+for (( i=0 ; i < ${#test_valu...@]} ; i++ )) ; do
+       (( y=sin(test_values[i]) ))
+
+       # convert floating-point value to string (using the hexfloat format) 
and store it in "str"
+       str="${y}"
+
+       # convert it back (via string assignment)
+       y_restored1="${str}"
+       y_restored2="${str}"
+       y_restored3="${str}"
+       (( y == y_restored1 )) || err_exit "no match,"$'\n\t'"$(printf "%a\n" 
y)"$'\n'"!="$'\n\t'"$(printf "%a\n" y_restored1)"
+       (( y == y_restored2 )) || err_exit "no match,"$'\n\t'"$(printf "%a\n" 
y)"$'\n'"!="$'\n\t'"$(printf "%a\n" y_restored2)"
+       (( y == y_restored3 )) || err_exit "no match,"$'\n\t'"$(printf "%a\n" 
y)"$'\n'"!="$'\n\t'"$(printf "%a\n" y_restored3)"
+
+       # convert it back (using arithmetric expression)
+       (( y_restored1=str ))
+       (( y_restored2=str ))
+       (( y_restored3=str ))
+       (( y == y_restored1 )) || err_exit "no match,"$'\n\t'"$(printf "%a\n" 
y)"$'\n'"!="$'\n\t'"$(printf "%a\n" y_restored1)"
+       (( y == y_restored2 )) || err_exit "no match,"$'\n\t'"$(printf "%a\n" 
y)"$'\n'"!="$'\n\t'"$(printf "%a\n" y_restored2)"
+       (( y == y_restored3 )) || err_exit "no match,"$'\n\t'"$(printf "%a\n" 
y)"$'\n'"!="$'\n\t'"$(printf "%a\n" y_restored3)"
+
+       # we exit if we get more than 8 errors (126 would be the maximum)
+       (( Errors > 8 )) && exit $((Errors))
+done
+
+
+# tests done
+exit $((Errors))
--- /dev/null   Fri Sep 25 06:40:06 2009
+++ 
new/usr/src/lib/libshell/common/tests/sun_solaris_cr_6862121_shbinexec_kernel_module_defunct.sh
     Fri Sep 25 06:40:05 2009
@@ -0,0 +1,111 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# This test checks whether the Solaris kernel can directly execute compiled
+# shell code.
+#
+# This was reported as CR #6862121 ("shbinexec kernel module defunct"):
+# ------------ snip ------------
+# [Originally reported by Sun Japan]
+# The new shbinexec kernel module added in B106 is defunct, originally
+# caused by my mismerge of the original development tree and later
+# because the matching test module didn't test it correctly (April
+# quickly discovered the problem but the issue drowned in the cleanup
+# putbacks ).
+# Frequency
+#    Always
+# Regression
+#    No
+# Steps to Reproduce
+#    $ cat test1.sh                                                            
                                       
+# print hello
+# printf "args=%s\n" "$@"
+# $ shcomp test1.sh test1
+# # note: this MUST be bash since ksh93 has special support for compiled shell
+# # scripts which causes the kernel module to be bypassed (that's why the tes
+# # never worked)
+# $ bash -c './test1 "a b" "c" "d"'
+# Expected Result
+#    hello                                                
+# args=a a1
+# args=b
+# args=c
+# Actual Result
+#    ./test1: line 1: a: not found
+# Error Message(s)
+#    ./test1: line 1: a: not found
+# Test Case
+#    See above.
+# ------------ snip ------------
+#
+
+# test setup
+function err_exit
+{
+       print -u2 -n "\t"
+       print -u2 -r ${Command}[$1]: "${@:2}"
+       (( Errors++ ))
+}
+alias err_exit='err_exit $LINENO'
+
+set -o nounset
+Command=${0##*/}
+integer Errors=0
+
+typeset ocwd
+typeset tmpdir
+typeset out
+
+# create temporary test directory
+ocwd="$PWD"
+tmpdir="$(mktemp -d 
"test_sun_solaris_cr_6862121_shbinexec_kernel_module_defunct.XXXXXXXX")" || 
err_exit "Cannot create temporary directory"
+
+cd "${tmpdir}" || err_exit "cd ${tmpdir} failed."
+
+
+# run tests
+{
+cat <<EOF
+       print hello
+       printf "args=%s\n" "\$@"
+EOF
+} >script1.sh
+
+# Compile script (note we use the platform's /usr/bin/shcomp, _not_ ${SHCOMP})
+/usr/bin/shcomp "script1.sh" "script1" || err_exit "shcomp failed with 
error=$?"
+
+[[ -x "./script1" ]] || err_exit "Script script1 not executable"
+out="$(/usr/bin/bash -c './script1 a b "c d"' 2>&1 )" || err_exit "Compiled 
script failed to execute, error=$?"
+[[ "${out}" == $'hello\nargs=a\nargs=b\nargs=c d' ]] || err_exit "Expected 
xxx, got $(printf "%q\n" "$out")"
+
+# cleanup
+rm "script1" "script1.sh"
+cd "${ocwd}"
+rmdir "${tmpdir}" || err_exit "Cannot remove temporary directory ${tmpdir}".
+
+# tests done
+exit $((Errors))
--- /dev/null   Fri Sep 25 06:40:09 2009
+++ 
new/usr/src/lib/libshell/common/tests/sun_solaris_cr_6881017_background_process_in_subshell_hangs_caller.sh
 Fri Sep 25 06:40:07 2009
@@ -0,0 +1,82 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# This test checks whether a background process called in a subshell can
+# cause it to wait for the child process instead of exiting.
+#
+# This was reported as CR #6881017 ("Subshell doesn't exit, holds pipe
+# open preventing callers from exiting"):
+# ------------ snip ------------
+# The following scenario hangs with snv_122, 100% reproducible:
+# 
+# Create a script hangit:
+# -----
+# #!/bin/ksh
+# ( sleep 100000 </dev/null >/dev/null 2>&1 & )
+# exit 0
+# -----
+# 
+# Run the following command:
+# hangit | tee -a /tmp/log
+# 
+# The hang can be eliminated either by removing the "exit 0" line (?!?), or by
+# redirecting the subshell output to /dev/null.
+# 
+# This is pretty nasty. I've whittled it down to this simple case but am seeing
+# it in a much more subtle and complex environment where there are several
+# intermediate calling scripts which have exited and eventually the parent 
pipes
+# the output and hangs on the open pipe. It was hard to track down.
+# ------------ snip ------------
+#
+
+# test setup
+function err_exit
+{
+       print -u2 -n "\t"
+       print -u2 -r ${Command}[$1]: "${@:2}"
+       (( Errors++ ))
+}
+alias err_exit='err_exit $LINENO'
+
+set -o nounset
+Command=${0##*/}
+integer Errors=0
+
+float tstart tstop tdiff
+
+# run test with 10 second timeout
+(( tstart=SECONDS ))
+$SHELL -c '( sleep 10 </dev/null >/dev/null 2>&1 & ) ; exit 0' | cat >/dev/null
+(( tstop=SECONDS ))
+
+# we remove two seconds below to make sure we don't run into issues
+# with smaller xntpd adjustments
+(( tdiff=tstop-tstart ))
+(( tdiff < (10.-2.) )) || err_exit "test run needed ${tdiff} seconds to 
complete (instead of < 8.)"
+
+# tests done
+exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/sun_solaris_getconf.sh        Fri Sep 
25 06:40:12 2009
+++ new/usr/src/lib/libshell/common/tests/sun_solaris_getconf.sh        Fri Sep 
25 06:40:10 2009
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -38,6 +38,7 @@
 }
 alias err_exit='err_exit $LINENO'
 
+set -o nounset
 Command=${0##*/}
 integer Errors=0
 
@@ -56,6 +57,15 @@
 # work in compiled shell scripts)
 typeset -r getconf_test_functions="$(
 cat <<EOF
+function err_exit
+{
+       print -u2 -n "\t"
+       print -u2 -r \${Command}[\$1]: "\${@:2}"
+       (( Errors++ ))
+}
+alias err_exit='err_exit \$LINENO'
+Command=\${0##*/}
+integer Errors=0
 # compare builtin getconf output with /usr/bin/getconf
 function compare_normal
 {
@@ -63,13 +73,13 @@
     /usr/bin/getconf -a | 
         while read i ; do
             (( getconf_keys++ ))
-            t="${i%:*}"
+            t="\${i%:*}"
 
-            a="$(getconf          "$t" 2>/dev/null)"
-            b="$(/usr/bin/getconf "$t" 2>/dev/null)"
+            a="\$(getconf          "\$t" 2>/dev/null)"
+            b="\$(/usr/bin/getconf "\$t" 2>/dev/null)"
 
-            if [[ "$a" != "$b" ]] ; then
-                print -u2 "getconf/normal built mismatch: |$t|:|$a| != |$b|"
+            if [[ "\$a" != "\$b" ]] ; then
+                print -u2 "getconf/normal built mismatch: |\$t|:|\$a| != |\$b|"
                 (( mismatch++ ))
             fi
         done
@@ -82,13 +92,13 @@
     /usr/bin/getconf -a | 
         while read i ; do
             (( getconf_keys++ ))
-            t="${i%:*}"
+            t="\${i%:*}"
 
-            a="$(getconf          "$t" "/tmp" 2>/dev/null)"
-            b="$(/usr/bin/getconf "$t" "/tmp" 2>/dev/null)"
+            a="\$(getconf          "\$t" "/tmp" 2>/dev/null)"
+            b="\$(/usr/bin/getconf "\$t" "/tmp" 2>/dev/null)"
 
-            if [[ "$a" != "$b" ]] ; then
-                print -u2 "getconf/path built mismatch: |$t|:|$a| != |$b|"
+            if [[ "\$a" != "\$b" ]] ; then
+                print -u2 "getconf/path built mismatch: |\$t|:|\$a| != |\$b|"
                 (( mismatch++ ))
             fi
         done
@@ -108,7 +118,7 @@
     export PATH="${i}"
 
     ## test whether the getconf builtin is available
-    if [[ "$(builtin | fgrep "/bin/getconf")" = "" ]] ; then
+    if [[ "$(builtin | fgrep "/bin/getconf")" == "" ]] ; then
         err_exit '/bin/getconf not found in the list of builtins.'
     fi
 
@@ -161,5 +171,6 @@
     (( Errors+=$? ))
 done
 
+
 # tests done
 exit $((Errors))
--- 
old/usr/src/lib/libshell/common/tests/sun_solaris_local_compound_nameref001.sh  
    Fri Sep 25 06:40:15 2009
+++ 
new/usr/src/lib/libshell/common/tests/sun_solaris_local_compound_nameref001.sh  
    Fri Sep 25 06:40:13 2009
@@ -28,17 +28,20 @@
 # name reference test #001
 #
 
+# test setup
 function err_exit
 {
        print -u2 -n "\t"
        print -u2 -r ${Command}[$1]: "${@:2}"
-       (( Errors+=1 ))
+       (( Errors++ ))
 }
-
 alias err_exit='err_exit $LINENO'
 
+set -o nounset
+Command=${0##*/}
 integer Errors=0
 
+
 function function2
 {
        nameref v=$1
@@ -60,5 +63,6 @@
 
 [[ "$x" != 'x=19, y=20' ]] && err_exit "expected 'x=19, y=20', got '${x}'"
 
+
 # tests done
 exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/sun_solaris_staticvariables.sh        
Fri Sep 25 06:40:18 2009
+++ new/usr/src/lib/libshell/common/tests/sun_solaris_staticvariables.sh        
Fri Sep 25 06:40:16 2009
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -45,8 +45,11 @@
 alias testfunc='testfunc $LINENO'
 alias err_exit='err_exit2 $LINENO'
 
+set -o nounset
+Command=${0##*/}
 integer Errors=0
 
+
 # string
 testfunc '(function l { typeset -S x ;     x+="#" ; $1 && print "$x" ; } ; l 
false ; l false   ; l true)'  "###"
 testfunc 'function  l { typeset -S x=">" ; x+="#" ; $1 && print "$x" ; } ; l 
false ; l false   ; l true'   ">###"
--- old/usr/src/lib/libshell/common/tests/sun_solaris_vartree001.sh     Fri Sep 
25 06:40:21 2009
+++ new/usr/src/lib/libshell/common/tests/sun_solaris_vartree001.sh     Fri Sep 
25 06:40:19 2009
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -50,15 +50,17 @@
 #   [14] main(argc = 2, argv = 0xffffffff7ffffa08), line 46 in "pmain.c"
 # 
 
+# test setup
 function err_exit
 {
        print -u2 -n "\t"
        print -u2 -r ${Command}[$1]: "${@:2}"
-       (( Errors+=1 ))
+       (( Errors++ ))
 }
-
 alias err_exit='err_exit $LINENO'
 
+# the test cannot use "nounset"
+Command=${0##*/}
 integer Errors=0
 
 
--- old/usr/src/lib/libshell/common/tests/sun_solaris_vartree002.sh     Fri Sep 
25 06:40:24 2009
+++ new/usr/src/lib/libshell/common/tests/sun_solaris_vartree002.sh     Fri Sep 
25 06:40:22 2009
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -31,15 +31,17 @@
 # and "unset" handling.
 #
 
+# test setup
 function err_exit
 {
        print -u2 -n "\t"
        print -u2 -r ${Command}[$1]: "${@:2}"
-       (( Errors+=1 ))
+       (( Errors++ ))
 }
-
 alias err_exit='err_exit $LINENO'
 
+# the test cannot use "nounset"
+Command=${0##*/}
 integer Errors=0
 
 # "built_tree1" and "built_tree2" are identical except the way how they test
@@ -46,7 +48,7 @@
 # whether a variable exists: 
 # - "built_tree1" uses "${varname}" != "", e.g. looking whether the variable
 #    as non-zero length content
-# - "built_tree2" uses "! (unset varname)", e.g. "unset" in a subshell
+# - "built_tree2" uses "! ([[ -v varname ]] ; res=$? ; unset varname ; exit 
$res)", e.g. "unset" in a subshell.
 function build_tree1
 {
 #set -o errexit -o xtrace
@@ -113,7 +115,7 @@
 # whether a variable exists: 
 # - "built_tree1" uses "${varname}" != "", e.g. looking whether the variable
 #    as non-zero length content
-# - "built_tree2" uses "! (unset varname)", e.g. "unset" in a subshell
+# - "built_tree2" uses "! ([[ -v varname ]] ; res=$? ; unset varname ; exit 
$res)", e.g. "unset" in a subshell.
 function build_tree2
 {
 #set -o errexit -o xtrace
@@ -144,12 +146,12 @@
                        [[ "$c" == "" ]] && c='-'
                                                
                        #if [[ "${dest_tree.l1["$a"]}" == "" ]] ; then
-                       if ! (unset dest_tree.l1["$a"]) ; then
+                       if ! ([[ -v dest_tree.l1["$a"] ]] ; res=$? ; unset 
dest_tree.l1["$a"] ; exit $res) ; then
                                typeset -A dest_tree.l1["$a"].l2
                        fi
 
                        #if [[ "${dest_tree.l1["$a"].l2["$b"]}" == "" ]] ; then
-                       if ! (unset dest_tree.l1["$a"].l2["$b"]) ; then
+                       if ! ([[ -v dest_tree.l1["$a"].l2["$b"] ]] ; res=$? ; 
unset dest_tree.l1["$a"].l2["$b"] ; exit $res) ; then
                                typeset -A dest_tree.l1["$a"].l2["$b"].l3
                        fi
 
@@ -301,9 +303,9 @@
 
 
        #### test "unset" in a subshell
-       (  unset 'mytree_global1.l1[urw].l2[itc zapfdingbats]'  ) || \
+       (  [[ -v 'mytree_global1.l1[urw].l2[itc zapfdingbats]' ]] ; res=$? ; 
unset 'mytree_global1.l1[urw].l2[itc zapfdingbats]' ; exit $res ) || \
                err_exit "Try 1: Variable 'mytree_global1.l1[urw].l2[itc 
zapfdingbats]' not found." 
-       (  unset 'mytree_global1.l1[urw].l2[itc zapfdingbats]'  ) || \
+       (  [[ -v 'mytree_global1.l1[urw].l2[itc zapfdingbats]' ]] ; res=$? ; 
unset 'mytree_global1.l1[urw].l2[itc zapfdingbats]' ; exit $res ) || \
                err_exit "Try 2: Variable 'mytree_global1.l1[urw].l2[itc 
zapfdingbats]' not found." 
 
        # remove parent node (array element) and then check whether the child 
is gone, too:
@@ -310,12 +312,12 @@
        (
                set -o errexit
                unset 'mytree_global1.l1[urw].l2[itc zapfdingbats]'
-               ! unset 'mytree_global1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]'
+               ! [[ -v 'mytree_global1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' ]]
        ) || err_exit "Global: Parent node removed (array element), child still 
exists" 
        (
                set -o errexit
                unset 'mytree_local1.l1[urw].l2[itc zapfdingbats]'
-               ! unset 'mytree_local1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]'
+               ! [[ -v 'mytree_local1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' ]]
        ) || err_exit "Local: Parent node removed (array element), child still 
exists" 
        
        # remove parent node  (array variable) and then check whether the child 
is gone, too:
@@ -322,22 +324,26 @@
        (
                set -o errexit
                unset 'mytree_local1.l1[urw].l2'
-               ! unset 'mytree_local1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]'
+               ! [[ -v 'mytree_local1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' ]]
        ) || err_exit "Global: Parent node removed (array variable), child 
still exists" 
        (
                set -o errexit
                unset 'mytree_local1.l1[urw].l2'
-               ! unset 'mytree_local1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]'
+               ! [[ -v 'mytree_local1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' ]]
        ) || err_exit "Local: Parent node removed (array variable), child still 
exists" 
 
 
        #### test "unset" and compare trees
-       unset 'mytree_global1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' ||
+       [[ -v 'mytree_global1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' ]] ; res=$?
+       unset 'mytree_global1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]'
+       (( res == 0 ))  ||
                err_exit "Variable 'mytree_global1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' not found." 
        
        [[ "${mytree_global1}" != "${mytree_local1}" ]] || err_exit 
"mytree_global1 and mytree_local1 should differ"
 
-       unset 'mytree_local1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' ||
+       [[ -v 'mytree_local1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' ]] ; res=$?
+       unset 'mytree_local1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]'
+       (( res == 0 ))  ||
                err_exit "Variable 'mytree_local1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' not found." 
        
        # Compare trees (after "unset")
--- old/usr/src/lib/libshell/common/tests/sun_solaris_vartree003.sh     Fri Sep 
25 06:40:27 2009
+++ new/usr/src/lib/libshell/common/tests/sun_solaris_vartree003.sh     Fri Sep 
25 06:40:25 2009
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -31,15 +31,17 @@
 # and "unset" handling.
 #
 
+# test setup
 function err_exit
 {
        print -u2 -n "\t"
        print -u2 -r ${Command}[$1]: "${@:2}"
-       (( Errors+=1 ))
+       (( Errors++ ))
 }
-
 alias err_exit='err_exit $LINENO'
 
+# the test cannot use "nounset"
+Command=${0##*/}
 integer Errors=0
 
 function example_tree
--- old/usr/src/lib/libshell/common/tests/tilde.sh      Fri Sep 25 06:40:30 2009
+++ new/usr/src/lib/libshell/common/tests/tilde.sh      Fri Sep 25 06:40:28 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -25,6 +25,12 @@
 }
 alias err_exit='err_exit $LINENO'
 
+Command=${0##*/}
+integer Errors=0
+
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
 function home # id
 {
        typeset IFS=: pwd=/etc/passwd
@@ -36,8 +42,6 @@
        fi
 }
 
-Command=${0##*/}
-integer Errors=0
 OLDPWD=/bin
 if     [[ ~ != $HOME ]]
 then   err_exit '~' not $HOME
@@ -69,24 +73,23 @@
        if      [[ $h != . ]]
        then    [[ ~$u -ef $h ]] || err_exit "~$u not $h"
                x=~$u
-               [[ $x -ef $h ]] || "x=~$u not $h"
+               [[ $x -ef $h ]] || x="~$u not $h"
                break
        fi
 done
-x=~%%
-if     [[ $x != '~%%' ]]
-then   err_exit 'x='~%%' not '~%%
+x=~g.r.emlin
+if     [[ $x != '~g.r.emlin' ]]
+then   err_exit "x=~g.r.emlin failed -- expected '~g.r.emlin', got '$x'"
 fi
 x=~:~
 if     [[ $x != "$HOME:$HOME" ]]
-then   err_exit x=~:~ not $HOME:$HOME
+then   err_exit "x=~:~ failed, expected '$HOME:$HOME', got '$x'"
 fi
 HOME=/
 [[ ~ == / ]] || err_exit '~ should be /'
-trap 'rm -rf /tmp/kshtilde$$' EXIT
 [[ ~/foo == /foo ]] || err_exit '~/foo should be /foo when ~==/'
-print $'print ~+\n[[ $1 ]] && $0' > /tmp/kshtilde$$
-chmod +x /tmp/kshtilde$$
+print $'print ~+\n[[ $1 ]] && $0' > $tmp/tilde
+chmod +x $tmp/tilde
 nl=$'\n'
-[[ $(/tmp/kshtilde$$ foo) == "$PWD$nl$PWD" ]] 2> /dev/null  || err_exit 'tilde 
fails inside a script run by name'
+[[ $($tmp/tilde foo) == "$PWD$nl$PWD" ]] 2> /dev/null  || err_exit 'tilde 
fails inside a script run by name'
 exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/timetype.sh   Fri Sep 25 06:40:33 2009
+++ new/usr/src/lib/libshell/common/tests/timetype.sh   Fri Sep 25 06:40:31 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
--- /dev/null   Fri Sep 25 06:40:36 2009
+++ new/usr/src/lib/libshell/common/tests/treemove.sh   Fri Sep 25 06:40:34 2009
@@ -0,0 +1,85 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# This test checks whether "typeset -m" correctly moves local variables
+# into a global variable tree.
+#
+# This was reported as CR #XXXXXXXX ("XXXX"):
+# -- snip --
+#XXXX
+# -- snip --
+#
+
+function err_exit
+{
+       print -u2 -n "\t"
+       print -u2 -r ${Command}[$1]: "${@:2}"
+       (( Errors+=1 ))
+}
+
+alias err_exit='err_exit $LINENO'
+
+integer Errors=0
+
+## test start
+typeset -C tree1 tree2
+
+# add node to tree which uses "typeset -m" to move a local variable
+# into tree1.subtree["a_node"]
+function f1
+{
+       nameref tr=$1
+       typeset -A tr.subtree
+       typeset -C node
+       node.one="hello"
+       node.two="world"
+       # move local note into the array
+false
+       typeset -m tr.subtree["a_node"]=node
+       return 0
+}
+
+# Alternative version which uses "nameref" instead of "typeset -m"
+function f2
+{
+       nameref tr=$1
+       typeset -A tr.subtree
+       nameref node=tr.subtree["a_node"]
+       node.one="hello"
+       node.two="world"
+       return 0
+}
+
+f1 tree1
+f2 tree2
+
+[[ "${tree1.subtree["a_node"].one}" == "hello" ]] || err_exit "expected 
tree1.subtree[\"a_node\"].one == 'hello', got ${tree1.subtree["a_node"].one}"
+[[ "${tree1.subtree["a_node"].two}" == "world" ]] || err_exit "expected 
tree1.subtree[\"a_node\"].two == 'world', got ${tree1.subtree["a_node"].two}"
+[[ "${tree1}" == "${tree2}" ]] || err_exit "tree1 and tree2 differ:$'\n'"
+
+# tests done
+exit $((Errors))
--- old/usr/src/lib/libshell/common/tests/types.sh      Fri Sep 25 06:40:39 2009
+++ new/usr/src/lib/libshell/common/tests/types.sh      Fri Sep 25 06:40:37 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -27,6 +27,10 @@
 
 Command=${0##*/}
 integer Errors=0
+
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
 integer n=2
 
 typeset -T Type_t=(
@@ -109,14 +113,13 @@
 typeset -m x[1]=x[2]
 [[ ${x[1]} == c ]] || err_exit 'move an indexed array element fails'
 [[ ${x[2]} ]] && err_exit 'x[2] should be unset after move'
-trap 'rm -f /tmp/kshtype$$' EXIT
-cat > /tmp/kshtype$$ <<- \+++
+cat > $tmp/types <<- \+++
        typeset -T Pt_t=(float x=1. y=0.)
        Pt_t p=(y=2)
        print -r -- ${p.y}
 +++
 expected=2
-got=$(. /tmp/kshtype$$) 2>/dev/null
+got=$(. $tmp/types) 2>/dev/null
 [[ "$got" == "$expected" ]] || err_exit "typedefs in dot script failed -- 
expected '$expected', got '$got'"
 typeset -T X_t=(
        typeset x=foo y=bar
@@ -263,6 +266,114 @@
                function f { f1 _ ;}
        )
        A_t a
-       [[ ${ a.f ./t1;} == "$a" ]] 
+       [[ ${ a.f ./t1;} == "$a" ]]
 +++++
+expected='A_t b.a=(name=one;)'
+[[ $( $SHELL << \+++
+       typeset -T A_t=(
+            typeset name=aha
+       )
+       typeset -T B_t=(
+               typeset     arr
+               A_t         a
+               f()
+               {
+                       _.a=(name=one)
+                       typeset -p _.a
+               }
+       )
+       B_t b
+       b.f
++++
+) ==  "$expected" ]] 2> /dev/null || err_exit  '_.a=(name=one) not expanding 
correctly'
+expected='A_t x=(name=xxx;)'
+[[ $( $SHELL << \+++
+       typeset -T A_t=(
+               typeset name
+       )
+       A_t x=(name="xxx")
+       typeset -p x
++++
+) ==  "$expected" ]] || err_exit  'empty field in definition does not expand 
correctly'
+
+typeset -T Foo_t=(
+       integer x=3
+       integer y=4
+       len() { print -r -- $(( sqrt(_.x**2 + _.y**2))) ;}
+)
+Foo_t foo
+[[ ${foo.len} == 5 ]] || err_exit "discipline function len not working"
+
+typeset -T benchmark_t=(
+       integer num_iterations
+)
+function do_benchmarks
+{
+       nameref tst=b
+       integer num_iterations
+       (( num_iterations= int(tst.num_iterations * 1.0) ))
+       printf "%d\n" num_iterations
+}
+benchmark_t b=(num_iterations=5)
+[[  $(do_benchmarks) == 5 ]] || err_exit 'scoping of nameref of type variables 
in arithmetic expressions not working'
+
+function cat_content
+{
+       cat <<- EOF
+       (
+               foo_t -a foolist=(
+                       ( val=3 )
+                       ( val=4 )
+                       ( val=5 )
+               )
+       )
+       EOF
+       return 0
+}
+typeset -T foo_t=(
+       integer val=-1
+       function print
+       {
+               print -- ${_.val}
+       }
+)
+function do_something
+{
+       nameref li=$1 # "li" may be an index or associative array
+       li[2].print
+}
+cat_content | read -C x
+[[ $(do_something x.foolist) == 5  ]] || err_exit 'subscripts not honored for 
arrays of type with disciplines'
+
+typeset -T benchcmd_t=(
+       float x=1
+       float y=2
+)
+unset x
+compound x=(
+       float o
+       benchcmd_t -a m
+       integer h
+)
+expected=$'(\n\ttypeset -l -i h=0\n\tbenchcmd_t -a m\n\ttypeset -l -E o=0\n)'
+[[ $x == "$expected" ]] || err_exit 'compound variable with array of types 
with no elements not working'
+
+expected=$'Std_file_t db.file[/etc/profile]=(action=preserve;typeset -A 
sum=([8242e663d6f7bb4c5427a0e58e2925f3]=1);)'
+{
+  got=$($SHELL <<- \EOF 
+       MAGIC='stdinstall (at&t research) 2009-08-25'
+       typeset -T Std_file_t=(
+               typeset action
+               typeset -A sum
+       )
+       typeset -T Std_t=(
+               typeset magic=$MAGIC
+               Std_file_t -A file
+       )
+       Std_t db=(magic='stdinstall (at&t research) 2009-08-25';Std_file_t -A 
file=( [/./home/gsf/.env.sh]=(action=preserve;typeset -A 
sum=([9b67ab407d01a52b3e73e3945b9a3ee0]=1);)[/etc/profile]=(action=preserve;typeset
 -A 
sum=([8242e663d6f7bb4c5427a0e58e2925f3]=1);)[/home/gsf/.profile]=(action=preserve;typeset
 -A sum=([3ce23137335219672bf2865d003a098e]=1);));)
+       typeset -p db.file[/etc/profile]
+       EOF)
+} 2> /dev/null
+[[ $got == "$expected" ]] ||  err_exit 'types with arrays of types as members 
fails'
+
 exit $Errors
--- old/usr/src/lib/libshell/common/tests/variables.sh  Fri Sep 25 06:40:42 2009
+++ new/usr/src/lib/libshell/common/tests/variables.sh  Fri Sep 25 06:40:40 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -28,11 +28,14 @@
 Command=${0##*/}
 integer Errors=0
 
+tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
+trap "cd /; rm -rf $tmp" EXIT
+
 [[ ${.sh.version} == "$KSH_VERSION" ]] || err_exit '.sh.version != KSH_VERSION'
 unset ss
-[[ $...@ss} ]] && err_exit '$...@ss} should be empty string when ss is unset'  
-[[ ${!ss} == ss ]] ||  err_exit '${!ss} should be ss when ss is unset'  
-[[ ${#ss} == 0 ]] ||  err_exit '${#ss} should be 0 when ss is unset'  
+[[ $...@ss} ]] && err_exit '$...@ss} should be empty string when ss is unset'
+[[ ${!ss} == ss ]] ||  err_exit '${!ss} should be ss when ss is unset'
+[[ ${#ss} == 0 ]] ||  err_exit '${#ss} should be 0 when ss is unset'
 # RANDOM
 if     (( RANDOM==RANDOM || $RANDOM==$RANDOM ))
 then   err_exit RANDOM variable not working
@@ -57,17 +60,19 @@
 #fi
 # PWD
 if     [[ !  $PWD -ef . ]]
-then   err_exit PWD variable not working
+then   err_exit PWD variable failed, not equivalent to .
 fi
 # PPID
-if     [[ $($SHELL -c 'print $PPID')  != $$ ]]
-then   err_exit PPID variable not working
+exp=$$
+got=${ $SHELL -c 'print $PPID'; }
+if     [[ ${ $SHELL -c 'print $PPID'; } != $$ ]]
+then   err_exit "PPID variable failed -- expected '$exp', got '$got'"
 fi
 # OLDPWD
 old=$PWD
 cd /
 if     [[ $OLDPWD != $old ]]
-then   err_exit OLDPWD variable not working
+then   err_exit "OLDPWD variable failed -- expected '$old', got '$OLDPWD'"
 fi
 cd $old || err_exit cd failed
 # REPLY
@@ -90,7 +95,7 @@
 IFS=:
 x=a::b::c
 if     [[ $x != a::b::c ]]
-then   err_exit "Word splitting on constants"
+then   err_exit "word splitting on constants"
 fi
 set -- $x
 if     [[ $# != 5 ]]
@@ -171,7 +176,7 @@
 foo=junk
 function foo.get
 {
-       .sh.value=stuff 
+       .sh.value=stuff
        unset -f foo.get
 }
 if     [[ $foo != stuff ]]
@@ -209,22 +214,19 @@
 kill $!
 unset x
 CDPATH=/
-x=$(cd tmp)
-if     [[ $x != /tmp ]]
+x=$(cd ${tmp#/})
+if     [[ $x != $tmp ]]
 then   err_exit 'CDPATH does not display new directory'
 fi
-mkdir /tmp/ksh$$
 CDPATH=/:
-x=$(cd /tmp;cd ksh$$)
+x=$(cd ${tmp%/*}; cd ${tmp##*/})
 if     [[ $x ]]
 then   err_exit 'CDPATH displays new directory when not used'
 fi
-x=$(cd tmp/ksh$$)
-if     [[ $x != /tmp/ksh$$ ]]
-then   err_exit "CDPATH tmp/ksh$$ does not display new directory"
+x=$(cd ${tmp#/})
+if     [[ $x != $tmp ]]
+then   err_exit "CDPATH ${tmp#/} does not display new directory"
 fi
-cd /
-rm -rf /tmp/ksh$$
 TMOUT=100
 (TMOUT=20)
 if     (( TMOUT !=100 ))
@@ -411,15 +413,15 @@
 unset IFS
 
 if     [[ $( (print ${12345:?}) 2>&1) != *12345* ]]
-then   err_exit 'Incorrect error message with ${12345?}'
+then   err_exit 'incorrect error message with ${12345?}'
 fi
 unset foobar
 if     [[ $( (print ${foobar:?}) 2>&1) != *foobar* ]]
-then   err_exit 'Incorrect error message with ${foobar?}'
+then   err_exit 'incorrect error message with ${foobar?}'
 fi
 unset bar
 if     [[ $( (print ${bar:?bam}) 2>&1) != *bar*bam* ]]
-then   err_exit 'Incorrect error message with ${foobar?}'
+then   err_exit 'incorrect error message with ${foobar?}'
 fi
 { $SHELL -c '
 function foo
@@ -427,14 +429,13 @@
        typeset SECONDS=0
        sleep 1.5
        print $SECONDS
-       
+
 }
 x=$(foo)
-(( x >1 && x < 2 )) 
+(( x >1 && x < 2 ))
 '
 } 2> /dev/null   || err_exit 'SECONDS not working in function'
-trap 'rm -f /tmp/script$$ /tmp/out$$' EXIT
-cat > /tmp/script$$ <<-\!
+cat > $tmp/script <<-\!
        posixfun()
        {
                unset x
@@ -451,12 +452,12 @@
        else    print -r -- "${.sh.file}"
        fi
 !
-chmod +x /tmp/script$$
-. /tmp/script$$  1
-[[ $file == /tmp/script$$ ]] || err_exit ".sh.file not working for dot scripts"
-[[ $($SHELL /tmp/script$$) == /tmp/script$$ ]] || err_exit ".sh.file not 
working for scripts"
-[[ $(posixfun .sh.file) == /tmp/script$$ ]] || err_exit ".sh.file not working 
for posix functions"
-[[ $(fun .sh.file) == /tmp/script$$ ]] || err_exit ".sh.file not working for 
functions"
+chmod +x $tmp/script
+. $tmp/script  1
+[[ $file == $tmp/script ]] || err_exit ".sh.file not working for dot scripts"
+[[ $($SHELL $tmp/script) == $tmp/script ]] || err_exit ".sh.file not working 
for scripts"
+[[ $(posixfun .sh.file) == $tmp/script ]] || err_exit ".sh.file not working 
for posix functions"
+[[ $(fun .sh.file) == $tmp/script ]] || err_exit ".sh.file not working for 
functions"
 [[ $(posixfun .sh.fun) == posixfun ]] || err_exit ".sh.fun not working for 
posix functions"
 [[ $(fun .sh.fun) == fun ]] || err_exit ".sh.fun not working for functions"
 [[ $(posixfun .sh.subshell) == 1 ]] || err_exit ".sh.subshell not working for 
posix functions"
@@ -483,22 +484,22 @@
 unset dave
 [[ $(typeset +f) == *dave.* ]] && err_exit 'unset discipline not removed'
 
-print 'print ${VAR}' > /tmp/script$$
+print 'print ${VAR}' > $tmp/script
 unset VAR
-VAR=new /tmp/script$$ > /tmp/out$$
-got=$(</tmp/out$$)
+VAR=new $tmp/script > $tmp/out
+got=$(<$tmp/out)
 [[ $got == new ]] || err_exit "previously unset environment variable not 
passed to script, expected 'new', got '$got'"
 [[ ! $VAR ]] || err_exit "previously unset environment variable set after 
script, expected '', got '$VAR'"
 unset VAR
 VAR=old
-VAR=new /tmp/script$$ > /tmp/out$$
-got=$(</tmp/out$$)
+VAR=new $tmp/script > $tmp/out
+got=$(<$tmp/out)
 [[ $got == new ]] || err_exit "environment variable covering local variable 
not passed to script, expected 'new', got '$got'"
 [[ $VAR == old ]] || err_exit "previously set local variable changed after 
script, expected 'old', got '$VAR'"
 unset VAR
 export VAR=old
-VAR=new /tmp/script$$ > /tmp/out$$
-got=$(</tmp/out$$)
+VAR=new $tmp/script > $tmp/out
+got=$(<$tmp/out)
 [[ $got == new ]] || err_exit "environment variable covering environment 
variable not passed to script, expected 'new', got '$got'"
 [[ $VAR == old ]] || err_exit "previously set environment variable changed 
after script, expected 'old', got '$VAR'"
 
@@ -511,7 +512,7 @@
        }
        dave=foo; dave+=bar
        [[ $dave == barfoo ]] || exit 2
-) 2> /dev/null  
+) 2> /dev/null
 case $? in
 0)      ;;
 1)      err_exit 'append discipline not implemented';;
@@ -522,8 +523,8 @@
        function .sh.foobar.get
        {
                .sh.value=world
-       } 
-} 2> /dev/null || err_exit "Can't add get discipline to .sh.foobar"
+       }
+} 2> /dev/null || err_exit "cannot add get discipline to .sh.foobar"
 [[ ${.sh.foobar} == world ]]  || err_exit 'get discipline for .sh.foobar not 
working'
 x='a|b'
 IFS='|'
@@ -557,12 +558,12 @@
                ;;
        esac
 }
-foo[barrier_hit]=no 
+foo[barrier_hit]=no
 foo[bar]=1
 (( foo[bar] == 1 )) || err_exit 'foo[bar] should be 1'
 [[ ${foo[barrier_hit]} == no ]] || err_exit 'foo[barrier_hit] should be no'
 [[ ${foo[barrier_not_hit]} == yes ]] || err_exit 'foo[barrier_not_hit] should 
be yes'
-foo[barrier_hit]=no 
+foo[barrier_hit]=no
 foo[bar]=2
 (( foo[bar] == 5 )) || err_exit 'foo[bar] should be 5'
 [[ ${foo[barrier_hit]} == yes ]] || err_exit 'foo[barrier_hit] should be yes'
@@ -576,8 +577,10 @@
 }
 x[0]=0 x[1]=1 x[2]=2 x[3]=3
 [[ $...@]} == '12 8 5 3' ]] || err_exit 'set discipline for indexed array not 
working correctly'
+float seconds
 ((SECONDS=3*4))
-(( SECONDS < 12 || SECONDS > 12.1 )) &&  err_exit "SECONDS is $SECONDS and 
should be close to 12"
+seconds=SECONDS
+(( seconds < 12 || seconds > 12.1 )) &&  err_exit "SECONDS is $seconds and 
should be close to 12"
 unset a
 function a.set
 {
--- old/usr/src/lib/libshell/common/tests/vartree1.sh   Fri Sep 25 06:40:45 2009
+++ new/usr/src/lib/libshell/common/tests/vartree1.sh   Fri Sep 25 06:40:43 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -41,7 +41,7 @@
        typeset i
        typeset dummy
        typeset a b c d e f
-       
+
        nameref dest_tree="$1" # destination tree
        nameref srcdata="$2"   # source data
        typeset tree_mode="$3" # mode to define the type of leads
@@ -53,15 +53,15 @@
 
                for i in "${node.xl...@]}" ; do
                        IFS='-' read dummy a b c d e f <<<"$i"
-                       
+
                        if [[ "$a" == "" ]] ; then
                                a="$dummy"
                        fi
-                       
+
                        [[ "$a" == "" ]] && a='-'
                        [[ "$b" == "" ]] && b='-'
                        [[ "$c" == "" ]] && c='-'
-                                               
+
                        if [[ "${dest_tree.l1["$a"]}" == "" ]] ; then
                        #if ! (unset dest_tree.l1["$a"]) ; then
                                typeset -A dest_tree.l1["$a"].l2
@@ -75,7 +75,7 @@
                        if [[ 
"${!dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[*]}" == "" ]] ; then
                                typeset -A 
dest_tree.l1["$a"].l2["$b"].l3["$c"].entries
                        fi
-                                       
+
                        #dest_tree.l1["$a"].l2["$b"].l3["$c"].entries+=( 
"$index" )
                        typeset new_index
                        if [[ "${tree_mode}" == "leaf_name" ]] ; then
@@ -88,12 +88,12 @@
                                        continue
                                fi
                        fi
-                       
+
                        add_tree_leaf 
dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[${new_index}] "${index}" 
"${tree_mode}"
                done
        done
-       
-       return 0        
+
+       return 0
 }
 
 function add_tree_leaf
@@ -101,7 +101,7 @@
        nameref tree_leafnode="$1"
        nameref data_node=srcdata.hashnodes["$2"]
        typeset add_mode="$3"
-       
+
        case "${add_mode}" in
                "leaf_name")
                        tree_leafnode="${data_node.name}"
@@ -121,7 +121,7 @@
                        return 1
                        ;;
        esac
-       
+
        # not reached
        return 1
 }
@@ -151,7 +151,7 @@
 )
 
 mytree_global=()
-       
+
 function main
 {
        # "mysrcdata_local" and "mysrcdata_global" must be identical
@@ -182,7 +182,7 @@
        build_tree mytree_global mysrcdata_global leaf_compound || \
                err_exit 'build_tree mytree_global mysrcdata_global 
leaf_compound returned an error'
 
-       (( $(print -r -- "${mytree_global}" | wc -l) > 10 )) || err_exit 
"Compound tree 'mytree_global' too small."
+       (( $(print -r -- "${mytree_global}" | wc -l) > 10 )) || err_exit 
"compound tree 'mytree_global' too small"
 
        # build tree using local tree variables
        mytree_local=()
@@ -189,25 +189,25 @@
        build_tree mytree_local mysrcdata_local leaf_compound || \
                err_exit 'build_tree mytree_local mysrcdata_local leaf_compound 
returned an error'
 
-       (( $(print -r -- "${mytree_local}" | wc -l) > 10 )) || err_exit 
"Compound tree 'mytree_local' too small."
-       
+       (( $(print -r -- "${mytree_local}" | wc -l) > 10 )) || err_exit 
"compound tree 'mytree_local' too small"
+
        # Compare trees
        if [[ "${mytree_global}" != "${mytree_local}" ]] ; then
-               err_exit "Compound trees 'mytree_local' and 'mytree_global' not 
identical"
+               err_exit "compound trees 'mytree_local' and 'mytree_global' not 
identical"
        fi
-       
+
        unset 'mytree_global.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' ||
-               err_exit "Variable 'mytree_global.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' not found." 
-       
+               err_exit "variable 'mytree_global.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' not found"
+
        [[ "${mytree_global}" != "${mytree_local}" ]] || err_exit 
"mytree_global and mytree_local should differ"
 
        unset 'mytree_local.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' ||
-               err_exit "Variable 'mytree_local.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' not found." 
-       
+               err_exit "variable 'mytree_local.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' not found"
+
        # Compare trees (after "unset")
        if [[ "${mytree_global}" != "${mytree_local}" ]] ; then
-               err_exit "Compound trees 'mytree_local' and 'mytree_global' not 
identical after unset"
-       fi      
+               err_exit "compound trees 'mytree_local' and 'mytree_global' not 
identical after unset"
+       fi
 }
 
 main
--- old/usr/src/lib/libshell/common/tests/vartree2.sh   Fri Sep 25 06:40:48 2009
+++ new/usr/src/lib/libshell/common/tests/vartree2.sh   Fri Sep 25 06:40:46 2009
@@ -1,7 +1,7 @@
 ########################################################################
 #                                                                      #
 #               This software is part of the ast package               #
-#          Copyright (c) 1982-2008 AT&T Intellectual Property          #
+#          Copyright (c) 1982-2009 AT&T Intellectual Property          #
 #                      and is licensed under the                       #
 #                  Common Public License, Version 1.0                  #
 #                    by AT&T Intellectual Property                     #
@@ -34,7 +34,7 @@
 alias err_exit='err_exit $LINENO'
 
 # "built_tree1" and "built_tree2" are identical except the way how they test
-# whether a variable exists: 
+# whether a variable exists:
 # - "built_tree1" uses "${varname}" != "", e.g. looking whether the variable
 #    as non-zero length content
 # - "built_tree2" uses "! (unset varname)", e.g. "unset" in a subshell
@@ -46,7 +46,7 @@
        typeset i
        typeset dummy
        typeset a b c d e f
-       
+
        nameref dest_tree="$1" # destination tree
        nameref srcdata="$2"   # source data
        typeset tree_mode="$3" # mode to define the type of leads
@@ -58,15 +58,15 @@
 
                for i in "${node.xl...@]}" ; do
                        IFS='-' read dummy a b c d e f <<<"$i"
-                       
+
                        if [[ "$a" == "" ]] ; then
                                a="$dummy"
                        fi
-                       
+
                        [[ "$a" == "" ]] && a='-'
                        [[ "$b" == "" ]] && b='-'
                        [[ "$c" == "" ]] && c='-'
-                                               
+
                        if [[ "${dest_tree.l1["$a"]}" == "" ]] ; then
                        #if ! (unset dest_tree.l1["$a"]) ; then
                                typeset -A dest_tree.l1["$a"].l2
@@ -80,7 +80,7 @@
                        if [[ 
"${!dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[*]}" == "" ]] ; then
                                typeset -A 
dest_tree.l1["$a"].l2["$b"].l3["$c"].entries
                        fi
-                                       
+
                        typeset new_index
                        if [[ "${tree_mode}" == "leaf_name" ]] ; then
                                new_index=$(( 
${#dest_tree.l1["$a"].l2["$b"].l3["$c"].entri...@]}+1 ))
@@ -92,16 +92,16 @@
                                        continue
                                fi
                        fi
-                       
+
                        add_tree_leaf 
dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[${new_index}] "${index}" 
"${tree_mode}"
                done
        done
-       
-       return 0        
+
+       return 0
 }
 
 # "built_tree1" and "built_tree2" are identical except the way how they test
-# whether a variable exists: 
+# whether a variable exists:
 # - "built_tree1" uses "${varname}" != "", e.g. looking whether the variable
 #    as non-zero length content
 # - "built_tree2" uses "! (unset varname)", e.g. "unset" in a subshell
@@ -113,7 +113,7 @@
        typeset i
        typeset dummy
        typeset a b c d e f
-       
+
        nameref dest_tree="$1" # destination tree
        nameref srcdata="$2"   # source data
        typeset tree_mode="$3" # mode to define the type of leads
@@ -125,15 +125,15 @@
 
                for i in "${node.xl...@]}" ; do
                        IFS='-' read dummy a b c d e f <<<"$i"
-                       
+
                        if [[ "$a" == "" ]] ; then
                                a="$dummy"
                        fi
-                       
+
                        [[ "$a" == "" ]] && a='-'
                        [[ "$b" == "" ]] && b='-'
                        [[ "$c" == "" ]] && c='-'
-                                               
+
                        #if [[ "${dest_tree.l1["$a"]}" == "" ]] ; then
                        if ! (unset dest_tree.l1["$a"]) ; then
                                typeset -A dest_tree.l1["$a"].l2
@@ -147,7 +147,7 @@
                        if [[ 
"${!dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[*]}" == "" ]] ; then
                                typeset -A 
dest_tree.l1["$a"].l2["$b"].l3["$c"].entries
                        fi
-                                       
+
                        typeset new_index
                        if [[ "${tree_mode}" == "leaf_name" ]] ; then
                                new_index=$(( 
${#dest_tree.l1["$a"].l2["$b"].l3["$c"].entri...@]}+1 ))
@@ -159,12 +159,12 @@
                                        continue
                                fi
                        fi
-                       
+
                        add_tree_leaf 
dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[${new_index}] "${index}" 
"${tree_mode}"
                done
        done
-       
-       return 0        
+
+       return 0
 }
 
 
@@ -173,7 +173,7 @@
        nameref tree_leafnode="$1"
        nameref data_node=srcdata.hashnodes["$2"]
        typeset add_mode="$3"
-       
+
        case "${add_mode}" in
                "leaf_name")
                        tree_leafnode="${data_node.name}"
@@ -193,7 +193,7 @@
                        return 1
                        ;;
        esac
-       
+
        # not reached
        return 1
 }
@@ -224,7 +224,7 @@
 
 mytree_global1=()
 mytree_global2=()
-       
+
 function main
 {
        # "mysrcdata_local" and "mysrcdata_global" must be identical
@@ -254,11 +254,11 @@
        #### Build tree using global tree variables
        build_tree1 mytree_global1 mysrcdata_global leaf_compound || \
                err_exit 'build_tree1 mytree_global1 mysrcdata_global 
leaf_compound returned an error'
-       (( $(print -r -- "${mytree_global1}" | wc -l) > 10 )) || err_exit 
"Compound tree 'mytree_global1' too small."
+       (( $(print -r -- "${mytree_global1}" | wc -l) > 10 )) || err_exit 
"compound tree 'mytree_global1' too small"
 
        build_tree2 mytree_global2 mysrcdata_global leaf_compound || \
                err_exit 'build_tree2 mytree_global2 mysrcdata_global 
leaf_compound returned an error'
-       (( $(print -r -- "${mytree_global2}" | wc -l) > 10 )) || err_exit 
"Compound tree 'mytree_global2' too small."
+       (( $(print -r -- "${mytree_global2}" | wc -l) > 10 )) || err_exit 
"compound tree 'mytree_global2' too small"
 
 
        #### build tree using local tree variables
@@ -267,67 +267,67 @@
 
        build_tree1 mytree_local1 mysrcdata_local leaf_compound || \
                err_exit 'build_tree1 mytree_local1 mysrcdata_local 
leaf_compound returned an error'
-       (( $(print -r -- "${mytree_local1}" | wc -l) > 10 )) || err_exit 
"Compound tree 'mytree_local1' too small."
+       (( $(print -r -- "${mytree_local1}" | wc -l) > 10 )) || err_exit 
"compound tree 'mytree_local1' too small"
 
        build_tree2 mytree_local2 mysrcdata_local leaf_compound || \
                err_exit 'build_tree2 mytree_local2 mysrcdata_local 
leaf_compound returned an error'
-       (( $(print -r -- "${mytree_local2}" | wc -l) > 10 )) || err_exit 
"Compound tree 'mytree_local2' too small."
+       (( $(print -r -- "${mytree_local2}" | wc -l) > 10 )) || err_exit 
"compound tree 'mytree_local2' too small"
 
-       
+
        #### Compare treess
        if [[ "${mytree_global1}" != "${mytree_local1}" ]] ; then
-               err_exit "Compound trees 'mytree_global1' and 'mytree_local1' 
not identical"
+               err_exit "compound trees 'mytree_global1' and 'mytree_local1' 
not identical"
        fi
 
        if [[ "${mytree_global1}" != "${mytree_global2}" ]] ; then
-               err_exit "Compound trees 'mytree_global1' and 'mytree_global2' 
not identical"
+               err_exit "compound trees 'mytree_global1' and 'mytree_global2' 
not identical"
        fi
 
        if [[ "${mytree_local1}" != "${mytree_local2}" ]] ; then
-               err_exit "Compound trees 'mytree_local1' and 'mytree_local2' 
not identical"
+               err_exit "compound trees 'mytree_local1' and 'mytree_local2' 
not identical"
        fi
 
 
        #### test "unset" in a subshell
        (  unset 'mytree_global1.l1[urw].l2[itc zapfdingbats]'  ) || \
-               err_exit "Try 1: Variable 'mytree_global1.l1[urw].l2[itc 
zapfdingbats]' not found." 
+               err_exit "try 1: variable 'mytree_global1.l1[urw].l2[itc 
zapfdingbats]' not found"
        (  unset 'mytree_global1.l1[urw].l2[itc zapfdingbats]'  ) || \
-               err_exit "Try 2: Variable 'mytree_global1.l1[urw].l2[itc 
zapfdingbats]' not found." 
+               err_exit "try 2: variable 'mytree_global1.l1[urw].l2[itc 
zapfdingbats]' not found"
 
        # remove parent node (array element) and then check whether the child 
is gone, too:
        (
                unset 'mytree_global1.l1[urw].l2[itc zapfdingbats]'
-               unset 'mytree_global1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]'
-       ) && err_exit "Global: Parent node removed (array element), child still 
exists" 
+               [[ -v 'mytree_global1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]'} ]]
+       ) && err_exit "global: parent node removed (array element), child still 
exists"
        (
                unset 'mytree_local1.l1[urw].l2[itc zapfdingbats]'
-               unset 'mytree_local1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]'
-       ) && err_exit "Local: Parent node removed (array element), child still 
exists" 
-       
+               [[ -v 'mytree_local1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' ]]
+       ) && err_exit "local: parent node removed (array element), child still 
exists"
+
        # remove parent node  (array variable) and then check whether the child 
is gone, too:
        (
                unset 'mytree_local1.l1[urw].l2'
-               unset 'mytree_local1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]'
-       ) && err_exit "Global: Parent node removed (array variable), child 
still exists" 
+               [[ -v 'mytree_local1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' ]]
+       ) && err_exit "global: parent node removed (array variable), child 
still exists"
        (
                unset 'mytree_local1.l1[urw].l2'
-               unset 'mytree_local1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]'
-       ) && err_exit "Local: Parent node removed (array variable), child still 
exists" 
+               [[ -v 'mytree_local1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' ]]
+       ) && err_exit "local: parent node removed (array variable), child still 
exists"
 
 
        #### test "unset" and compare trees
        unset 'mytree_global1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' ||
-               err_exit "Variable 'mytree_global1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' not found." 
-       
+               err_exit "variable 'mytree_global1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' not found"
+
        [[ "${mytree_global1}" != "${mytree_local1}" ]] || err_exit 
"mytree_global1 and mytree_local1 should differ"
 
        unset 'mytree_local1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' ||
-               err_exit "Variable 'mytree_local1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' not found." 
-       
+               err_exit "variable 'mytree_local1.l1[urw].l2[itc 
zapfdingbats].l3[medium].entries[abcd].filenames[0]' not found"
+
        # Compare trees (after "unset")
        if [[ "${mytree_global1}" != "${mytree_local1}" ]] ; then
-               err_exit "Compound trees 'mytree_local1' and 'mytree_global1' 
not identical after unset"
-       fi      
+               err_exit "compound trees 'mytree_local1' and 'mytree_global1' 
not identical after unset"
+       fi
 }
 
 main
--- old/usr/src/lib/libshell/i386/include/ast/history.h Fri Sep 25 06:40:50 2009
+++ new/usr/src/lib/libshell/i386/include/ast/history.h Fri Sep 25 06:40:49 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/i386/include/ast/nval.h    Fri Sep 25 06:40:53 2009
+++ new/usr/src/lib/libshell/i386/include/ast/nval.h    Fri Sep 25 06:40:52 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -276,6 +276,7 @@
 extern __MANGLE__ Namval_t             *nv_lastdict __PROTO__((void));
 extern __MANGLE__ Namval_t             *nv_mkinttype __PROTO__((char*, size_t, 
int, const char*, Namdisc_t*));
 extern __MANGLE__ void                 nv_newattr 
__PROTO__((Namval_t*,unsigned,int));
+extern __MANGLE__ void                 nv_newtype __PROTO__((Namval_t*));
 extern __MANGLE__ Namval_t             *nv_open __PROTO__((const 
char*,Dt_t*,int));
 extern __MANGLE__ void                 nv_putval __PROTO__((Namval_t*,const 
char*,int));
 extern __MANGLE__ void                 nv_putv __PROTO__((Namval_t*,const 
char*,int,Namfun_t*));
--- old/usr/src/lib/libshell/i386/include/ast/shell.h   Fri Sep 25 06:40:56 2009
+++ new/usr/src/lib/libshell/i386/include/ast/shell.h   Fri Sep 25 06:40:55 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -146,8 +146,8 @@
        int             inlineno;       /* line number of current input file */
        int             exitval;        /* most recent exit value */
        unsigned char   trapnote;       /* set when trap/signal is pending */
-       char            subshell;       /* set for virtual subshell */
        char            shcomp;         /* set when runing shcomp */
+       short           subshell;       /* set for virtual subshell */
 #ifdef _SH_PRIVATE
        _SH_PRIVATE
 #endif /* _SH_PRIVATE */
--- old/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/acct    Fri Sep 25 
06:40:59 2009
+++ new/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/acct    Fri Sep 25 
06:40:57 2009
@@ -1,11 +1,11 @@
-/* : : generated by iffe version 2008-01-31 : : */
+/* : : generated by iffe version 2009-05-01 : : */
 #ifndef _def_acct_ksh93
 #define _def_acct_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _lib_acct      1       /* acct() in default lib(s) */
--- old/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/cmds    Fri Sep 25 
06:41:02 2009
+++ new/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/cmds    Fri Sep 25 
06:41:00 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/cmds
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/cmd/ksh93/features/cmds
 by iffe version 2009-05-01 : : */
 #ifndef _def_cmds_ksh93
 #define _def_cmds_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _cmd_newgrp    1       /* newgrp in ?(/usr)/(bin|etc|ucb) */
--- old/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/dynamic Fri Sep 25 
06:41:05 2009
+++ new/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/dynamic Fri Sep 25 
06:41:03 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/dynamic
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/cmd/ksh93/features/dynamic
 by iffe version 2009-05-01 : : */
 #ifndef _def_dynamic_ksh93
 #define _def_dynamic_ksh93     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #if SHOPT_DYNAMIC
--- old/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/execargs        Fri Sep 
25 06:41:08 2009
+++ new/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/execargs        Fri Sep 
25 06:41:06 2009
@@ -1,11 +1,11 @@
-/* : : generated by iffe version 2008-01-31 : : */
+/* : : generated by iffe version 2009-05-01 : : */
 #ifndef _def_execargs_ksh93
 #define _def_execargs_ksh93    1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #endif
--- old/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/externs Fri Sep 25 
06:41:11 2009
+++ new/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/externs Fri Sep 25 
06:41:09 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/externs
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/cmd/ksh93/features/externs
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_externs_ksh93
 #if !defined(__PROTO__)
@@ -63,10 +63,10 @@
 
 #define _def_externs_ksh93     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _hdr_exec_attr 1       /* #include <exec_attr.h> ok */
--- old/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/locale  Fri Sep 25 
06:41:14 2009
+++ new/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/locale  Fri Sep 25 
06:41:12 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/locale
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/cmd/ksh93/features/locale
 by iffe version 2009-05-01 : : */
 #ifndef _def_locale_ksh93
 #define _def_locale_ksh93      1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _hdr_locale    1       /* #include <locale.h> ok */
--- old/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/math    Fri Sep 25 
06:41:17 2009
+++ new/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/math    Fri Sep 25 
06:41:15 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/math.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/cmd/ksh93/features/math.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_math_ksh93
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
@@ -62,15 +62,15 @@
 
 #define _def_math_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
                   
 
-/* : : generated by iffe from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/data/math.tab
 : : */
+/* : : generated by iffe from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/cmd/ksh93/data/math.tab
 : : */
 
 typedef Sfdouble_t (*Math_f) __PROTO__((Sfdouble_t,...));
 
@@ -88,7 +88,13 @@
 static int local_islessequal __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, 
a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return islessequal(a1,a2);}
 static int local_islessgreater __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, 
a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return islessgreater(a1,a2);}
 static int local_isnormal __PARAM__((Sfdouble_t a1), (a1)) 
__OTORP__(Sfdouble_t a1;){return isnormal(a1);}
+#ifdef FP_SUBNORMAL
+static int local_issubnormal __PARAM__((Sfdouble_t x), (x)) 
__OTORP__(Sfdouble_t x;){ return fpclassify(x) == FP_SUBNORMAL; }
+#endif
 static int local_isunordered __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, 
a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return isunordered(a1,a2);}
+#ifdef FP_ZERO
+static int local_iszero __PARAM__((Sfdouble_t x), (x)) __OTORP__(Sfdouble_t 
x;){ return fpclassify(x) == FP_ZERO; }
+#endif
 static int local_signbit __PARAM__((Sfdouble_t a1), (a1)) __OTORP__(Sfdouble_t 
a1;){return signbit(a1);}
 
 /*
@@ -136,9 +142,19 @@
        "\012islessgreater",    (Math_f)local_islessgreater,
        "\011isnan",    (Math_f)isnanl,
        "\011isnormal", (Math_f)local_isnormal,
+#ifdef FP_SUBNORMAL
+       "\011issubnormal",      (Math_f)local_issubnormal,
+#endif
        "\012isunordered",      (Math_f)local_isunordered,
+#ifdef FP_ZERO
+       "\011iszero",   (Math_f)local_iszero,
+#endif
+       "\001j0",       (Math_f)j0l,
+       "\001j1",       (Math_f)j1l,
+       "\002jn",       (Math_f)jnl,
        "\001lgamma",   (Math_f)lgammal,
        "\001log",      (Math_f)logl,
+       "\001log10",    (Math_f)log10l,
        "\001log1p",    (Math_f)log1pl,
        "\001log2",     (Math_f)log2l,
        "\001logb",     (Math_f)logbl,
@@ -159,6 +175,9 @@
        "\001tanh",     (Math_f)tanhl,
        "\001tgamma",   (Math_f)tgammal,
        "\001trunc",    (Math_f)truncl,
+       "\001y0",       (Math_f)y0l,
+       "\001y1",       (Math_f)y1l,
+       "\002yn",       (Math_f)ynl,
        "",             (Math_f)0
 };
 #endif
--- old/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/options Fri Sep 25 
06:41:20 2009
+++ new/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/options Fri Sep 25 
06:41:18 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/options
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/cmd/ksh93/features/options
 by iffe version 2009-05-01 : : */
 #ifndef _def_options_ksh93
 #define _def_options_ksh93     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define SHELLMAGIC     1
--- old/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/poll    Fri Sep 25 
06:41:22 2009
+++ new/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/poll    Fri Sep 25 
06:41:21 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/poll
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/cmd/ksh93/features/poll
 by iffe version 2009-05-01 : : */
 #ifndef _def_poll_ksh93
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
@@ -62,10 +62,10 @@
 
 #define _def_poll_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _hdr_poll      1       /* #include <poll.h> ok */
--- old/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/pstat   Fri Sep 25 
06:41:25 2009
+++ new/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/pstat   Fri Sep 25 
06:41:24 2009
@@ -1,11 +1,11 @@
-/* : : generated by iffe version 2008-01-31 : : */
+/* : : generated by iffe version 2009-05-01 : : */
 #ifndef _def_pstat_ksh93
 #define _def_pstat_ksh93       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #endif
--- old/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/rlimits Fri Sep 25 
06:41:28 2009
+++ new/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/rlimits Fri Sep 25 
06:41:26 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/rlimits
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/cmd/ksh93/features/rlimits
 by iffe version 2009-05-01 : : */
 #ifndef _def_rlimits_ksh93
 #define _def_rlimits_ksh93     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _sys_resource  1       /* #include <sys/resource.h> ok */
--- old/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/setjmp  Fri Sep 25 
06:41:31 2009
+++ new/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/setjmp  Fri Sep 25 
06:41:29 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/setjmp
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/cmd/ksh93/features/setjmp
 by iffe version 2009-05-01 : : */
 #ifndef _def_setjmp_ksh93
 #define _def_setjmp_ksh93      1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _lib_sigsetjmp 1       /* sigsetjmp() in default lib(s) */
--- old/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/sigfeatures     Fri Sep 
25 06:41:34 2009
+++ new/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/sigfeatures     Fri Sep 
25 06:41:32 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/sigfeatures
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/cmd/ksh93/features/sigfeatures
 by iffe version 2009-05-01 : : */
 #ifndef _def_sigfeatures_ksh93
 #define _def_sigfeatures_ksh93 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _lib_sigrelse  1       /* sigrelse() in default lib(s) */
--- old/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/time    Fri Sep 25 
06:41:37 2009
+++ new/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/time    Fri Sep 25 
06:41:35 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/time
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/cmd/ksh93/features/time
 by iffe version 2009-05-01 : : */
 #ifndef _def_time_ksh93
 #define _def_time_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _hdr_utime     1       /* #include <utime.h> ok */
--- old/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/ttys    Fri Sep 25 
06:41:40 2009
+++ new/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/ttys    Fri Sep 25 
06:41:38 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/ttys
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/cmd/ksh93/features/ttys
 by iffe version 2009-05-01 : : */
 #ifndef _def_ttys_ksh93
 #define _def_ttys_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _hdr_termios   1       /* #include <termios.h> ok */
--- old/usr/src/lib/libshell/misc/ERRATA.txt    Fri Sep 25 06:41:43 2009
+++ new/usr/src/lib/libshell/misc/ERRATA.txt    Fri Sep 25 06:41:41 2009
@@ -33,7 +33,7 @@
 ######## Errata #001: ########
 The usage of |posix_spawn()| has been manually disabled because there seems to 
be a
 race condition which cases sporadic failures like this:
--- snip --.
+-- snip --
 $ builtin | fgrep sum | fgrep sum
 /usr/ast/bin/sum
 /usr/bin/sum
@@ -202,6 +202,160 @@
 
 
 ######## Errata #002: ########
+The usage of |mmap()| has been manually enabled to improve I/O performance.
+The following files have been changed:
+-- snip --
+Index: usr/src/lib/libast/sparcv9/include/ast/ast_mmap.h
+===================================================================
+--- usr/src/lib/libast/sparcv9/include/ast/ast_mmap.h  (revision 1701)
++++ usr/src/lib/libast/sparcv9/include/ast/ast_mmap.h  (working copy)
+@@ -28,6 +28,7 @@
+ #define _lib_mmap64   1       /* mmap64 interface and implementation work */
+ #define _mmap_anon    1       /* use mmap MAP_ANON to get raw memory */
+ #define _mmap_devzero 1       /* use mmap on /dev/zero to get raw memory */
++#define _mmap_worthy  2       /* mmap is good */
+ 
+ /* some systems get it wrong but escape concise detection */
+ #ifndef _NO_MMAP
+Index: usr/src/lib/libast/sparcv9/src/lib/libast/ast_mmap.h
+===================================================================
+--- usr/src/lib/libast/sparcv9/src/lib/libast/ast_mmap.h       (revision 1701)
++++ usr/src/lib/libast/sparcv9/src/lib/libast/ast_mmap.h       (working copy)
+@@ -7,6 +7,7 @@
+ #define _lib_mmap64   1       /* mmap64 interface and implementation work */
+ #define _mmap_anon    1       /* use mmap MAP_ANON to get raw memory */
+ #define _mmap_devzero 1       /* use mmap on /dev/zero to get raw memory */
++#define _mmap_worthy  2       /* mmap is good */
+ 
+ /* some systems get it wrong but escape concise detection */
+ #ifndef _NO_MMAP
+Index: usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mmap
+===================================================================
+--- usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mmap     (revision 1701)
++++ usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mmap     (working copy)
+@@ -7,6 +7,7 @@
+ #define _lib_mmap64   1       /* mmap64 interface and implementation work */
+ #define _mmap_anon    1       /* use mmap MAP_ANON to get raw memory */
+ #define _mmap_devzero 1       /* use mmap on /dev/zero to get raw memory */
++#define _mmap_worthy  2       /* mmap is good */
+ 
+ /* some systems get it wrong but escape concise detection */
+ #ifndef _NO_MMAP
+Index: usr/src/lib/libast/sparc/include/ast/ast_mmap.h
+===================================================================
+--- usr/src/lib/libast/sparc/include/ast/ast_mmap.h    (revision 1701)
++++ usr/src/lib/libast/sparc/include/ast/ast_mmap.h    (working copy)
+@@ -28,7 +28,7 @@
+ #define _lib_mmap64   1       /* mmap64 interface and implementation work */
+ #define _mmap_anon    1       /* use mmap MAP_ANON to get raw memory */
+ #define _mmap_devzero 1       /* use mmap on /dev/zero to get raw memory */
+-#define _mmap_worthy  1       /* mmap is good */
++#define _mmap_worthy  2       /* mmap is good */
+ 
+ /* some systems get it wrong but escape concise detection */
+ #ifndef _NO_MMAP
+Index: usr/src/lib/libast/sparc/src/lib/libast/ast_mmap.h
+===================================================================
+--- usr/src/lib/libast/sparc/src/lib/libast/ast_mmap.h (revision 1701)
++++ usr/src/lib/libast/sparc/src/lib/libast/ast_mmap.h (working copy)
+@@ -7,7 +7,7 @@
+ #define _lib_mmap64   1       /* mmap64 interface and implementation work */
+ #define _mmap_anon    1       /* use mmap MAP_ANON to get raw memory */
+ #define _mmap_devzero 1       /* use mmap on /dev/zero to get raw memory */
+-#define _mmap_worthy  1       /* mmap is good */
++#define _mmap_worthy  2       /* mmap is good */
+ 
+ /* some systems get it wrong but escape concise detection */
+ #ifndef _NO_MMAP
+Index: usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mmap
+===================================================================
+--- usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mmap       (revision 1701)
++++ usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mmap       (working copy)
+@@ -7,7 +7,7 @@
+ #define _lib_mmap64   1       /* mmap64 interface and implementation work */
+ #define _mmap_anon    1       /* use mmap MAP_ANON to get raw memory */
+ #define _mmap_devzero 1       /* use mmap on /dev/zero to get raw memory */
+-#define _mmap_worthy  1       /* mmap is good */
++#define _mmap_worthy  2       /* mmap is good */
+ 
+ /* some systems get it wrong but escape concise detection */
+ #ifndef _NO_MMAP
+Index: usr/src/lib/libast/i386/include/ast/ast_mmap.h
+===================================================================
+--- usr/src/lib/libast/i386/include/ast/ast_mmap.h     (revision 1701)
++++ usr/src/lib/libast/i386/include/ast/ast_mmap.h     (working copy)
+@@ -28,6 +28,7 @@
+ #define _lib_mmap64   1       /* mmap64 interface and implementation work */
+ #define _mmap_anon    1       /* use mmap MAP_ANON to get raw memory */
+ #define _mmap_devzero 1       /* use mmap on /dev/zero to get raw memory */
++#define _mmap_worthy  2       /* mmap is good */
+ 
+ /* some systems get it wrong but escape concise detection */
+ #ifndef _NO_MMAP
+Index: usr/src/lib/libast/i386/src/lib/libast/ast_mmap.h
+===================================================================
+--- usr/src/lib/libast/i386/src/lib/libast/ast_mmap.h  (revision 1701)
++++ usr/src/lib/libast/i386/src/lib/libast/ast_mmap.h  (working copy)
+@@ -7,6 +7,7 @@
+ #define _lib_mmap64   1       /* mmap64 interface and implementation work */
+ #define _mmap_anon    1       /* use mmap MAP_ANON to get raw memory */
+ #define _mmap_devzero 1       /* use mmap on /dev/zero to get raw memory */
++#define _mmap_worthy  2       /* mmap is good */
+ 
+ /* some systems get it wrong but escape concise detection */
+ #ifndef _NO_MMAP
+Index: usr/src/lib/libast/i386/src/lib/libast/FEATURE/mmap
+===================================================================
+--- usr/src/lib/libast/i386/src/lib/libast/FEATURE/mmap        (revision 1701)
++++ usr/src/lib/libast/i386/src/lib/libast/FEATURE/mmap        (working copy)
+@@ -7,6 +7,7 @@
+ #define _lib_mmap64   1       /* mmap64 interface and implementation work */
+ #define _mmap_anon    1       /* use mmap MAP_ANON to get raw memory */
+ #define _mmap_devzero 1       /* use mmap on /dev/zero to get raw memory */
++#define _mmap_worthy  2       /* mmap is good */
+ 
+ /* some systems get it wrong but escape concise detection */
+ #ifndef _NO_MMAP
+Index: usr/src/lib/libast/amd64/include/ast/ast_mmap.h
+===================================================================
+--- usr/src/lib/libast/amd64/include/ast/ast_mmap.h    (revision 1701)
++++ usr/src/lib/libast/amd64/include/ast/ast_mmap.h    (working copy)
+@@ -28,6 +28,7 @@
+ #define _lib_mmap64   1       /* mmap64 interface and implementation work */
+ #define _mmap_anon    1       /* use mmap MAP_ANON to get raw memory */
+ #define _mmap_devzero 1       /* use mmap on /dev/zero to get raw memory */
++#define _mmap_worthy  2       /* mmap is good */
+ 
+ /* some systems get it wrong but escape concise detection */
+ #ifndef _NO_MMAP
+Index: usr/src/lib/libast/amd64/src/lib/libast/ast_mmap.h
+===================================================================
+--- usr/src/lib/libast/amd64/src/lib/libast/ast_mmap.h (revision 1701)
++++ usr/src/lib/libast/amd64/src/lib/libast/ast_mmap.h (working copy)
+@@ -7,6 +7,7 @@
+ #define _lib_mmap64   1       /* mmap64 interface and implementation work */
+ #define _mmap_anon    1       /* use mmap MAP_ANON to get raw memory */
+ #define _mmap_devzero 1       /* use mmap on /dev/zero to get raw memory */
++#define _mmap_worthy  2       /* mmap is good */
+ 
+ /* some systems get it wrong but escape concise detection */
+ #ifndef _NO_MMAP
+Index: usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mmap
+===================================================================
+--- usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mmap       (revision 1701)
++++ usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mmap       (working copy)
+@@ -7,6 +7,7 @@
+ #define _lib_mmap64   1       /* mmap64 interface and implementation work */
+ #define _mmap_anon    1       /* use mmap MAP_ANON to get raw memory */
+ #define _mmap_devzero 1       /* use mmap on /dev/zero to get raw memory */
++#define _mmap_worthy  2       /* mmap is good */
+ 
+ /* some systems get it wrong but escape concise detection */
+ #ifndef _NO_MMAP
+-- snip --
+
+
+######## Errata #003: ########
 A workaround was added for a problem with the "multiline" editor mode which
 occurs when the edit line becomes longer than the terminal's width and the
 terminal cursor is not at position 0 when PS1 is send to the terminal.
@@ -217,118 +371,31 @@
 of the next line if the terminal cursor is not at position 0.
 
 
-######## Errata #003: ########
-A fix was backported to cure sporadic VSC test suite failures. The failures are
-generated when command substitutions+functions are executed in a nested manner
-- sometimes the return code is non-zero even if the called function explicitly
-contains a "return 0"-statement.
-The following files have been changed:
--- snip --
-Index: src/lib/libshell/common/sh/jobs.c
-===================================================================
---- src/lib/libshell/common/sh/jobs.c  (revision 1284)
-+++ src/lib/libshell/common/sh/jobs.c  (working copy)
-@@ -1224,6 +1224,8 @@
-       job_lock();
-       if(pid > 1)
-       {
-+              if(pid==sh.spid)
-+                      sh.spid = 0;
-               if(!(pw=job_bypid(pid)))
-               {
-                       /* check to see whether job status has been saved */
--- snip --
-
-
 ######## Errata #004: ########
-A fix was backported to cure a hang in a command substitution when the
-amount of data exceeds a certain amount of data (this was causing
-the hang in CR #6800929 ("snv_106 ksh93 update breaks Install(1M)")).
+A workaround has been added for a probem with the AST "tail" builtin which 
+causes "tail" to sleep too long when polling for data in "follow" mode.
 The following files have been changed:
 -- snip --
-Index: src/lib/libshell/common/include/defs.h
+Index: src/lib/libcmd/common/tail.c
 ===================================================================
---- src/lib/libshell/common/include/defs.h     (revision 1391)
-+++ src/lib/libshell/common/include/defs.h     (working copy)
-@@ -166,6 +166,7 @@
-       char            winch; \
-       char            indebug;        /* set when in debug trap */ \
-       unsigned char   lastsig;        /* last signal received */ \
-+      char            subshare;       /* set when in ${..} comsub */ \
-       char            *readscript;    /* set before reading a script */ \
-       int             *inpipe;        /* input pipe pointer */ \
-       int             *outpipe;       /* output pipe pointer */ \
-Index: src/lib/libshell/common/sh/subshell.c
-===================================================================
---- src/lib/libshell/common/sh/subshell.c      (revision 1391)
-+++ src/lib/libshell/common/sh/subshell.c      (working copy)
-@@ -89,6 +89,7 @@
-       int             coutpipe;
-       int             cpipe;
-       int             nofork;
-+      char            subshare;
- } *subshell_data;
- 
- static int subenv;
-@@ -477,7 +478,9 @@
-       sp->bckpid = shp->bckpid;
-       if(comsub)
-               sh_stats(STAT_COMSUB);
--      if(!comsub || (comsub==1 && !sh_isoption(SH_SUBSHARE)))
-+      sp->subshare = shp->subshare;
-+      shp->subshare = comsub==2 ||  (comsub==1 && sh_isoption(SH_SUBSHARE));
-+      if(!comsub || !shp->subshare)
-       {
-               sp->shpwd = shp->pwd;
-               sp->pwd = (shp->pwd?strdup(shp->pwd):0);
-@@ -677,6 +680,7 @@
-               shp->cpipe[1] = sp->cpipe;
-               shp->coutpipe = sp->coutpipe;
-       }
-+      shp->subshare = sp->subshare;
-       if(shp->subshell)
-               SH_SUBSHELLNOD->nvalue.s = --shp->subshell;
-       if(sp->sig)
-Index: src/lib/libshell/common/sh/xec.c
-===================================================================
---- src/lib/libshell/common/sh/xec.c   (revision 1391)
-+++ src/lib/libshell/common/sh/xec.c   (working copy)
-@@ -1406,7 +1406,12 @@
-                       pid_t   savepgid = job.curpgid;
-                       job.curpgid = 0;
-                       if(shp->subshell)
--                              sh_subtmpfile(1);
+--- src/lib/libcmd/common/tail.c       (revision 1701)
++++ src/lib/libcmd/common/tail.c       (working copy)
+@@ -636,7 +636,14 @@
+               {
+                       if (sfsync(sfstdout))
+                               error(ERROR_system(1), "write error");
++#if 0
+                       sleep(1);
++#else
 +                      {
-+                              if(shp->subshare)
-+                                      sh_subtmpfile(0);
-+                              else
-+                                      sh_subfork();
++                              struct timespec rqt = { 0L, 1000000000L/4L };
++                              (void)nanosleep(&rqt, NULL);
 +                      }
-                       shp->inpipe = pvo;
-                       shp->outpipe = pvn;
-                       pvo[1] = -1;
++#endif
+                       n = 0;
+                       pp = 0;
+                       while (fp)
 -- snip --
 
 
-######## Errata #005: ########
-A fix was backported for CR #6807179 to cure an unneccesary
-|libc::getpwnam()| lookup when the shell encountered a
-"~(modifer)pattern"-shell pattern (the leading '~' triggered a
-(unneccesary) tilde expansion).
-The following files have been changed:
--- snip --
---- src/lib/libshell/common/sh/macro.c    Wed Feb 18 11:53:56 2009 +0800
-+++ src/lib/libshell/common/sh/macro.c    Wed Feb 18 21:45:00 2009 +0100
-@@ -439,7 +439,7 @@
-       mp->sp = NIL(Sfio_t*);
-       mp->quote = newquote;
-       first = cp = fcseek(0);
--      if(!mp->quote && *cp=='~')
-+      if(!mp->quote && *cp=='~' && cp[1]!=LPAREN)
-               tilde = stktell(stkp);
-       /* handle // operator specially */
-       if(mp->pattern==2 && *cp=='/')
-
--- snip --
-
-#EOF.
+# EOF.
--- old/usr/src/lib/libshell/misc/buildksh93.readme     Fri Sep 25 06:41:46 2009
+++ new/usr/src/lib/libshell/misc/buildksh93.readme     Fri Sep 25 06:41:44 2009
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
  
@@ -31,8 +31,10 @@
 "buildksh93.sh" is a small build script used to build the AT&T "ast-ksh"
 and "ast-open" packages using its native (nmake-based) build system
 which is needed to build the iffe-generated (header) files (each time
-for { 32bit SPARC, 64bit SPARC, 32bit i386, 64bit AMD64 }) which are
-moved later to their matching OS/Net build directories.
+for { 32bit SPARC, 64bit SPARC, 32bit i386, 64bit AMD64, 32bit S390,
+64bit S390x }) which are moved later to their matching OS/Net build
+directories.
+
 THIS SCRIPT IS NOT INTENDED FOR NORMAL USAGE.
 
 
@@ -47,14 +49,14 @@
 * Example usage of the script (more information can be found in the
 script itself):
 ## Download AT&T ksh93 sources
-$ wget --http-user="I accept www.opensource.org/licenses/cpl" 
--http-passwd="." 
'http://www.research.att.com/~gsf/download/tgz/INIT.2008-11-04.tgz'
-$ wget --http-user="I accept www.opensource.org/licenses/cpl" 
--http-passwd="." 
'http://www.research.att.com/~gsf/download/tgz/ast-ksh.2008-11-04.tgz'
+$ wget --http-user="I accept www.opensource.org/licenses/cpl" 
--http-passwd="." 
'http://www.research.att.com/~gsf/download/tgz/INIT.2009-09-08.tgz'
+$ wget --http-user="I accept www.opensource.org/licenses/cpl" 
--http-passwd="." 
'http://www.research.att.com/~gsf/download/tgz/ast-ksh.2009-09-08.tgz'
 
 ## Unpack the sources (32bit SPARC):
 $ mkdir build_sparc_32bit
 $ cd build_sparc_32bit
-$ gunzip -c <../INIT.2008-11-04.tgz | tar -xf -
-$ gunzip -c <../ast-ksh.2008-11-04.tgz | tar -xf -
+$ gunzip -c <../INIT.2009-09-08.tgz | tar -xf -
+$ gunzip -c <../ast-ksh.2009-09-08.tgz | tar -xf -
 
 ## Build ast-ksh for 32bit SPARC
 # (build other build flags are:
--- old/usr/src/lib/libshell/misc/buildksh93.sh Fri Sep 25 06:41:49 2009
+++ new/usr/src/lib/libshell/misc/buildksh93.sh Fri Sep 25 06:41:47 2009
@@ -23,18 +23,18 @@
 #
 
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
 #
-# buildksh93.ksh - ast-ksh standalone build script for the 
+# buildksh93.sh - ast-ksh standalone build script for the 
 # OpenSolaris ksh93-integration project
 #
 
 # ksh93t sources can be downloaded like this from the AT&T site:
-# wget --http-user="I accept www.opensource.org/licenses/cpl" 
--http-passwd="." 
'http://www.research.att.com/~gsf/download/tgz/INIT.2008-11-04.tgz'
-# wget --http-user="I accept www.opensource.org/licenses/cpl" 
--http-passwd="." 
'http://www.research.att.com/~gsf/download/tgz/ast-ksh.2008-11-04.tgz'
+# wget --http-user="I accept www.opensource.org/licenses/cpl" 
--http-passwd="." 
'http://www.research.att.com/sw/download/beta/INIT.2009-09-08.tgz'
+# wget --http-user="I accept www.opensource.org/licenses/cpl" 
--http-passwd="." 
'http://www.research.att.com/sw/download/beta/ast-ksh.2009-09-08.tgz'
 
 function fatal_error
 {
@@ -93,7 +93,7 @@
  */
 
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -143,6 +143,7 @@
 /* undo ast_map.h #defines to avoid collision */
 #undef basename
 #undef dirname
+#undef mktemp
 
 /* Generated data, do not edit. */
 XPG4CMDLIST(basename)
@@ -159,6 +160,7 @@
 ASTCMDLIST(cksum)
 BINCMDLIST(cmp)
 ASTCMDLIST(cmp)
+BINCMDLIST(comm)
 ASTCMDLIST(comm)
 XPG4CMDLIST(cp)
 ASTCMDLIST(cp)
@@ -176,6 +178,7 @@
 ASTCMDLIST(head)
 XPG4CMDLIST(id)
 ASTCMDLIST(id)
+BINCMDLIST(join)
 ASTCMDLIST(join)
 XPG4CMDLIST(ln)
 ASTCMDLIST(ln)
@@ -185,10 +188,13 @@
 ASTCMDLIST(mkdir)
 BINCMDLIST(mkfifo)
 ASTCMDLIST(mkfifo)
+BINCMDLIST(mktemp)
+ASTCMDLIST(mktemp)
 XPG4CMDLIST(mv)
 ASTCMDLIST(mv)
 BINCMDLIST(paste)
 ASTCMDLIST(paste)
+BINCMDLIST(pathchk)
 ASTCMDLIST(pathchk)
 BINCMDLIST(rev)
 ASTCMDLIST(rev)
@@ -204,6 +210,7 @@
 SBINCMDLIST(sync)
 BINCMDLIST(sync)
 ASTCMDLIST(sync)
+BINCMDLIST(tail)
 XPG4CMDLIST(tail)
 ASTCMDLIST(tail)
 BINCMDLIST(tee)
@@ -305,14 +312,15 @@
 
             # gcc flags
             bgcc99="/usr/sfw/bin/gcc -std=gnu99 -D_XOPEN_SOURCE=600 
-D__EXTENSIONS__=1"
-            bgcc_ccflags="${bon_flags} ${bast_flags} -D_lib_socket=1 -lsocket 
-lnsl"
+            bgcc_warnflags="-Wall -Wextra -Wno-unknown-pragmas 
-Wno-missing-braces -Wno-sign-compare -Wno-parentheses -Wno-uninitialized 
-Wno-implicit-function-declaration -Wno-unused -Wno-trigraphs 
-Wno-char-subscripts -Wno-switch"
+            bgcc_ccflags="${bon_flags} ${bgcc_warnflags} ${bast_flags} 
-D_lib_socket=1 -lsocket -lnsl"
  
-
             case "${buildmode}" in
-                *.i386.32bit.suncc*)  HOSTTYPE="sol11.i386" CC="${bsunc99}"    
                        cc_sharedlib="-G" CCFLAGS="${bsuncc_ccflags}"  ;;
-                *.i386.64bit.suncc*)  HOSTTYPE="sol11.i386" CC="${bsunc99} 
-xarch=amd64 -KPIC"         cc_sharedlib="-G" CCFLAGS="${bsuncc_ccflags}"  ;;
-                *.sparc.32bit.suncc*) HOSTTYPE="sol11.sun4" CC="${bsunc99}"    
                        cc_sharedlib="-G" CCFLAGS="${bsuncc_ccflags}" 
bsuncc_app_ccflags="${bsuncc_app_ccflags_sparc}" ;;
-                *.sparc.64bit.suncc*) HOSTTYPE="sol11.sun4" CC="${bsunc99} 
-xarch=v9 -dalign -KPIC"    cc_sharedlib="-G" CCFLAGS="${bsuncc_ccflags}" 
bsuncc_app_ccflags="${bsuncc_app_ccflags_sparc}" ;;
+               # for -m32/-m64 flags see usr/src/Makefile.master, makefile 
symbols *_XARCH/co.
+                *.i386.32bit.suncc*)  HOSTTYPE="sol11.i386" CC="${bsunc99} 
-m32"                  cc_sharedlib="-G" CCFLAGS="${bsuncc_ccflags}"  ;;
+                *.i386.64bit.suncc*)  HOSTTYPE="sol11.i386" CC="${bsunc99} 
-m64 -KPIC"            cc_sharedlib="-G" CCFLAGS="${bsuncc_ccflags}"  ;;
+                *.sparc.32bit.suncc*) HOSTTYPE="sol11.sun4" CC="${bsunc99} 
-m32"                  cc_sharedlib="-G" CCFLAGS="${bsuncc_ccflags}" 
bsuncc_app_ccflags="${bsuncc_app_ccflags_sparc}" ;;
+                *.sparc.64bit.suncc*) HOSTTYPE="sol11.sun4" CC="${bsunc99} 
-m64 -dalign -KPIC"    cc_sharedlib="-G" CCFLAGS="${bsuncc_ccflags}" 
bsuncc_app_ccflags="${bsuncc_app_ccflags_sparc}" ;;
 
                 *.i386.32bit.gcc*)  HOSTTYPE="sol11.i386" CC="${bgcc99} -fPIC" 
                                           cc_sharedlib="-shared" 
CCFLAGS="${bgcc_ccflags}"  ;;
                 *.i386.64bit.gcc*)  HOSTTYPE="sol11.i386" CC="${bgcc99} -m64 
-mtune=opteron -Ui386 -U__i386 -fPIC"        cc_sharedlib="-shared" 
CCFLAGS="${bgcc_ccflags}"  ;;
@@ -349,17 +357,22 @@
 
     [[ -s $log ]] || fatal_error "build_shell: no make.out log found."
 
+    if [[ -f ${root}/lib/libast-g.a   ]] then link_libast="ast-g"     ; else 
link_libast="ast"     ; fi
+    if [[ -f ${root}/lib/libdll-g.a   ]] then link_libdll="dll-g"     ; else 
link_libdll="dll"     ; fi
+    if [[ -f ${root}/lib/libsum-g.a   ]] then link_libsum="sum-g"     ; else 
link_libsum="sum"     ; fi
+    if [[ -f ${root}/lib/libcmd-g.a   ]] then link_libcmd="cmd-g"     ; else 
link_libcmd="cmd"     ; fi
+    if [[ -f ${root}/lib/libshell-g.a ]] then link_libshell="shell-g" ; else 
link_libshell="shell" ; fi
+
     if [[ "${buildmode}" != *.staticshell* ]] ; then
         # libcmd causes some trouble since there is a squatter in solaris
         # This has been fixed in Solaris 11/B48 but may require adjustments
         # for older Solaris releases
         for lib in libast libdll libsum libcmd libshell ; do
-            (( $? == 0 )) || exit 1
             case "$lib" in
             libshell)
                 base="lib/"
                 vers=1
-                link="-L${root}/lib/ -lcmd -lsum -ldll -last -lm"
+                link="-L${root}/lib/ -l${link_libcmd} -l${link_libsum} 
-l${link_libdll} -l${link_libast} -lm"
                 ;;
             libdll)
                 base="src/lib/${lib}"
@@ -374,20 +387,23 @@
             *)
                 base="src/lib/${lib}"
                 vers=1
-                link="-L${root}/lib/ -last -lm"
+                link="-L${root}/lib/ -l${link_libast} -lm"
                 ;;
             esac
 
             (
             cd "${root}/${base}"
+           
+           if [[ -f ${lib}-g.a ]] ; then lib_a="${lib}-g.a" ; else 
lib_a="${lib}.a" ; fi
+           
             if [[ "${buildmode}" == *solaris* ]] ; then
-                ${CC} ${cc_sharedlib} ${CCFLAGS} -Bdirect -Wl,-zallextract 
-Wl,-zmuldefs -o "${root}/lib/${lib}.so.${vers}" "${lib}.a"  $link
+                ${CC} ${cc_sharedlib} ${CCFLAGS} -Bdirect -Wl,-zallextract 
-Wl,-zmuldefs -o "${root}/lib/${lib}.so.${vers}" "${lib_a}"  $link
             else
-                ${CC} ${cc_sharedlib} ${CCFLAGS} -Wl,--whole-archive 
-Wl,-zmuldefs "${lib}.a" -Wl,--no-whole-archive -o 
"${root}/lib/${lib}.so.${vers}" $link
+                ${CC} ${cc_sharedlib} ${CCFLAGS} -Wl,--whole-archive 
-Wl,-zmuldefs "${lib_a}" -Wl,--no-whole-archive -o 
"${root}/lib/${lib}.so.${vers}" $link
             fi
            
             #rm ${lib}.a
-            mv "${lib}.a" "disabled_${lib}.a_"
+            mv "${lib_a}" "disabled_${lib_a}_"
 
             cd "${root}/lib"
             ln -sf "${lib}.so.${vers}" "${lib}.so"
@@ -398,13 +414,13 @@
           base=src/cmd/ksh93
           cd "${root}/${base}"
           rm -f \
-             "${root}/lib/libshell.a" \
-              "${root}/lib/libsum.a" \
-              "${root}/lib/libdll.a" \
-              "${root}/lib/libast.a"
+             "${root}/lib/libshell.a" "${root}/lib/libshell-g.a" \
+              "${root}/lib/libsum.a" "${root}/lib/libsum-g.a" \
+              "${root}/lib/libdll.a" "${root}/lib/libdll-g.a" \
+              "${root}/lib/libast.a""${root}/lib/libast-g.a"
 
           if [[ "${buildmode}" == *solaris* ]] ; then
-              ${CC} ${CCFLAGS} ${bsuncc_app_ccflags} -L${root}/lib/ -Bdirect 
-o ksh pmain.o -lshell -Bstatic -lcmd -Bdynamic -lsum -ldll -last -lm -lmd 
-lsecdb
+              ${CC} ${CCFLAGS} ${bsuncc_app_ccflags} -L${root}/lib/ -Bdirect 
-o ksh pmain.o -lshell -Bstatic -l${link_libcmd} -Bdynamic -lsum -ldll -last 
-lm -lmd -lsecdb
           else
               ${CC} ${CCFLAGS} ${bsuncc_app_ccflags} -L${root}/lib/ -o ksh 
pmain.o -lshell -lcmd -lsum -ldll -last -lm
           fi
@@ -445,6 +461,8 @@
 {
     set -o errexit
     set -o xtrace
+    
+    ulimit -s 65536 # need larger stack on 64bit SPARC to pass all tests
 
     export SHELL="$(ls -1 $PWD/arch/*/src/cmd/ksh93/ksh)"
     export LD_LIBRARY_PATH="$(ls -1ad $PWD/arch/*/lib):${LD_LIBRARY_PATH}"
@@ -456,7 +474,7 @@
     [[ ! -f "${SHELL}" ]] && fatal_error "test_shell: |${SHELL}| is not a 
file."
     [[ ! -x "${SHELL}" ]] && fatal_error "test_shell: |${SHELL}| is not 
executable."
     
-    [[ "${TEST_LANG}" == "" ]] && TEST_LANG="C"
+    [[ "${TEST_LANG}" == "" ]] && TEST_LANG="C ja_JP.UTF-8"
 
     case "${buildmode}" in
             testshell.bcheck*)
Binary files /tmp/ddba4Za and 
new/usr/src/lib/libshell/misc/images/callouts/1.png differ
Binary files /tmp/dZRaW4a and 
new/usr/src/lib/libshell/misc/images/callouts/10.png differ
Binary files /tmp/dCwaq9a and 
new/usr/src/lib/libshell/misc/images/callouts/2.png differ
Binary files /tmp/ddcaGbb and 
new/usr/src/lib/libshell/misc/images/callouts/3.png differ
Binary files /tmp/d3Saqgb and 
new/usr/src/lib/libshell/misc/images/callouts/4.png differ
Binary files /tmp/d3waWkb and 
new/usr/src/lib/libshell/misc/images/callouts/5.png differ
Binary files /tmp/d3aaapb and 
new/usr/src/lib/libshell/misc/images/callouts/6.png differ
Binary files /tmp/dVRaqtb and 
new/usr/src/lib/libshell/misc/images/callouts/7.png differ
Binary files /tmp/dOxaGxb and 
new/usr/src/lib/libshell/misc/images/callouts/8.png differ
Binary files /tmp/dgdaWBb and 
new/usr/src/lib/libshell/misc/images/callouts/9.png differ
Binary files /tmp/dCUaOGb and 
new/usr/src/lib/libshell/misc/images/tag_bourne.png differ
Binary files /tmp/dKya4Kb and new/usr/src/lib/libshell/misc/images/tag_i18n.png 
differ
Binary files /tmp/dGdaiPb and new/usr/src/lib/libshell/misc/images/tag_ksh.png 
differ
Binary files /tmp/d6UayTb and 
new/usr/src/lib/libshell/misc/images/tag_ksh88.png differ
Binary files /tmp/dhAaOXb and 
new/usr/src/lib/libshell/misc/images/tag_ksh93.png differ
Binary files /tmp/d0fa41b and new/usr/src/lib/libshell/misc/images/tag_l10n.png 
differ
Binary files /tmp/dLXai6b and new/usr/src/lib/libshell/misc/images/tag_perf.png 
differ
--- /dev/null   Fri Sep 25 06:42:39 2009
+++ new/usr/src/lib/libshell/misc/shell_styleguide.docbook      Fri Sep 25 
06:42:37 2009
@@ -0,0 +1,1464 @@
+<?xml version="1.0"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V5.0//EN" 
"http://www.oasis-open.org/docbook/xml/5.0b5/dtd/docbook.dtd"; [
+    <!ENTITY tag_bourneonly   '<inlinemediaobject><imageobject><imagedata 
fileref="images/tag_bourne.png"></imagedata></imageobject><textobject><phrase>[Bourne]</phrase></textobject></inlinemediaobject>
 '>
+    <!ENTITY tag_kshonly      '<inlinemediaobject><imageobject><imagedata 
fileref="images/tag_ksh.png"></imagedata></imageobject><textobject><phrase>[ksh]</phrase></textobject></inlinemediaobject>
 '>
+    <!ENTITY tag_ksh88only    '<inlinemediaobject><imageobject><imagedata 
fileref="images/tag_ksh88.png"></imagedata></imageobject><textobject><phrase>[ksh88]</phrase></textobject></inlinemediaobject>
 '>
+    <!ENTITY tag_ksh93only    '<inlinemediaobject><imageobject><imagedata 
fileref="images/tag_ksh93.png"></imagedata></imageobject><textobject><phrase>[ksh93]</phrase></textobject></inlinemediaobject>
 '>
+    <!ENTITY tag_performance  '<inlinemediaobject><imageobject><imagedata 
fileref="images/tag_perf.png"></imagedata></imageobject><textobject><phrase>[perf]</phrase></textobject></inlinemediaobject>
 '>
+    <!ENTITY tag_i18n         '<inlinemediaobject><imageobject><imagedata 
fileref="images/tag_i18n.png"></imagedata></imageobject><textobject><phrase>[i18n]</phrase></textobject></inlinemediaobject>
 '>
+    <!ENTITY tag_l10n         '<inlinemediaobject><imageobject><imagedata 
fileref="images/tag_l10n.png"></imagedata></imageobject><textobject><phrase>[l10n]</phrase></textobject></inlinemediaobject>
 '>
+]>
+<!--
+
+ CDDL HEADER START
+
+ The contents of this file are subject to the terms of the
+ Common Development and Distribution License (the "License").
+ You may not use this file except in compliance with the License.
+
+ You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ or http://www.opensolaris.org/os/licensing.
+ See the License for the specific language governing permissions
+ and limitations under the License.
+
+ When distributing Covered Code, include this CDDL HEADER in each
+ file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ If applicable, add the following below this CDDL HEADER, with the
+ fields enclosed by brackets "[]" replaced with your own identifying
+ information: Portions Copyright [yyyy] [name of copyright owner]
+
+ CDDL HEADER END
+
+-->
+
+<!--
+
+ Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+ Use is subject to license terms.
+
+-->
+
+<!-- tag images were created like this:
+$ (text="perf" ;
+   pbmtext -nomargins -lspace 0 -builtin fixed "${text}" |
+       pbmtopgm 1 1 |
+       pgmtoppm 1.0,1.0,1.0-0,0,0 /dev/stdin |
+       ppmtogif |
+       giftopnm |
+       pnmtopng >"tag_${text}.png")
+-->
+
+<!-- compile with:
+xsltproc &minus;&minus;stringparam generate.section.toc.level 0 \
+         &minus;&minus;stringparam toc.max.depth 3 \
+         &minus;&minus;stringparam toc.section.depth 12 \
+         &minus;&minus;xinclude -o opensolaris_shell_styleguide.html 
/usr/share/sgml/docbook/docbook-xsl-stylesheets-1.69.1/html/docbook.xsl 
opensolaris_shell_styleguide.docbook
+-->
+
+<article
+    xmlns:xlink="http://www.w3.org/1999/xlink";
+    xmlns="http://docbook.org/ns/docbook";
+    xml:lang="en">
+    <!-- xmlns:xi="http://www.w3.org/2001/XInclude"; -->
+
+  <info>
+    <title><emphasis>[DRAFT]</emphasis> Bourne/Korn Shell Coding 
Conventions</title>
+
+    <!-- subtitle abuse -->
+    <subtitle>
+      This page is currently work-in-progress until it is approved by the 
OS/Net community. Please send any comments to
+      <email>shell-discuss at opensolaris.org</email>.
+    </subtitle>
+
+
+    <authorgroup>
+<!--
+        <author><personname>David G. Korn</personname><email>dgk at 
research.att.com</email></author>
+        <author><personname>Roland Mainz</personname><email>roland.mainz at 
nrubsig.org</email></author>
+        <author><personname>Mike Shapiro</personname><email>mike.shapiro at 
sun.com</email></author>
+-->
+        <author><orgname>OpenSolaris.org</orgname></author>
+    </authorgroup>
+  </info>
+
+<section xml:id="intro">
+  <title>Intro</title>
+  <para>This document describes the shell coding style used for all the SMF 
script changes integrated into (Open)Solaris.</para>
+  <para>All new SMF shell code should conform to this coding standard, which 
is intended to match our existing C coding standard.</para>
+  <para>When in doubt, think "what would be the C-Style equivalent ?" and 
"What does the POSIX (shell) standard say ?"</para>   
+</section><!-- end of intro -->
+
+
+<section xml:id="rules">
+  <title>Rules</title>
+  
+  
+  
+  <section xml:id="general">
+  <title>General</title>
+
+      <section xml:id="basic_format">
+          <title>Basic Format</title>
+          <para>Similar to <literal>cstyle</literal>, the basic format is that 
all
+          lines are indented by TABs or eight spaces, and continuation lines 
(which
+          in the shell end with "\") are indented by an equivalent number of 
TABs
+          and then an additional four spaces, e.g.
+<programlisting>
+cp foo bar
+cp some_realllllllllllllllly_realllllllllllllly_long_path \
+   to_another_really_long_path
+</programlisting>
+          </para>
+          <para>The encoding used for the shell scripts is either 
<literal>ASCII</literal>
+          or <literal>UTF-8</literal>, alternative encodings are only allowed 
when the
+          application requires this.</para>
+      </section>
+
+
+      <section xml:id="commenting">
+          <title>Commenting</title>
+          <para>Shell comments are preceded by the '<literal>#</literal>' 
character. Place
+          single-line comments in the right-hand margin. Use an extra 
'<literal>#</literal>'
+          above and below the comment in the case of multi-line comments:
+<programlisting>
+cp foo bar             # Copy foo to bar
+
+#
+# Modify the permissions on bar.  We need to set them to root/sys
+# in order to match the package prototype.
+#
+chown root bar
+chgrp sys bar
+</programlisting>
+          </para>
+      </section>
+
+
+      <section xml:id="interpreter_magic">
+          <title>Interpreter magic</title>
+          <para>The proper interpreter magic for your shell script should be 
one of these:
+<programlisting>
+#!/bin/sh        Standard Bourne shell script
+#!/bin/ksh -p    Standard Korn shell 88 script.  You should always write ksh
+                 scripts with -p so that ${ENV} (if set by the user) is not
+                 sourced into your script by the shell.
+#!/bin/ksh93     Standard Korn shell 93 script (-p is not needed since ${ENV} 
is
+                 only used for interactive shell sessions).
+</programlisting>
+          </para>
+      </section>
+
+
+      <section xml:id="harden_your_script_against_unexpected_input">
+          <title>Harden the script against unexpected (user) input</title>
+          <para>Harden your script against unexpected (user) input, including
+          command line options, filenames with blanks (or other special
+          characters) in the name, or file input</para>
+      </section>
+
+
+      <section xml:id="use_builtin_commands">
+          <title>&tag_kshonly;&tag_performance;Use builtin commands if the 
shell provides them</title>
+          <para>
+          Use builtin commands if the shell provides them. For example ksh93s+
+          (ksh93, version 's+') delivered with Solaris (as defined by PSARC 
2006/550)
+          supports the following builtins:
+          <simplelist type="inline">
+          <member>basename</member>
+          <member>cat</member>
+          <member>chgrp</member>
+          <member>chmod</member>
+          <member>chown</member>
+          <member>cmp</member>
+          <member>comm</member>
+          <member>cp</member>
+          <member>cut</member>
+          <member>date</member>
+          <member>dirname</member>
+          <member>expr</member>
+          <member>fds</member>
+          <member>fmt</member>
+          <member>fold</member>
+          <member>getconf</member>
+          <member>head</member>
+          <member>id</member>
+          <member>join</member>
+          <member>ln</member>
+          <member>logname</member>
+          <member>mkdir</member>
+          <member>mkfifo</member>
+          <member>mv</member>
+          <member>paste</member>
+          <member>pathchk</member>
+          <member>rev</member>
+          <member>rm</member>
+          <member>rmdir</member>
+          <member>stty</member>
+          <member>tail</member>
+          <member>tee</member>
+          <member>tty</member>
+          <member>uname</member>
+          <member>uniq</member>
+          <member>wc</member>
+          <member>sync</member>
+          </simplelist>
+          Those builtins can be enabled via <literal>$ builtin name_of_builtin 
#</literal> in shell
+          scripts (note that ksh93 builtins implement exact POSIX behaviour - 
some
+          commands in Solaris <filename>/usr/bin/</filename> directory 
implement pre-POSIX behaviour.
+          Add <literal>/usr/xpg6/bin/:/usr/xpg4/bin</literal> before
+          <filename>/usr/bin/</filename> in <envar>${PATH}</envar> to test 
whether your script works with
+          the XPG6/POSIX versions)
+          </para>
+      </section>
+
+
+      <section xml:id="use_blocks_not_subshells">
+          <title>&tag_performance;Use blocks and not subshells if 
possible</title>
+          <para>Use blocks and not subshells if possible, e.g. use
+          <literal>$ { print "foo" ; print "bar" ; }</literal> instead of
+          <literal>$ (print "foo" ; print "bar") #</literal> - blocks are
+          faster since they do not require to save the subshell context 
(ksh93) or
+          trigger a shell child process (Bourne shell, bash, ksh88 etc.)
+          </para>
+      </section>
+
+
+      <section xml:id="use_long_options_for_set_builtin">
+           <title>&tag_kshonly; use long options for 
"<literal>set</literal>"</title>
+           <para>use long options for "<literal>set</literal>", for example 
instead of <literal>$ set -x #</literal>
+           use <literal>$ set -o xtrace #</literal> to make the code more 
readable.</para>
+      </section>
+
+
+      <section xml:id="use_posix_command_substitutions_syntax">
+          <title>&tag_kshonly; Use <literal>$(...)</literal> instead of 
<literal>`...`</literal> command substitutions</title>
+          <para>Use <literal>$(...)</literal> instead of 
<literal>`...`</literal> - <literal>`...`</literal>
+          is an obsolete construct in ksh+POSIX sh scripts and 
<literal>$(...)</literal>.is a cleaner design,
+          requires no escaping rules, allows easy nesting etc.</para>
+
+          <note><title>&tag_ksh93only; <literal>${ ...;}</literal>-style 
command substitutions</title>
+          <para>ksh93 has support for an alternative version of command 
substitutions with the
+          syntax <literal>${ ...;}</literal> which do not run in a subshell.
+          </para></note>
+      </section>
+
+
+      <section xml:id="put_command_substitution_result_in_quotes">
+          <title>&tag_kshonly; Always put the result of a 
<literal>$(...)</literal> or
+          <literal>$( ...;)</literal> command substitution in quotes</title>
+          <para>Always put the result of <literal>$( ... )</literal> or 
<literal>$( ...;)</literal> in
+          quotes (e.g. <literal>foo="$( ... )"</literal> or <literal>foo="$( 
...;)"</literal>) unless
+          there is a very good reason for not doing it</para>
+      </section>
+
+
+      <section xml:id="always_set_path">
+          <title>Scripts should always set their <envar>PATH</envar></title>
+          <para>Scripts should always set their <envar>PATH</envar> to make 
sure they do not use
+          alternative commands by accident (unless the value of 
<envar>PATH</envar> is well-known
+          and guaranteed to be set by the caller)</para>
+      </section>
+
+
+      <section xml:id="make_sure_commands_are_available">
+          <title>Make sure that commands from other packages/applications are 
really installed on the machine</title>
+          <para>Scripts should make sure that commands in optional packages 
are really
+          there, e.g. add a "precheck" block in scipts to avoid later failure 
when
+          doing the main job</para>
+      </section>
+
+
+      <section xml:id="check_usage_of_boolean_variables">
+          <title>Check how boolean values are used/implemented in your 
application</title>
+          <para>Check how boolean values are used in your application.</para>
+          <para>For example:
+<programlisting>
+mybool=0
+# do something
+if [ $mybool -eq 1 ] ; then do_something_1 ; fi
+</programlisting>
+could be rewritten like this:
+<programlisting>
+mybool=false # (valid values are "true" or "false", pointing
+# to the builtin equivalents of /bin/true or /bin/false)
+# do something
+if ${mybool} ; then do_something_1 ; fi
+</programlisting>
+or
+<programlisting>
+integer mybool=0 # values are 0 or 1
+# do something
+if (( mybool==1 )) ; then do_something_1 ; fi
+</programlisting>
+          </para>
+      </section>
+
+      <section xml:id="shell_uses_characters_not_bytes">
+          <title>&tag_i18n;The shell always operates on 
<emphasis>characters</emphasis> not bytes</title>
+          <para>Shell scripts operate on characters and 
<emphasis>not</emphasis> bytes.
+          Some locales use multiple bytes (called "multibyte locales") to 
represent one character</para>
+
+          <note><para>ksh93 has support for binary variables which explicitly
+          operate on bytes, not characters. This is the 
<emphasis>only</emphasis> allowed
+          exception.</para></note>
+      </section>
+
+
+      <section xml:id="multibyte_locale_input">
+          <title>&tag_i18n;Multibyte locales and input</title>
+          <para>Think about whether your application has to handle file names 
or
+          variables in multibyte locales and make sure all commands used in 
your
+          script can handle such characters (e.g. lots of commands in Solaris's
+          <filename>/usr/bin/</filename> are <emphasis>not</emphasis> able to 
handle such values - either use ksh93
+          builtin constructs (which are guaranteed to be multibyte-aware) or
+          commands from <filename>/usr/xpg4/bin/</filename> and/or 
<filename>/usr/xpg6/bin</filename>)
+          </para>
+      </section>
+
+
+      <section xml:id="use_external_filters_only_for_large_datasets">
+          <title>&tag_performance;Only use external filters like 
<literal>grep</literal>/<literal>sed</literal>/<literal>awk</literal>/etc.
+          if you want to process lots of data with them</title>
+          <para>Only use external filters like 
<literal>grep</literal>/<literal>sed</literal>/<literal>awk</literal>/etc.
+          if a significant amount of data is processed by the filter or if
+          benchmarking shows that the use of builtin commands is significantly 
slower
+          (otherwise the time and resources needed to start the filter are
+          far greater then the amount of data being processed,
+          creating a performance problem).</para>
+          <para>For example:
+<programlisting>
+if [ "$(echo "$x" | egrep '.*foo.*')" != "" ] ; then
+    do_something ;
+done
+</programlisting>
+can be re-written using ksh93 builtin constructs, saving several
+<literal>|fork()|+|exec()|</literal>'s:
+<programlisting>
+if [[ "${x}" == ~(E).*foo.* ]] ; then
+    do_something ;
+done
+</programlisting>
+          </para>
+      </section>
+
+
+      <section xml:id="use_dashdash_if_first_arg_is_variable">
+          <title>If the first operand of a command is a variable, use 
<literal>--</literal></title>
+          <para>If the first operand of a command is a variable, use 
<literal>--</literal>
+          for any command that accepts this as end of argument to
+          avoid problems if the variable expands to a value starting with 
<literal>-</literal>.
+          </para>
+          <note><para>
+          At least
+          <simplelist type="inline">
+              <member>print</member>
+              
<member>/usr/bin/fgrep</member><member>/usr/xpg4/bin/fgrep</member>
+              <member>/usr/bin/grep</member> 
<member>/usr/xpg4/bin/grep</member>
+              
<member>/usr/bin/egrep</member><member>/usr/xpg4/bin/egrep</member>
+          </simplelist>
+          support <literal>--</literal> as "end of arguments"-terminator.
+          </para></note>
+      </section>
+
+      <section xml:id="use_export">
+          <title>&tag_kshonly;&tag_performance;Use <literal>$ export 
FOOBAR=val #</literal> instead of
+          <literal>$ FOOBAR=val ; export FOOBAR #</literal></title>
+          <para>Use <literal>$ export FOOBAR=val # instead of $ FOOBAR=val ; 
export FOOBAR #</literal> -
+          this is much faster.</para>
+      </section>
+
+
+      <section xml:id="use_subshell_around_set_dashdash_usage">
+          <title>Use a subshell (e.g. <literal>$ ( mycmd ) #</literal>) around 
places which use
+              <literal>set -- $(mycmd)</literal> and/or 
<literal>shift</literal></title>
+          <para>Use a subshell (e.g. <literal>$ ( mycmd ) #</literal>) around 
places which use
+          <literal>set -- $(mycmd)</literal> and/or <literal>shift</literal> 
unless the variable
+          affected is either a local one or if it's guaranteed that this 
variable will no longer be used
+          (be careful for loadable functions, e.g. ksh/ksh93's 
<literal>autoload</literal> !!!!)
+          </para>
+      </section>
+
+
+      <section xml:id="be_careful_with_tabs_in_script_code">
+          <title>Be careful with using TABS in script code, they are not 
portable
+          between editors or platforms</title>
+          <para>Be careful with using TABS in script code, they are not 
portable
+          between editors or platforms.</para>
+          <para>If you use ksh93 use <literal>$'\t'</literal> to include TABs 
in sources, not the TAB character itself.</para>
+      </section>
+
+
+      <section xml:id="centralise_error_exit">
+           <title>If you have multiple points where your application exits 
with an error
+           message create a central function for this purpose</title>
+           <para>If you have multiple points where your application exits with 
an error
+           message create a central function for this, e.g.
+<programlisting>
+if [ -z "$tmpdir" ] ; then
+        print -u2 "mktemp failed to produce output; aborting."
+        exit 1
+fi
+if [ ! -d $tmpdir ] ; then
+        print -u2 "mktemp failed to create a directory; aborting."
+        exit 1
+fi
+</programlisting>
+should be replaced with
+<programlisting>
+function fatal_error
+{
+    print -u2 "${progname}: $*"
+    exit 1
+}
+# do something (and save ARGV[0] to variable "progname")
+if [ -z "$tmpdir" ] ; then
+        fatal_error "mktemp failed to produce output; aborting."
+fi
+if [ ! -d "$tmpdir" ] ; then
+        fatal_error "mktemp failed to create a directory; aborting."
+fi
+</programlisting>
+          </para>
+      </section>
+
+
+      <section xml:id="use_set_o_nounset">
+          <title>&tag_kshonly; Think about using <literal>$ set -o nounset 
#</literal> by default</title>
+          <para>Think about using <literal>$ set -o nounset #</literal> by 
default (or at least during the
+    script's development phase) to catch errors where variables are used
+    when they are not set (yet), e.g.
+<screen>
+$ <userinput>(set -o nounset ; print ${foonotset})</userinput>
+<computeroutput>/bin/ksh93: foonotset: parameter not set</computeroutput>
+</screen>
+           </para>
+      </section>
+
+
+      <section xml:id="avoid_eval_builtin">
+          <title>Avoid using <literal>eval</literal> unless absolutely 
necessary</title>
+          <para>Avoid using <literal>eval</literal> unless absolutely 
necessary.  Subtle things
+          can happen when a string is passed back through the shell
+          parser.  You can use name references to avoid uses such as
+          <literal>eval $name="$value"</literal>.
+          </para>
+      </section>
+
+
+      <section xml:id="use_concatenation_operator">
+          <title>&tag_ksh93only;Use the string/array concatenation operator 
<literal>+=</literal></title>
+          <para>Use <literal>+=</literal> instead of manually adding 
strings/array elements, e.g.
+<programlisting>
+foo=""
+foo="${foo}a"
+foo="${foo}b"
+foo="${foo}c"
+</programlisting>
+should be replaced with
+<programlisting>
+foo=""
+foo+="a"
+foo+="b"
+foo+="c"
+</programlisting>
+          </para>
+      </section>
+ 
+      <section xml:id="use_source_not_dot">
+          <title>&tag_ksh93only;Use <literal>source</literal> instead of 
'<literal>.</literal> '(dot)
+          to include other shell script fragments</title>
+          <para>Use <literal>source</literal> instead of '<literal>.</literal>'
+          (dot) to include other shell script fragments - the new form is much
+          more readable than the tiny dot and a failure can be caught within 
the script.</para>
+      </section>
+
+
+      <section xml:id="use_builtin_localisation_support">
+          <title>&tag_ksh93only;&tag_performance;&tag_l10n;Use 
<literal>$"..."</literal> instead of
+          <literal>gettext ... "..."</literal> for strings that need to be 
localized for different locales</title>
+          <para>Use $"..." instead of <literal>gettext ... "..."</literal> for 
strings that need to be
+          localized for different locales. <literal>gettext</literal> will 
require a
+          <literal>fork()+exec()</literal> and
+          reads the whole catalog each time it's called, creating a huge 
overhead for localisation
+          (and the  <literal>$"..."</literal> is easier to use, e.g. you only 
have to put a
+          <literal>$</literal> in front of the catalog and the string will be 
localised).
+          </para>
+      </section>
+
+
+      <section xml:id="use_set_o_noglob">
+          <title>&tag_kshonly;&tag_performance;Use <literal>set -o 
noglob</literal> if you do not need to expand files</title>
+          <para>If you don't expect to expand files, you can do set 
<literal>-f</literal>
+          (<literal>set -o noglob</literal>) as well.  This way the need to 
use <literal>""</literal> is
+          greatly reduced.</para>
+      </section>
+
+
+      <section xml:id="use_empty_ifs_to_handle_spaces">
+          <title>&tag_ksh93only;Use <literal>IFS=</literal> to avoid problems 
with spaces in filenames</title>
+          <para>Unless you want to do word splitting, put 
<literal>IFS=</literal>
+          at the beginning of a command.  This way spaces in
+          file names won't be a problem.  You can do
+          <literal>IFS='delims' read -r</literal> line
+          to override <envar>IFS</envar> just for the <literal>read</literal> 
command.  However,
+          you can't do this for the <literal>set</literal> builtin.</para>
+      </section>
+
+
+      <section xml:id="set_locale_when_comparing_against_localised_output">
+          <title>Set the message locale if you process output of tools which 
may be localised</title>
+          <para>Set the message locale (<envar>LC_MESSAGES</envar>) if you 
process output of tools which may be localised</para>
+          <example><title>Set <envar>LC_MESSAGES</envar> when testing for 
specific outout of the <filename>/usr/bin/file</filename> utility:</title>
+<programlisting>
+# set french as default message locale
+export LC_MESSAGES=fr_FR.UTF-8
+
+...
+
+# test whether the file "/tmp" has the filetype "directory" or not
+# we set LC_MESSAGES to "C" to ensure the returned message is in english
+if [[ "$(LC_MESSAGES=C file /tmp)" = *directory ]] ; then
+    print "is a directory"
+fi
+</programlisting>
+          <note><para>The environment variable <envar>LC_ALL</envar> always
+          overrides any other <envar>LC_*</envar> environment variables
+          (and <envar>LANG</envar>, too),
+          including <envar>LC_MESSAGES</envar>.
+          if there is the chance that <envar>LC_ALL</envar> may be set
+          replace <envar>LC_MESSAGES</envar> with <envar>LC_ALL</envar>
+          in the example above.</para></note>
+          </example>
+      </section>
+      
+      <section xml:id="cleanup_after_yourself">
+          <title>Cleanup after yourself.</title>
+          <para>Cleanup after yourself. For example ksh/ksh93 have an 
<literal>EXIT</literal> trap which
+          is very useful for this.
+          </para>
+          <note><para>
+          Note that the <literal>EXIT</literal> trap is executed for a 
subshell and each subshell
+          level can run it's own <literal>EXIT</literal> trap, for example
+<screen>
+$ <userinput>(trap "print bam" EXIT ; (trap "print snap" EXIT ; print 
"foo"))</userinput>
+<computeroutput>foo
+snap
+bam</computeroutput>
+</screen>
+          </para></note>
+      </section>
+
+      <section xml:id="use_proper_exit_code">
+          <title>Use a proper <literal>exit</literal> code</title>
+          <para>Explicitly set the exit code of a script, otherwise the exit 
code
+          from the last command executed will be used which may trigger 
problems
+          if the value is unexpected.</para>
+      </section>
+
+
+      <section xml:id="shell_lint">
+          <title>&tag_ksh93only;Use <literal>shcomp -n scriptname.sh 
/dev/null</literal> to check for common errors</title>
+          <para>Use <literal>shcomp -n scriptname.sh /dev/null</literal> to
+          check for common problems (such as insecure, depreciated or 
ambiguous constructs) in shell scripts.</para>
+      </section>
+  </section><!-- end of general -->
+
+
+
+
+
+  <section xml:id="functions">
+      <title>Functions</title>
+
+      <section xml:id="use_functions">
+          <title>Use functions to break up your code</title>
+          <para>Use functions to break up your code into smaller, logical 
blocks.</para>
+      </section>
+
+      <section xml:id="do_not_reserved_keywords_for_function_names">
+          <title>Do not use function names which are reserved keywords in 
C/C++/JAVA or the POSIX shell standard</title>
+          <para>Do not use function names which are reserved keywords (or 
function names) in C/C++/JAVA or the POSIX shell standard
+          (to avoid confusion and/or future changes/updates to the shell 
language).
+          </para>
+      </section> 
+      
+      <section xml:id="use_ksh_style_function_syntax">
+          <title>&tag_kshonly;&tag_performance;Use ksh-style 
<literal>function</literal></title>
+          <para>It is <emphasis>highly</emphasis> recommended to use ksh style 
functions
+          (<literal>function foo { ... }</literal>) instead
+          of Bourne-style functions (<literal>foo() { ... }</literal>) if 
possible
+          (and local variables instead of spamming the global 
namespace).</para>
+
+          <warning><para>
+          The difference between old-style Bourne functions and ksh functions 
is one of the major differences
+          between ksh88 and ksh93 - ksh88 allowed variables to be local for 
Bourne-style functions while ksh93
+          conforms to the POSIX standard and will use a function-local scope 
for variables declared in
+          Bourne-style functions.</para>
+          <para>Example (note that "<literal>integer</literal>" is an alias 
for "<literal>typeset -li</literal>"):
+<programlisting>
+# new style function with local variable
+$ ksh93 -c 'integer x=2 ; function foo { integer x=5 ; } ; print "x=$x"
+; foo ; print "x=$x" ;'
+x=2
+x=2
+# old style function with an attempt to create a local variable
+$ ksh93 -c 'integer x=2 ; foo() { integer x=5 ; } ; print "x=$x" ; foo ;
+print "x=$x" ;'       
+x=2
+x=5
+</programlisting>
+
+          <uri 
xlink:href="http://www.opensolaris.org/os/project/ksh93-integration/docs/ksh93r/general/compatibility/";>usr/src/lib/libshell/common/COMPATIBILITY</uri>
+          says about this issue:
+<blockquote><para>
+Functions, defined with name() with ksh-93 are compatible with
+the POSIX standard, not with ksh-88.  No local variables are
+permitted, and there is no separate scope.  Functions defined
+with the function name syntax, maintain compatibility.
+This also affects function traces.
+</para></blockquote>
+(this issue also affects <filename>/usr/xpg4/bin/sh</filename> in Solaris 10 
because it is based on ksh88. This is a bug.).          
+          </para></warning>
+
+      </section>
+
+
+      <section xml:id="use_proper_return_code">
+          <title>Use a proper <literal>return</literal> code</title>
+          <para>Explicitly set the return code of a function - otherwise the 
exit code
+          from the last command executed will be used which may trigger 
problems
+          if the value is unexpected.</para>
+          <para>The only allowed exception is if a function uses the shell's 
<literal>errexit</literal> mode to leave
+          a function, subshell or the script if a command returns a non-zero 
exit code.
+          </para>
+      </section>
+
+      <section xml:id="use_fpath_to_load_common_code">
+          <title>&tag_kshonly;Use <envar>FPATH</envar> to load common 
functions, not <literal>source</literal></title>
+          <para>
+          Use the ksh <envar>FPATH</envar> (function path) feature to load 
functions which are shared between scripts
+          and not <literal>source</literal> - this allows to load such a 
function on demand and not all at once.</para>
+      </section>
+ 
+  </section><!-- end of functions -->
+
+
+
+
+  <section xml:id="if_for_while">
+      <title><literal>if</literal>, <literal>for</literal> and 
<literal>while</literal></title>
+
+      <section xml:id="if_for_while_format">
+          <title>Format</title>
+          <para>To match <literal>cstyle</literal>, the shell token equivalent 
to the <literal>C</literal>
+          "<literal>{</literal>" should appear on the same line, separated by a
+          "<literal>;</literal>", as in:
+<programlisting>
+if [ "$x" = "hello" ] ; then
+    echo $x
+fi
+
+if [[ "$x" = "hello" ]] ; then
+    print $x
+fi
+
+for i in 1 2 3; do
+    echo $i
+done
+
+for ((i=0 ; i &lt; 3 ; i++)); do
+    print $i
+done
+
+while [ $# -gt 0 ]; do
+    echo $1
+    shift
+done
+
+while (( $# &gt; 0 )); do
+  print $1
+  shift
+done
+</programlisting>
+          </para>
+      </section>
+
+
+      <section xml:id="test_builtin">
+          <title><literal>test</literal> Builtin</title>
+          <para>DO NOT use the test builtin. Sorry, executive decision.</para>
+          <para>In our Bourne shell, the <literal>test</literal> built-in is 
the same as the "["
+          builtin (if you don't believe me, try "type test" or refer to 
<filename>usr/src/cmd/sh/msg.c</filename>).</para>
+          <para>
+          So please do not write:
+<programlisting>
+if test $# -gt 0 ; then
+</programlisting>         
+instead use:
+<programlisting>
+if [ $# -gt 0 ] ; then
+</programlisting>
+          </para>
+      </section>
+
+
+      <section xml:id="use_ksh_test_syntax">
+           <title>&tag_kshonly;&tag_performance;Use "<literal>[[ expr 
]]</literal>" instead of "<literal>[ expr ]</literal>"</title>
+           <para>Use "<literal>[[ expr ]]</literal>" instead of "<literal>[ 
expr ]</literal>" if possible
+           since it avoids going through the whole pattern expansion/etc. 
machinery and
+           adds additional operators not available in the Bourne shell, such 
as short-circuit
+           <literal>&amp;&amp;</literal> and <literal>||</literal>.
+           </para>
+      </section>
+
+      
+      <section xml:id="use_posix_arithmetic_expressions">
+          <title>&tag_kshonly; Use "<literal>(( ... ))</literal>" for 
arithmetic expressions</title>
+          <para>Use "<literal>(( ... ))</literal>" instead of "<literal>[ expr 
]</literal>"
+          or "<literal>[[ expr ]]</literal>" expressions.
+          </para>
+          <para>
+          Example: Replace
+<programlisting>
+i=5
+# do something
+if [ $i -gt 5 ] ; then
+</programlisting>
+with
+<programlisting>
+i=5
+# do something
+if (( i &gt; 5 )) ; then
+</programlisting>
+          </para>
+      </section>
+
+
+      <section xml:id="compare_exit_code_using_math">
+          <title>&tag_kshonly;&tag_performance;Compare exit code using 
arithmetic expressions expressions</title>
+          <para>Use POSIX arithmetic expressions to test for exit/return codes 
of commands and functions.
+          For example turn
+<programlisting>
+if [ $? -gt 0 ] ; then
+</programlisting>
+into
+<programlisting>
+if (( $? &gt; 0 )) ; then
+</programlisting>
+         </para>
+      </section>
+      
+
+      <section xml:id="use_builtin_commands_in_loops">
+         <title>&tag_bourneonly; Use builtin commands in conditions for 
<literal>while</literal> endless loops</title>
+         <para>Make sure that your shell has a "<literal>true</literal>" 
builtin (like ksh93) when
+         executing endless loops like <literal>$ while true ; do do_something 
; done #</literal> -
+         otherwise each loop cycle runs a 
<literal>|fork()|+|exec()|</literal>-cycle to run
+         <filename>/bin/true</filename>
+         </para>
+      </section>
+
+
+      <section xml:id="single_line_if_statements">
+         <title>Single-line if-statements</title>
+         <para>It is permissible to use <literal>&amp;&amp;</literal> and 
<literal>||</literal> to construct
+         shorthand for an "<literal>if</literal>" statement in the case where 
the if statement has a
+         single consequent line:
+<programlisting>
+[ $# -eq 0 ] &amp;&amp; exit 0
+</programlisting>
+instead of the longer:
+<programlisting>
+if [ $# -eq 0 ]; then
+  exit 0
+fi
+</programlisting>
+         </para>
+      </section>
+
+
+      <section xml:id="exit_status_and_if_for_while">
+         <title>Exit Status and <literal>if</literal>/<literal>while</literal> 
statements</title>
+         <para>Recall that "<literal>if</literal>" and 
"<literal>while</literal>"
+         operate on the exit status of the statement
+         to be executed. In the shell, zero (0) means true and non-zero means 
false.
+         The exit status of the last command which was executed is available 
in the $?
+         variable. When using "<literal>if</literal>" and 
"<literal>while</literal>",
+         it is typically not necessary to use
+         <literal>$?</literal> explicitly, as in:
+<programlisting>
+grep foo /etc/passwd &gt;/dev/null 2>&amp;1
+if [ $? -eq 0 ]; then
+  echo "found"
+fi
+</programlisting>
+Instead, you can more concisely write:
+<programlisting>
+if grep foo /etc/passwd &gt;/dev/null 2>&amp;1; then
+  echo "found"
+fi
+</programlisting>
+Or, when appropriate:
+<programlisting>
+grep foo /etc/passwd &gt;/dev/null 2>&amp;1 &amp;&amp; echo "found"
+</programlisting>
+         </para>
+      </section>
+
+  </section><!-- end of if/for/while -->
+
+
+
+
+
+
+  <section xml:id="variables">
+  <title>Variable types, naming and usage</title>
+
+      <section xml:id="names_should_be_lowercase">
+          <title>Names of local, non-environment, non-constant variables 
should be lowercase</title>
+          <para>Names of variables local to the current script which are not 
exported to the environment
+          should be lowercase while variable names which are exported to the
+          environment should be uppercase.</para>
+          <para>The only exception are global constants (=global readonly 
variables,
+          e.g. <literal>$ float -r M_PI=3.14159265358979323846 #</literal> 
(taken from &lt;math.h&gt;))
+          which may be allowed to use uppercase names, too.
+          </para>
+
+          <warning><para>
+              Uppercase variable names should be avoided because there is a 
good chance
+              of naming collisions with either special variable names used by 
the shell
+              (e.g.  <literal>PWD</literal>, <literal>SECONDS</literal> etc.).
+          </para></warning>
+      </section>
+
+      <section xml:id="do_not_reserved_keywords_for_variable_names">
+          <title>Do not use variable names which are reserved 
keywords/variable names in C/C++/JAVA or the POSIX shell standard</title>
+          <para>Do not use variable names which are reserved keywords in 
C/C++/JAVA or the POSIX shell standard
+          (to avoid confusion and/or future changes/updates to the shell 
language).
+          </para>
+          <note>
+            <para>The Korn Shell and the POSIX shell standard have many more
+            reserved variable names than the original Bourne shell. All
+            these reserved variable names are spelled uppercase.           
+            </para>
+          </note>
+      </section> 
+           
+      <section xml:id="use_brackets_around_long_names">
+          <title>Always use <literal>'{'</literal>+<literal>'}'</literal> when 
using variable
+          names longer than one character</title>
+          <para>Always use <literal>'{'</literal>+<literal>'}'</literal> when 
using
+          variable names longer than one character unless a simple variable 
name is
+          followed by a blank, <literal>/</literal>, <literal>;</literal>, or 
<literal>$</literal>
+          character (to avoid problems with array,
+          compound variables or accidental misinterpretation by users/shell)
+<programlisting>
+print "$foo=info"
+</programlisting>
+should be rewritten to
+<programlisting>
+print "${foo}=info"
+</programlisting>
+          </para>
+      </section>
+
+
+      <section xml:id="quote_variables_containing_filenames_or_userinput">
+          <title><emphasis>Always</emphasis> put variables into quotes when 
handling filenames or user input</title>
+          <para><emphasis>Always</emphasis> put variables into quotes when 
handling filenames or user input, even if
+          the values are hardcoded or the values appear to be fixed. Otherwise 
at
+          least two things may go wrong:
+          <itemizedlist>
+          <listitem><para>a malicious user may be able to exploit a script's 
inner working to
+          infect his/her own code</para></listitem>
+          <listitem><para>a script may (fatally) misbehave for unexpected 
input (e.g. file names
+          with blanks and/or special symbols which are interpreted by the 
shell)</para></listitem>
+          </itemizedlist>
+          </para>
+
+          <note><para>
+          As alternative a script may set <literal>IFS='' ; set -o 
noglob</literal> to turn off the
+          interpretation of any field seperators and the pattern globbing.
+          </para></note>
+      </section>
+
+   
+   
+      <section xml:id="use_typed_variables">
+          <title>&tag_kshonly;&tag_performance;Use typed variables if 
possible.</title>
+          <para>For example the following is very
+          inefficient since it transforms the integer values to strings and 
back
+          several times:
+<programlisting>
+a=0
+b=1
+c=2
+# more code
+if [ $a -lt 5 -o $b -gt c ] ; then do_something ; fi
+</programlisting>
+This could be rewritten using ksh constructs:
+<programlisting>
+integer a=0
+integer b=1
+integer c=2
+# more code
+if (( a &lt; 5 || b &gt; c )) ; then do_something ; fi
+</programlisting>
+          </para>
+      </section>
+
+
+      <section xml:id="store_lists_in_arrays">
+          <title>&tag_ksh93only; Store lists in arrays or associative 
arrays</title>
+          <para>Store lists in arrays or associative arrays - this is usually 
easier
+          to manage.</para>
+          <para>
+    For example:
+<programlisting>
+x="
+/etc/foo
+/etc/bar
+/etc/baz
+"
+echo $x
+</programlisting>
+can be replaced with
+<programlisting>
+typeset -a mylist
+mylist[0]="/etc/foo"
+mylist[1]="/etc/bar"
+mylist[2]="/etc/baz"
+print "${myli...@]}"
+</programlisting>
+or (ksh93-style append entries to a normal (non-associative) array)
+<programlisting>
+typeset -a mylist
+mylist+=( "/etc/foo" )
+mylist+=( "/etc/bar" )
+mylist+=( "/etc/baz" )
+print "${myli...@]}"
+</programlisting>
+          </para>
+          <note>
+              <title>Difference between expanding arrays with myli...@] and 
mylist[*] subscript operators</title>
+              <para>
+              Arrays may be expanded using two similar subscript operators, @ 
and *. These subscripts
+              differ only when the variable expansion appears within double 
quotes. If the variable expansion
+              is between double-quotes, "${mylist[*]}" expands to a single 
string with the value of each array
+              member separated by the first character of the 
<envar>IFS</envar> variable, and "${myli...@]}"
+              expands each element of name to a separate string.
+              </para>
+              <example><title>Difference between [...@] and [*] when expanding 
arrays</title>
+<programlisting>
+typeset -a mylist
+mylist+=( "/etc/foo" )
+mylist+=( "/etc/bar" )
+mylist+=( "/etc/baz" )
+IFS=","
+printf "mylist[*]={ 0=|%s| 1=|%s| 2=|%s| 3=|%s| }\n" "${mylist[*]}"
+printf "myli...@]={ 0=|%s| 1=|%s| 2=|%s| 3=|%s| }\n" "${myli...@]}"
+</programlisting>
+<para>will print:</para>
+<screen>
+<computeroutput>mylist[*]={ 0=|/etc/foo,/etc/bar,/etc/baz| 1=|| 2=|| 3=|| }
+myli...@]={ 0=|/etc/foo| 1=|/etc/bar| 2=|/etc/baz| 3=|| }
+</computeroutput>
+</screen>
+              </example>
+          </note>
+      </section>
+
+
+      <section xml:id="use_compound_variables_or_lists_for_grouping">
+          <title>&tag_ksh93only; Use compound variables or associative arrays 
to group similar variables together</title>
+          <para>Use compound variables or associative arrays to group similar 
variables together.</para>
+          <para>
+    For example:
+<programlisting>
+box_width=56
+box_height=10
+box_depth=19
+echo "${box_width} ${box_height} ${box_depth}"
+</programlisting>
+could be rewritten to ("associative array"-style)
+<programlisting>
+typeset -A -E box=( [width]=56 [height]=10 [depth]=19 )
+print -- "${box[width]} ${box[height]} ${box[depth]}"
+</programlisting>
+or ("compound variable"-style
+<programlisting>
+box=(
+    float width=56
+    float height=10
+    float depth=19
+    )
+print -- "${box.width} ${box.height} ${box.depth}"
+</programlisting>
+          </para>
+      </section>    
+  </section><!-- end of variables -->
+
+
+
+
+
+
+
+  <section xml:id="io">
+  <title>I/O</title>
+
+      <section xml:id="avoid_echo">
+          <title>Avoid using the "<literal>echo</literal>" command for 
output</title>
+          <para>The behaviour of "<literal>echo</literal>" is not portable
+          (e.g. System V, BSD, UCB and ksh93/bash shell builtin versions all
+          slightly differ in functionality) and should be avoided if possible.
+          POSIX defines the "<literal>printf</literal>" command as replacement
+          which provides more flexible and portable behaviour.</para>
+
+          <note>
+              <title>&tag_kshonly;Use "<literal>print</literal>" and not 
"<literal>echo</literal>" in Korn Shell scripts</title>
+              <para>Korn shell scripts should prefer the 
"<literal>print</literal>"
+              builtin which was introduced as replacement for 
"<literal>echo</literal>".</para>
+              <caution>
+                  <para>Use <literal>$ print -- ${varname}" #</literal> when 
there is the slightest chance that the
+                  variable "<literal>varname</literal>" may contain symbols 
like "-". Or better use "<literal>printf</literal>"
+                  instead, for example
+<programlisting>
+integer fx
+# do something
+print $fx
+</programlisting>
+may fail if "f" contains a negative value. A better way may be to use
+<programlisting>
+integer fx
+# do something
+printf "%d\n" fx
+</programlisting>
+                  </para>
+              </caution>
+          </note>
+      </section>
+      
+      <section xml:id="use_redirect_not_exec_to_open_files">
+          <title>&tag_ksh93only;Use <literal>redirect</literal> and not 
<literal>exec</literal> to open files</title>
+          <para>Use <literal>redirect</literal> and not 
<literal>exec</literal> to open files - <literal>exec</literal>
+          will terminate the current function or script if an error occurs 
while <literal>redirect</literal>
+          just returns a non-zero exit code which can be caught.</para>
+<para>Example:
+<programlisting>
+if redirect 5&lt;/etc/profile ; then
+    print "file open ok"
+    head &lt;&amp;5
+else
+    print "could not open file"
+fi
+</programlisting>
+           </para>
+      </section>
+      
+      <section xml:id="group_identical_redirections_together">
+          <title>&tag_performance;Avoid redirections per command when the 
output goes into the same file,
+          e.g. <literal>$ echo "foo" &gt;xxx ; echo "bar" &gt;&gt;xxx ; echo 
"baz" &gt;&gt;xxx #</literal></title>
+          <para>Each of the redirections above trigger an
+          <literal>|open()|,|write()|,|close()|</literal>-sequence. It is much
+          more efficient (and faster) to group the rediction into a block,
+          e.g. <literal>{ echo "foo" ; echo "bar" ; echo "baz" } &gt;xxx 
#</literal></para>
+      </section>
+
+
+      <section xml:id="avoid_using_temporary_files">
+          <title>&tag_performance;Avoid the creation of temporary files and 
store the values in variables instead</title>
+          <para>Avoid the creation of temporary files and store the values in 
variables instead if possible</para>
+          <para>
+    Example:
+<programlisting>
+ls -1 &gt;xxx
+for i in $(cat xxx) ; do
+    do_something ;
+done
+</programlisting>
+can be replaced with
+<programlisting>
+x="$(ls -1)"
+for i in ${x} ; do
+    do_something ;
+done
+</programlisting>
+           </para>
+           <note><para>ksh93 supports binary variables (e.g. <literal>typeset 
-b varname</literal>) which can hold any value.</para></note>
+      </section>  
+
+
+      <section xml:id="create_subdirs_for_multiple_temporary_files">
+          <title>If you create more than one temporary file create an unique 
subdir</title>
+          <para>If you create more than one temporary file create an unique 
subdir for
+          these files and make sure the dir is writable. Make sure you cleanup
+          after yourself (unless you are debugging).
+          </para>
+      </section>           
+
+
+      <section xml:id="use_dynamic_file_descriptors">
+          <title>&tag_ksh93only;Use {n}&lt;file instead of fixed file 
descriptor numbers</title>
+          <para>When opening a file use {n}&lt;file, where <envar>n</envar> is 
an
+          integer variable rather than specifying a fixed descriptor 
number.</para>
+          <para>This is highly recommended in functions to avoid that fixed 
file
+          descriptor numbers interfere with the calling script.</para>
+<example><title>Open a network connection and store the file descriptor number 
in a variable</title>
+<programlisting>
+function cat_http
+{
+    integer netfd
+
+...
+
+    # open TCP channel
+    redirect {netfd}&lt;&gt;"/dev/tcp/${host}/${port}"
+
+    # send HTTP request    
+    request="GET /${path} HTTP/1.1\n"
+    request+="Host: ${host}\n"
+    request+="User-Agent: demo code/ksh93 (2007-08-30; $(uname -s -r -p))\n"
+    request+="Connection: close\n"
+    print "${request}\n" &gt;&amp;${netfd}
+    
+    # collect response and send it to stdout
+    cat &lt;&amp;${netfd}
+    
+    # close connection
+    exec {netfd}&lt;&amp;-
+
+...
+
+}
+</programlisting>
+</example>
+      </section>           
+
+
+      <section xml:id="use_inline_here_documents">
+          <title>&tag_ksh93only;&tag_performance;Use inline here documents
+          instead of <literal>echo "$x" | command</literal></title>
+          <para>Use inline here documents, for example
+<programlisting>
+command &lt;&lt;&lt; $x
+</programlisting>
+       rather than
+<programlisting>
+print -r -- "$x" | command
+</programlisting>
+          </para>
+      </section>           
+
+
+      <section xml:id="use_read_r">
+          <title>&tag_ksh93only;Use the <literal>-r</literal> option of 
<literal>read</literal> to read a line</title>
+          <para>Use the <literal>-r</literal> option of 
<literal>read</literal> to read a line.
+          You never know when a line will end in <literal>\</literal> and 
without a
+          <literal>-r</literal> multiple
+          lines can be read.</para>
+      </section>
+
+
+      <section xml:id="print_compound_variables_using_print_C">
+          <title>&tag_ksh93only;Print compound variables using <literal>print 
-C varname</literal> or <literal>print -v varname</literal></title>
+          <para>Print compound variables using <literal>print -C 
varname</literal> or
+          <literal>print -v varname</literal> to make sure that non-printable 
characters
+          are correctly encoded.</para>
+<example><title>Print compound variable with non-printable characters</title>
+<programlisting>
+compound x=(
+    a=5
+    b="hello"
+    c=(
+        d=9
+        e="$(printf "1\v3")" <co xml:id="co.vertical_tab1" />
+    )
+)
+print -v x
+</programlisting>
+<para>will print:</para>
+<screen>
+<computeroutput>(
+        a=5
+        b=hello
+        c=(
+                d=9
+                e=$'1\0133' <co xml:id="co.vertical_tab2" />
+        )
+)</computeroutput>
+</screen>
+<calloutlist>
+  <callout arearefs="co.vertical_tab1 co.vertical_tab2">
+    <para>vertical tab, <literal>\v</literal>, 
octal=<literal>\013</literal>.</para>
+  </callout>
+</calloutlist>
+</example>
+      </section>
+
+      <section xml:id="command_name_before_redirections">
+          <title>Put the command name and arguments before redirections</title>
+          <para>Put the command name and arguments before redirections.
+          You can legally do <literal>$ &gt; file date</literal> instead of 
<literal>date &gt; file</literal>
+          but don't do it.</para>
+      </section>           
+
+      <section xml:id="enable_gmacs_editor_mode_for_user_prompts">
+          <title>&tag_ksh93only;Enable the <literal>gmacs</literal> editor
+          mode when reading user input using the <literal>read</literal> 
builtin</title>
+          <para>Enable the <literal>gmacs</literal>editor mode before reading 
user
+          input using the <literal>read</literal> builtin to enable the use of
+          cursor+backspace+delete keys in the edit line</para>
+<example><title>Prompt user for a string with gmacs editor mode enabled</title>
+<programlisting>
+set -o gmacs <co xml:id="co.enable_gmacs" />
+typeset inputstring="default value"
+...
+read -v<co xml:id="co.read_v" /> inputstring<co xml:id="co.readvar" />?"Please 
enter a string: "<co xml:id="co.prompt" />
+...
+printf "The user entered the following string: '%s'\n" "${inputstring}"
+
+...
+</programlisting>
+<calloutlist>
+  <callout arearefs="co.enable_gmacs">
+    <para>Enable gmacs editor mode.</para>
+  </callout>
+  <callout arearefs="co.read_v">
+    <para>The value of the variable is displayed and used as a default 
value.</para>
+  </callout>  
+  <callout arearefs="co.readvar">
+    <para>Variable used to store the result.</para>
+  </callout> 
+  <callout arearefs="co.prompt">
+    <para>Prompt string which is displayed in stderr.</para>
+  </callout> 
+</calloutlist>
+</example>
+      </section>        
+  </section><!-- end of I/O -->
+
+
+
+
+
+
+  <section xml:id="math">
+  <title>Math</title>
+
+      <section xml:id="use_builtin_arithmetic_expressions">
+          <title>&tag_kshonly;&tag_performance;Use builtin arithmetic 
expressions instead of external applications</title>
+          <para>Use builtin (POSIX shell) arithmetic expressions instead of
+          <filename>expr</filename>,
+          <filename>bc</filename>,
+          <filename>dc</filename>,
+          <filename>awk</filename>,
+          <filename>nawk</filename> or
+          <filename>perl</filename>.
+          </para>
+          <note>
+              <para>ksh93 supports C99-like floating-point arithmetic 
including special values
+              such as
+              <simplelist type="inline">
+              <member>+Inf</member>
+              <member>-Inf</member>
+              <member>+NaN</member>
+              <member>-NaN</member>
+              </simplelist>.
+              </para>
+          </note>
+      </section>
+
+
+      <section xml:id="use_floating_point_arithmetic_expressions">
+          <title>&tag_ksh93only; Use floating-point arithmetic expressions if
+          calculations may trigger a division by zero or other 
exceptions</title>
+          <para>Use floating-point arithmetic expressions if calculations may
+          trigger a division by zero or other exceptions - floating point 
arithmetic expressions in
+          ksh93 support special values such as 
<literal>+Inf</literal>/<literal>-Inf</literal> and
+          <literal>+NaN</literal>/<literal>-NaN</literal> which can greatly 
simplify testing for
+          error conditions, e.g. instead of a <literal>trap</literal> or 
explicit
+          <literal>if ... then... else</literal> checks for every 
sub-expression
+          you can check the results for such special values.
+          </para>
+          <para>Example:
+<screen>
+$ <userinput>ksh93 -c 'integer i=0 j=5 ; print -- "x=$((j/i)) "'</userinput>
+<computeroutput>ksh93: line 1: j/i: divide by zero</computeroutput>
+$ <userinput>ksh93 -c 'float i=0 j=-5 ; print -- "x=$((j/i)) "'</userinput>
+<computeroutput>x=-Inf</computeroutput>
+</screen>
+          </para>
+      </section>
+
+
+      <section xml:id="use_printf_a_for_passing_float_values">
+          <title>&tag_ksh93only; Use <literal>printf "%a"</literal> when 
passing floating-point values</title>
+          <para>Use <literal>printf "%a"</literal> when passing floating-point 
values between scripts or
+          as output of a function to avoid rounding errors when converting 
between
+          bases.</para>
+          <para>
+    Example:
+<programlisting>
+function xxx
+{
+    float val
+
+    (( val=sin(5.) ))
+    printf "%a\n" val
+}
+float out
+(( out=$(xxx) ))
+xxx
+print -- $out
+</programlisting>
+This will print:
+<programlisting>
+-0.9589242747
+-0x1.eaf81f5e09933226af13e5563bc6p-01
+</programlisting>
+          </para>
+      </section>
+
+
+      <section xml:id="put_constants_into_readonly_variables">
+         <title>&tag_kshonly;&tag_performance;Put constant values into 
readonly variables</title>
+         <para>Put constant values into readonly variables</para>
+         <para>For example:
+<programlisting>
+float -r M_PI=3.14159265358979323846
+</programlisting>
+or
+<programlisting>
+float M_PI=3.14159265358979323846
+readonly M_PI
+</programlisting>
+          </para>
+      </section>
+
+
+      <section xml:id="avoid_unnecessary_string_number_conversions">
+         <title>&tag_kshonly;&tag_performance;Avoid string to number
+         (and/or number to string) conversions in arithmetic expressions
+         expressions</title>
+         <para>Avoid string to number and/or number to string conversions in
+         arithmetic expressions expressions to avoid performance degradation
+         and rounding errors.</para>
+         <example><title>(( x=$x*2 )) vs. (( x=x*2 ))</title>
+<programlisting>
+float x
+...
+(( x=$x*2 ))
+</programlisting>
+<para>
+will convert the variable "x" (stored in the machine's native
+<literal>|long double|</literal> datatype) to a string value in base10 format,
+apply pattern expansion (globbing), then insert this string into the
+arithmetic expressions and parse the value which converts it into the internal 
|long double| datatype format again.
+This is both slow and generates rounding errors when converting the 
floating-point value between
+the internal base2 and the base10 representation of the string.
+</para>
+<para>
+The correct usage would be:
+</para>
+<programlisting>
+float x
+...
+(( x=x*2 ))
+</programlisting>
+<para>
+e.g. omit the '$' because it's (at least) redundant within arithmetic 
expressions.
+</para>
+         </example>
+
+
+         <example><title>x=$(( y+5.5 )) vs. (( x=y+5.5 ))</title>
+<programlisting>
+float x
+float y=7.1
+...
+x=$(( y+5.5 ))
+</programlisting>
+<para>
+will calculate the value of <literal>y+5.5</literal>, convert it to a
+base-10 string value amd assign the value to the floating-point variable
+<literal>x</literal> again which will convert the string value back to the
+internal |long double| datatype format again.
+</para>
+<para>
+The correct usage would be:
+</para>
+<programlisting>
+float x
+float y=7.1
+...
+(( x=y+5.5 ))
+</programlisting>
+<para>
+i.e. this will save the string conversions and avoid any 
base2--&gt;base10--&gt;base2-conversions.
+</para>
+          </example>
+      </section>
+
+
+      <section xml:id="set_lc_numeric_when_using_floating_point">
+         <title>&tag_ksh93only;Set <envar>LC_NUMERIC</envar> when using 
floating-point constants</title>
+         <para>Set <envar>LC_NUMERIC</envar> when using floating-point 
constants to avoid problems with radix-point
+         representations which differ from the representation used in the 
script, for example the <literal>de_DE.*</literal> locale
+         use ',' instead of '.' as default radix point symbol.</para>
+         <para>For example:
+<programlisting>
+# Make sure all math stuff runs in the "C" locale to avoid problems with 
alternative
+# radix point representations (e.g. ',' instead of '.' in de_DE.*-locales). 
This
+# needs to be set _before_ any floating-point constants are defined in this 
script)
+if [[ "${LC_ALL}" != "" ]] ; then
+    export \
+        LC_MONETARY="${LC_ALL}" \
+        LC_MESSAGES="${LC_ALL}" \
+        LC_COLLATE="${LC_ALL}" \
+        LC_CTYPE="${LC_ALL}"
+        unset LC_ALL
+fi
+export LC_NUMERIC=C
+...
+float -r M_PI=3.14159265358979323846
+</programlisting>
+          </para>
+
+          <note><para>The environment variable <envar>LC_ALL</envar> always 
overrides all other <envar>LC_*</envar> variables,
+          including <envar>LC_NUMERIC</envar>. The script should always 
protect itself against custom <envar>LC_NUMERIC</envar> and
+          <envar>LC_ALL</envar> values as shown in the example above.
+          </para></note>
+      </section>
+
+
+
+  </section><!-- end of math -->
+    
+  
+
+
+
+
+  <section xml:id="misc">
+  <title>Misc</title>
+
+      <section xml:id="debug_use_lineno_in_ps4">
+          <title>Put <literal>[${LINENO}]</literal> in your 
<envar>PS4</envar></title>
+          <para>Put <literal>[${LINENO}]</literal> in your <envar>PS4</envar> 
prompt so that you will get line
+          numbers with you run with <literal>-x</literal>. If you are looking 
at performance
+          issues put <literal>$SECONDS</literal> in the <envar>PS4</envar> 
prompt as well.</para>
+      </section>
+
+  </section><!-- end of misc -->
+
+
+
+
+</section><!-- end of RULES -->
+
+
+
+  
+</article>
--- old/usr/src/lib/libshell/sparc/include/ast/history.h        Fri Sep 25 
06:42:42 2009
+++ new/usr/src/lib/libshell/sparc/include/ast/history.h        Fri Sep 25 
06:42:40 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/sparc/include/ast/nval.h   Fri Sep 25 06:42:45 2009
+++ new/usr/src/lib/libshell/sparc/include/ast/nval.h   Fri Sep 25 06:42:43 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -276,6 +276,7 @@
 extern __MANGLE__ Namval_t             *nv_lastdict __PROTO__((void));
 extern __MANGLE__ Namval_t             *nv_mkinttype __PROTO__((char*, size_t, 
int, const char*, Namdisc_t*));
 extern __MANGLE__ void                 nv_newattr 
__PROTO__((Namval_t*,unsigned,int));
+extern __MANGLE__ void                 nv_newtype __PROTO__((Namval_t*));
 extern __MANGLE__ Namval_t             *nv_open __PROTO__((const 
char*,Dt_t*,int));
 extern __MANGLE__ void                 nv_putval __PROTO__((Namval_t*,const 
char*,int));
 extern __MANGLE__ void                 nv_putv __PROTO__((Namval_t*,const 
char*,int,Namfun_t*));
--- old/usr/src/lib/libshell/sparc/include/ast/shell.h  Fri Sep 25 06:42:47 2009
+++ new/usr/src/lib/libshell/sparc/include/ast/shell.h  Fri Sep 25 06:42:46 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -146,8 +146,8 @@
        int             inlineno;       /* line number of current input file */
        int             exitval;        /* most recent exit value */
        unsigned char   trapnote;       /* set when trap/signal is pending */
-       char            subshell;       /* set for virtual subshell */
        char            shcomp;         /* set when runing shcomp */
+       short           subshell;       /* set for virtual subshell */
 #ifdef _SH_PRIVATE
        _SH_PRIVATE
 #endif /* _SH_PRIVATE */
--- old/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/acct   Fri Sep 25 
06:42:50 2009
+++ new/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/acct   Fri Sep 25 
06:42:49 2009
@@ -1,11 +1,11 @@
-/* : : generated by iffe version 2008-01-31 : : */
+/* : : generated by iffe version 2009-05-01 : : */
 #ifndef _def_acct_ksh93
 #define _def_acct_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _lib_acct      1       /* acct() in default lib(s) */
--- old/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/cmds   Fri Sep 25 
06:42:53 2009
+++ new/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/cmds   Fri Sep 25 
06:42:52 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/cmds
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/cmd/ksh93/features/cmds
 by iffe version 2009-05-01 : : */
 #ifndef _def_cmds_ksh93
 #define _def_cmds_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _cmd_newgrp    1       /* newgrp in ?(/usr)/(bin|etc|ucb) */
--- old/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/dynamic        Fri Sep 
25 06:42:56 2009
+++ new/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/dynamic        Fri Sep 
25 06:42:54 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/dynamic
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/cmd/ksh93/features/dynamic
 by iffe version 2009-05-01 : : */
 #ifndef _def_dynamic_ksh93
 #define _def_dynamic_ksh93     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #if SHOPT_DYNAMIC
--- old/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/execargs       Fri Sep 
25 06:42:59 2009
+++ new/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/execargs       Fri Sep 
25 06:42:57 2009
@@ -1,11 +1,11 @@
-/* : : generated by iffe version 2008-01-31 : : */
+/* : : generated by iffe version 2009-05-01 : : */
 #ifndef _def_execargs_ksh93
 #define _def_execargs_ksh93    1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #endif
--- old/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/externs        Fri Sep 
25 06:43:02 2009
+++ new/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/externs        Fri Sep 
25 06:43:00 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/externs
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/cmd/ksh93/features/externs
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_externs_ksh93
 #if !defined(__PROTO__)
@@ -63,10 +63,10 @@
 
 #define _def_externs_ksh93     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _hdr_exec_attr 1       /* #include <exec_attr.h> ok */
--- old/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/locale Fri Sep 25 
06:43:05 2009
+++ new/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/locale Fri Sep 25 
06:43:03 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/locale
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/cmd/ksh93/features/locale
 by iffe version 2009-05-01 : : */
 #ifndef _def_locale_ksh93
 #define _def_locale_ksh93      1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _hdr_locale    1       /* #include <locale.h> ok */
--- old/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/math   Fri Sep 25 
06:43:08 2009
+++ new/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/math   Fri Sep 25 
06:43:06 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/math.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/cmd/ksh93/features/math.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_math_ksh93
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
@@ -62,15 +62,15 @@
 
 #define _def_math_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
                   
 
-/* : : generated by iffe from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/data/math.tab
 : : */
+/* : : generated by iffe from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/cmd/ksh93/data/math.tab
 : : */
 
 typedef Sfdouble_t (*Math_f) __PROTO__((Sfdouble_t,...));
 
@@ -88,7 +88,13 @@
 static int local_islessequal __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, 
a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return islessequal(a1,a2);}
 static int local_islessgreater __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, 
a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return islessgreater(a1,a2);}
 static int local_isnormal __PARAM__((Sfdouble_t a1), (a1)) 
__OTORP__(Sfdouble_t a1;){return isnormal(a1);}
+#ifdef FP_SUBNORMAL
+static int local_issubnormal __PARAM__((Sfdouble_t x), (x)) 
__OTORP__(Sfdouble_t x;){ return fpclassify(x) == FP_SUBNORMAL; }
+#endif
 static int local_isunordered __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, 
a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return isunordered(a1,a2);}
+#ifdef FP_ZERO
+static int local_iszero __PARAM__((Sfdouble_t x), (x)) __OTORP__(Sfdouble_t 
x;){ return fpclassify(x) == FP_ZERO; }
+#endif
 static int local_signbit __PARAM__((Sfdouble_t a1), (a1)) __OTORP__(Sfdouble_t 
a1;){return signbit(a1);}
 
 /*
@@ -136,9 +142,19 @@
        "\012islessgreater",    (Math_f)local_islessgreater,
        "\011isnan",    (Math_f)isnanl,
        "\011isnormal", (Math_f)local_isnormal,
+#ifdef FP_SUBNORMAL
+       "\011issubnormal",      (Math_f)local_issubnormal,
+#endif
        "\012isunordered",      (Math_f)local_isunordered,
+#ifdef FP_ZERO
+       "\011iszero",   (Math_f)local_iszero,
+#endif
+       "\001j0",       (Math_f)j0l,
+       "\001j1",       (Math_f)j1l,
+       "\002jn",       (Math_f)jnl,
        "\001lgamma",   (Math_f)lgammal,
        "\001log",      (Math_f)logl,
+       "\001log10",    (Math_f)log10l,
        "\001log1p",    (Math_f)log1pl,
        "\001log2",     (Math_f)log2l,
        "\001logb",     (Math_f)logbl,
@@ -159,6 +175,9 @@
        "\001tanh",     (Math_f)tanhl,
        "\001tgamma",   (Math_f)tgammal,
        "\001trunc",    (Math_f)truncl,
+       "\001y0",       (Math_f)y0l,
+       "\001y1",       (Math_f)y1l,
+       "\002yn",       (Math_f)ynl,
        "",             (Math_f)0
 };
 #endif
--- old/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/options        Fri Sep 
25 06:43:11 2009
+++ new/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/options        Fri Sep 
25 06:43:09 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/options
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/cmd/ksh93/features/options
 by iffe version 2009-05-01 : : */
 #ifndef _def_options_ksh93
 #define _def_options_ksh93     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define SHELLMAGIC     1
--- old/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/poll   Fri Sep 25 
06:43:14 2009
+++ new/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/poll   Fri Sep 25 
06:43:12 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/poll
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/cmd/ksh93/features/poll
 by iffe version 2009-05-01 : : */
 #ifndef _def_poll_ksh93
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
@@ -62,10 +62,10 @@
 
 #define _def_poll_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _hdr_poll      1       /* #include <poll.h> ok */
--- old/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/pstat  Fri Sep 25 
06:43:17 2009
+++ new/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/pstat  Fri Sep 25 
06:43:15 2009
@@ -1,11 +1,11 @@
-/* : : generated by iffe version 2008-01-31 : : */
+/* : : generated by iffe version 2009-05-01 : : */
 #ifndef _def_pstat_ksh93
 #define _def_pstat_ksh93       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #endif
--- old/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/rlimits        Fri Sep 
25 06:43:20 2009
+++ new/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/rlimits        Fri Sep 
25 06:43:18 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/rlimits
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/cmd/ksh93/features/rlimits
 by iffe version 2009-05-01 : : */
 #ifndef _def_rlimits_ksh93
 #define _def_rlimits_ksh93     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _sys_resource  1       /* #include <sys/resource.h> ok */
--- old/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/setjmp Fri Sep 25 
06:43:23 2009
+++ new/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/setjmp Fri Sep 25 
06:43:21 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/setjmp
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/cmd/ksh93/features/setjmp
 by iffe version 2009-05-01 : : */
 #ifndef _def_setjmp_ksh93
 #define _def_setjmp_ksh93      1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _lib_sigsetjmp 1       /* sigsetjmp() in default lib(s) */
--- old/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/sigfeatures    Fri Sep 
25 06:43:26 2009
+++ new/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/sigfeatures    Fri Sep 
25 06:43:24 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/sigfeatures
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/cmd/ksh93/features/sigfeatures
 by iffe version 2009-05-01 : : */
 #ifndef _def_sigfeatures_ksh93
 #define _def_sigfeatures_ksh93 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _lib_sigrelse  1       /* sigrelse() in default lib(s) */
--- old/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/time   Fri Sep 25 
06:43:29 2009
+++ new/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/time   Fri Sep 25 
06:43:27 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/time
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/cmd/ksh93/features/time
 by iffe version 2009-05-01 : : */
 #ifndef _def_time_ksh93
 #define _def_time_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _hdr_utime     1       /* #include <utime.h> ok */
--- old/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/ttys   Fri Sep 25 
06:43:32 2009
+++ new/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/ttys   Fri Sep 25 
06:43:30 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/ttys
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/cmd/ksh93/features/ttys
 by iffe version 2009-05-01 : : */
 #ifndef _def_ttys_ksh93
 #define _def_ttys_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _hdr_termios   1       /* #include <termios.h> ok */
--- old/usr/src/lib/libshell/sparcv9/include/ast/history.h      Fri Sep 25 
06:43:35 2009
+++ new/usr/src/lib/libshell/sparcv9/include/ast/history.h      Fri Sep 25 
06:43:33 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libshell/sparcv9/include/ast/nval.h Fri Sep 25 06:43:38 2009
+++ new/usr/src/lib/libshell/sparcv9/include/ast/nval.h Fri Sep 25 06:43:36 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -276,6 +276,7 @@
 extern __MANGLE__ Namval_t             *nv_lastdict __PROTO__((void));
 extern __MANGLE__ Namval_t             *nv_mkinttype __PROTO__((char*, size_t, 
int, const char*, Namdisc_t*));
 extern __MANGLE__ void                 nv_newattr 
__PROTO__((Namval_t*,unsigned,int));
+extern __MANGLE__ void                 nv_newtype __PROTO__((Namval_t*));
 extern __MANGLE__ Namval_t             *nv_open __PROTO__((const 
char*,Dt_t*,int));
 extern __MANGLE__ void                 nv_putval __PROTO__((Namval_t*,const 
char*,int));
 extern __MANGLE__ void                 nv_putv __PROTO__((Namval_t*,const 
char*,int,Namfun_t*));
--- old/usr/src/lib/libshell/sparcv9/include/ast/shell.h        Fri Sep 25 
06:43:41 2009
+++ new/usr/src/lib/libshell/sparcv9/include/ast/shell.h        Fri Sep 25 
06:43:39 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1982-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1982-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
@@ -146,8 +146,8 @@
        int             inlineno;       /* line number of current input file */
        int             exitval;        /* most recent exit value */
        unsigned char   trapnote;       /* set when trap/signal is pending */
-       char            subshell;       /* set for virtual subshell */
        char            shcomp;         /* set when runing shcomp */
+       short           subshell;       /* set for virtual subshell */
 #ifdef _SH_PRIVATE
        _SH_PRIVATE
 #endif /* _SH_PRIVATE */
--- old/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/acct Fri Sep 25 
06:43:44 2009
+++ new/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/acct Fri Sep 25 
06:43:42 2009
@@ -1,11 +1,11 @@
-/* : : generated by iffe version 2008-01-31 : : */
+/* : : generated by iffe version 2009-05-01 : : */
 #ifndef _def_acct_ksh93
 #define _def_acct_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _lib_acct      1       /* acct() in default lib(s) */
--- old/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/cmds Fri Sep 25 
06:43:47 2009
+++ new/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/cmds Fri Sep 25 
06:43:45 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/cmds
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/cmd/ksh93/features/cmds
 by iffe version 2009-05-01 : : */
 #ifndef _def_cmds_ksh93
 #define _def_cmds_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _cmd_newgrp    1       /* newgrp in ?(/usr)/(bin|etc|ucb) */
--- old/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/dynamic      Fri Sep 
25 06:43:50 2009
+++ new/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/dynamic      Fri Sep 
25 06:43:48 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/dynamic
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/cmd/ksh93/features/dynamic
 by iffe version 2009-05-01 : : */
 #ifndef _def_dynamic_ksh93
 #define _def_dynamic_ksh93     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #if SHOPT_DYNAMIC
--- old/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/execargs     Fri Sep 
25 06:43:52 2009
+++ new/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/execargs     Fri Sep 
25 06:43:51 2009
@@ -1,11 +1,11 @@
-/* : : generated by iffe version 2008-01-31 : : */
+/* : : generated by iffe version 2009-05-01 : : */
 #ifndef _def_execargs_ksh93
 #define _def_execargs_ksh93    1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #endif
--- old/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/externs      Fri Sep 
25 06:43:55 2009
+++ new/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/externs      Fri Sep 
25 06:43:54 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/externs
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/cmd/ksh93/features/externs
 by iffe version 2009-05-01 : : */
                   
 #ifndef _def_externs_ksh93
 #if !defined(__PROTO__)
@@ -63,10 +63,10 @@
 
 #define _def_externs_ksh93     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _hdr_exec_attr 1       /* #include <exec_attr.h> ok */
--- old/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/locale       Fri Sep 
25 06:43:58 2009
+++ new/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/locale       Fri Sep 
25 06:43:56 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/locale
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/cmd/ksh93/features/locale
 by iffe version 2009-05-01 : : */
 #ifndef _def_locale_ksh93
 #define _def_locale_ksh93      1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _hdr_locale    1       /* #include <locale.h> ok */
--- old/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/math Fri Sep 25 
06:44:01 2009
+++ new/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/math Fri Sep 25 
06:43:59 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/math.sh
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/cmd/ksh93/features/math.sh
 by iffe version 2009-05-01 : : */
 #ifndef _def_math_ksh93
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
@@ -62,15 +62,15 @@
 
 #define _def_math_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
                   
 
-/* : : generated by iffe from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/data/math.tab
 : : */
+/* : : generated by iffe from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/cmd/ksh93/data/math.tab
 : : */
 
 typedef Sfdouble_t (*Math_f) __PROTO__((Sfdouble_t,...));
 
@@ -88,7 +88,13 @@
 static int local_islessequal __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, 
a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return islessequal(a1,a2);}
 static int local_islessgreater __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, 
a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return islessgreater(a1,a2);}
 static int local_isnormal __PARAM__((Sfdouble_t a1), (a1)) 
__OTORP__(Sfdouble_t a1;){return isnormal(a1);}
+#ifdef FP_SUBNORMAL
+static int local_issubnormal __PARAM__((Sfdouble_t x), (x)) 
__OTORP__(Sfdouble_t x;){ return fpclassify(x) == FP_SUBNORMAL; }
+#endif
 static int local_isunordered __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, 
a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return isunordered(a1,a2);}
+#ifdef FP_ZERO
+static int local_iszero __PARAM__((Sfdouble_t x), (x)) __OTORP__(Sfdouble_t 
x;){ return fpclassify(x) == FP_ZERO; }
+#endif
 static int local_signbit __PARAM__((Sfdouble_t a1), (a1)) __OTORP__(Sfdouble_t 
a1;){return signbit(a1);}
 
 /*
@@ -136,9 +142,19 @@
        "\012islessgreater",    (Math_f)local_islessgreater,
        "\011isnan",    (Math_f)isnanl,
        "\011isnormal", (Math_f)local_isnormal,
+#ifdef FP_SUBNORMAL
+       "\011issubnormal",      (Math_f)local_issubnormal,
+#endif
        "\012isunordered",      (Math_f)local_isunordered,
+#ifdef FP_ZERO
+       "\011iszero",   (Math_f)local_iszero,
+#endif
+       "\001j0",       (Math_f)j0l,
+       "\001j1",       (Math_f)j1l,
+       "\002jn",       (Math_f)jnl,
        "\001lgamma",   (Math_f)lgammal,
        "\001log",      (Math_f)logl,
+       "\001log10",    (Math_f)log10l,
        "\001log1p",    (Math_f)log1pl,
        "\001log2",     (Math_f)log2l,
        "\001logb",     (Math_f)logbl,
@@ -159,6 +175,9 @@
        "\001tanh",     (Math_f)tanhl,
        "\001tgamma",   (Math_f)tgammal,
        "\001trunc",    (Math_f)truncl,
+       "\001y0",       (Math_f)y0l,
+       "\001y1",       (Math_f)y1l,
+       "\002yn",       (Math_f)ynl,
        "",             (Math_f)0
 };
 #endif
--- old/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/options      Fri Sep 
25 06:44:04 2009
+++ new/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/options      Fri Sep 
25 06:44:02 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/options
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/cmd/ksh93/features/options
 by iffe version 2009-05-01 : : */
 #ifndef _def_options_ksh93
 #define _def_options_ksh93     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define SHELLMAGIC     1
--- old/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/poll Fri Sep 25 
06:44:07 2009
+++ new/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/poll Fri Sep 25 
06:44:05 2009
@@ -1,6 +1,6 @@
 
 /* : : generated by proto : : */
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/poll
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/cmd/ksh93/features/poll
 by iffe version 2009-05-01 : : */
 #ifndef _def_poll_ksh93
 #if !defined(__PROTO__)
 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || 
defined(c_plusplus)
@@ -62,10 +62,10 @@
 
 #define _def_poll_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _hdr_poll      1       /* #include <poll.h> ok */
--- old/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/pstat        Fri Sep 
25 06:44:10 2009
+++ new/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/pstat        Fri Sep 
25 06:44:08 2009
@@ -1,11 +1,11 @@
-/* : : generated by iffe version 2008-01-31 : : */
+/* : : generated by iffe version 2009-05-01 : : */
 #ifndef _def_pstat_ksh93
 #define _def_pstat_ksh93       1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #endif
--- old/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/rlimits      Fri Sep 
25 06:44:13 2009
+++ new/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/rlimits      Fri Sep 
25 06:44:11 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/rlimits
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/cmd/ksh93/features/rlimits
 by iffe version 2009-05-01 : : */
 #ifndef _def_rlimits_ksh93
 #define _def_rlimits_ksh93     1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _sys_resource  1       /* #include <sys/resource.h> ok */
--- old/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/setjmp       Fri Sep 
25 06:44:16 2009
+++ new/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/setjmp       Fri Sep 
25 06:44:14 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/setjmp
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/cmd/ksh93/features/setjmp
 by iffe version 2009-05-01 : : */
 #ifndef _def_setjmp_ksh93
 #define _def_setjmp_ksh93      1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _lib_sigsetjmp 1       /* sigsetjmp() in default lib(s) */
--- old/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/sigfeatures  Fri Sep 
25 06:44:19 2009
+++ new/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/sigfeatures  Fri Sep 
25 06:44:17 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/sigfeatures
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/cmd/ksh93/features/sigfeatures
 by iffe version 2009-05-01 : : */
 #ifndef _def_sigfeatures_ksh93
 #define _def_sigfeatures_ksh93 1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _lib_sigrelse  1       /* sigrelse() in default lib(s) */
--- old/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/time Fri Sep 25 
06:44:22 2009
+++ new/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/time Fri Sep 25 
06:44:20 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/time
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/cmd/ksh93/features/time
 by iffe version 2009-05-01 : : */
 #ifndef _def_time_ksh93
 #define _def_time_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _hdr_utime     1       /* #include <utime.h> ok */
--- old/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/ttys Fri Sep 25 
06:44:25 2009
+++ new/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/ttys Fri Sep 25 
06:44:23 2009
@@ -1,11 +1,11 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/ttys
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/cmd/ksh93/features/ttys
 by iffe version 2009-05-01 : : */
 #ifndef _def_ttys_ksh93
 #define _def_ttys_ksh93        1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_dll       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
-#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
+#define _LIB_cmd       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a
 is a library */
 #define _LIB_md        1       /* -lmd is a library */
 #define _LIB_nsl       1       /* -lnsl is a library */
 #define _hdr_termios   1       /* #include <termios.h> ok */
--- old/usr/src/lib/libsum/amd64/include/ast/sum.h      Fri Sep 25 06:44:28 2009
+++ new/usr/src/lib/libsum/amd64/include/ast/sum.h      Fri Sep 25 06:44:26 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1996-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1996-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libsum/amd64/src/lib/libsum/FEATURE/sum     Fri Sep 25 
06:44:31 2009
+++ new/usr/src/lib/libsum/amd64/src/lib/libsum/FEATURE/sum     Fri Sep 25 
06:44:29 2009
@@ -1,8 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libsum/features/sum
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/src/lib/libsum/features/sum
 by iffe version 2009-05-01 : : */
 #ifndef _def_sum_sum
 #define _def_sum_sum   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_64bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _hdr_md4       1       /* #include <md4.h> ok */
 #define _LIB_md        1       /* -lmd is a library */
--- old/usr/src/lib/libsum/common/sum-ast4.c    Fri Sep 25 06:44:34 2009
+++ new/usr/src/lib/libsum/common/sum-ast4.c    Fri Sep 25 06:44:32 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1996-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1996-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libsum/common/sum-att.c     Fri Sep 25 06:44:37 2009
+++ new/usr/src/lib/libsum/common/sum-att.c     Fri Sep 25 06:44:35 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1996-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1996-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libsum/common/sum-bsd.c     Fri Sep 25 06:44:40 2009
+++ new/usr/src/lib/libsum/common/sum-bsd.c     Fri Sep 25 06:44:38 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1996-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1996-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libsum/common/sum-crc.c     Fri Sep 25 06:44:43 2009
+++ new/usr/src/lib/libsum/common/sum-crc.c     Fri Sep 25 06:44:41 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1996-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1996-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libsum/common/sum-lmd.c     Fri Sep 25 06:44:46 2009
+++ new/usr/src/lib/libsum/common/sum-lmd.c     Fri Sep 25 06:44:44 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1996-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1996-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libsum/common/sum-md5.c     Fri Sep 25 06:44:49 2009
+++ new/usr/src/lib/libsum/common/sum-md5.c     Fri Sep 25 06:44:47 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1996-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1996-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libsum/common/sum-prng.c    Fri Sep 25 06:44:52 2009
+++ new/usr/src/lib/libsum/common/sum-prng.c    Fri Sep 25 06:44:50 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1996-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1996-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libsum/common/sum-sha1.c    Fri Sep 25 06:44:55 2009
+++ new/usr/src/lib/libsum/common/sum-sha1.c    Fri Sep 25 06:44:53 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1996-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1996-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libsum/common/sum-sha2.c    Fri Sep 25 06:44:58 2009
+++ new/usr/src/lib/libsum/common/sum-sha2.c    Fri Sep 25 06:44:56 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1996-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1996-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libsum/common/sum.h Fri Sep 25 06:45:01 2009
+++ new/usr/src/lib/libsum/common/sum.h Fri Sep 25 06:44:59 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1996-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1996-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libsum/common/sumlib.c      Fri Sep 25 06:45:04 2009
+++ new/usr/src/lib/libsum/common/sumlib.c      Fri Sep 25 06:45:02 2009
@@ -1,7 +1,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1996-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1996-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libsum/i386/include/ast/sum.h       Fri Sep 25 06:45:07 2009
+++ new/usr/src/lib/libsum/i386/include/ast/sum.h       Fri Sep 25 06:45:05 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1996-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1996-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libsum/i386/src/lib/libsum/FEATURE/sum      Fri Sep 25 
06:45:09 2009
+++ new/usr/src/lib/libsum/i386/src/lib/libsum/FEATURE/sum      Fri Sep 25 
06:45:08 2009
@@ -1,8 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libsum/features/sum
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/src/lib/libsum/features/sum
 by iffe version 2009-05-01 : : */
 #ifndef _def_sum_sum
 #define _def_sum_sum   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_i386_32bit/arch/sol11.i386/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _hdr_md4       1       /* #include <md4.h> ok */
 #define _LIB_md        1       /* -lmd is a library */
--- old/usr/src/lib/libsum/sparc/include/ast/sum.h      Fri Sep 25 06:45:12 2009
+++ new/usr/src/lib/libsum/sparc/include/ast/sum.h      Fri Sep 25 06:45:11 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1996-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1996-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libsum/sparc/src/lib/libsum/FEATURE/sum     Fri Sep 25 
06:45:15 2009
+++ new/usr/src/lib/libsum/sparc/src/lib/libsum/FEATURE/sum     Fri Sep 25 
06:45:14 2009
@@ -1,8 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libsum/features/sum
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/src/lib/libsum/features/sum
 by iffe version 2009-05-01 : : */
 #ifndef _def_sum_sum
 #define _def_sum_sum   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_32bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _hdr_md4       1       /* #include <md4.h> ok */
 #define _LIB_md        1       /* -lmd is a library */
--- old/usr/src/lib/libsum/sparcv9/include/ast/sum.h    Fri Sep 25 06:45:18 2009
+++ new/usr/src/lib/libsum/sparcv9/include/ast/sum.h    Fri Sep 25 06:45:16 2009
@@ -3,7 +3,7 @@
 /***********************************************************************
 *                                                                      *
 *               This software is part of the ast package               *
-*          Copyright (c) 1996-2008 AT&T Intellectual Property          *
+*          Copyright (c) 1996-2009 AT&T Intellectual Property          *
 *                      and is licensed under the                       *
 *                  Common Public License, Version 1.0                  *
 *                    by AT&T Intellectual Property                     *
--- old/usr/src/lib/libsum/sparcv9/src/lib/libsum/FEATURE/sum   Fri Sep 25 
06:45:21 2009
+++ new/usr/src/lib/libsum/sparcv9/src/lib/libsum/FEATURE/sum   Fri Sep 25 
06:45:19 2009
@@ -1,8 +1,8 @@
-/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libsum/features/sum
 by iffe version 2008-01-31 : : */
+/* : : generated from 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/src/lib/libsum/features/sum
 by iffe version 2009-05-01 : : */
 #ifndef _def_sum_sum
 #define _def_sum_sum   1
 #define _sys_types     1       /* #include <sys/types.h> ok */
-#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
+#define _LIB_ast       1       /* 
/home/gisburn/ksh93/ast_ksh_20090908/build_sparc_64bit/arch/sol11.sun4/lib/libast.a
 is a library */
 #define _LIB_m 1       /* -lm is a library */
 #define _hdr_md4       1       /* #include <md4.h> ok */
 #define _LIB_md        1       /* -lmd is a library */
--- old/usr/src/pkgdefs/SUNWcsu/prototype_com   Fri Sep 25 06:45:24 2009
+++ new/usr/src/pkgdefs/SUNWcsu/prototype_com   Fri Sep 25 06:45:22 2009
@@ -70,12 +70,13 @@
 f none usr/bin/ckpath 555 root bin
 f none usr/bin/ckrange 555 root bin
 f none usr/bin/ckstr 555 root bin
-f none usr/bin/cksum 555 root bin
+l none usr/bin/cksum=../../usr/bin/alias
 f none usr/bin/cktime 555 root bin
 f none usr/bin/ckuid 555 root bin
 f none usr/bin/ckyorn 555 root bin
 f none usr/bin/clear 555 root bin
-f none usr/bin/cmp 555 root bin
+l none usr/bin/cmp=../../usr/bin/alias
+l none usr/bin/comm=../../usr/bin/alias
 l none usr/bin/command=../../usr/bin/alias
 f none usr/bin/coreadm 555 root bin
 f none usr/bin/cp 555 root bin
@@ -87,7 +88,7 @@
 f none usr/bin/ctrun 555 root bin
 f none usr/bin/ctstat 555 root bin
 f none usr/bin/ctwatch 555 root bin
-f none usr/bin/cut 555 root bin
+l none usr/bin/cut=../../usr/bin/alias
 f none usr/bin/date 555 root bin
 f none usr/bin/dd 555 root bin
 l none usr/bin/decrypt=../../usr/lib/isaexec
@@ -155,7 +156,7 @@
 f none usr/bin/isalist 555 root bin
 f none usr/bin/itu 555 root bin
 l none usr/bin/jobs=../../usr/bin/alias
-f none usr/bin/join 555 root bin
+l none usr/bin/join=../../usr/bin/alias
 s none usr/bin/jsh=../../sbin/sh
 f none usr/bin/kbd 555 root bin
 f none usr/bin/keylogin 555 root bin
@@ -173,6 +174,7 @@
 f none usr/bin/logger 555 root bin
 f none usr/bin/login 4555 root bin
 f none usr/bin/logins 750 root bin
+l none usr/bin/logname=../../usr/bin/alias
 f none usr/bin/ls 555 root bin
 l none usr/bin/m68k=../../usr/bin/i286
 l none usr/bin/mac=../../usr/lib/isaexec
@@ -205,6 +207,7 @@
 f none usr/bin/pagesize 555 root bin
 s none usr/bin/passmgmt=../sbin/passmgmt
 f none usr/bin/passwd 6555 root sys
+l none usr/bin/paste=../../usr/bin/alias
 f none usr/bin/patch 555 root bin
 f none usr/bin/pathchk 555 root bin
 f none usr/bin/pax 555 root bin
@@ -220,6 +223,7 @@
 f none usr/bin/pktool 555 root bin
 f none usr/bin/pr 555 root bin
 l none usr/bin/prctl=../../usr/lib/isaexec
+l none usr/bin/print=../../usr/bin/alias
 f none usr/bin/priocntl 555 root bin
 f none usr/bin/profiles 555 root bin
 f none usr/bin/projects 555 root bin
@@ -274,7 +278,7 @@
 f none usr/bin/tabs 555 root bin
 f none usr/bin/tail 555 root bin
 s none usr/bin/tar=../sbin/tar
-f none usr/bin/tee 555 root bin
+l none usr/bin/tee=../../usr/bin/alias
 l none usr/bin/test=../../usr/bin/alias
 f none usr/bin/tic 555 root bin
 f none usr/bin/time 555 root bin
@@ -296,6 +300,7 @@
 l none usr/bin/umask=../../usr/bin/alias
 l none usr/bin/unalias=../../usr/bin/alias
 s none usr/bin/uname=../../sbin/uname
+l none usr/bin/uniq=../../usr/bin/alias
 f none usr/bin/updatemedia 555 root bin
 l none usr/bin/uptime=../../usr/lib/isaexec
 l none usr/bin/vax=../../usr/bin/i286
@@ -305,7 +310,7 @@
 f none usr/bin/vmstat 555 root bin
 l none usr/bin/w=../../usr/lib/isaexec
 l none usr/bin/wait=../../usr/bin/alias
-f none usr/bin/wc 555 root bin
+l none usr/bin/wc=../../usr/bin/alias
 f none usr/bin/which 555 root bin
 f none usr/bin/who 555 root bin
 f none usr/bin/wracct 555 root bin
@@ -979,6 +984,35 @@
 f none usr/sbin/zdump 555 root bin
 f none usr/sbin/zic 555 root bin
 d none usr/share 755 root sys
+d none usr/share/doc 755 root other
+d none usr/share/doc/ksh 755 root bin
+f none usr/share/doc/ksh/RELEASE 644 root bin
+f none usr/share/doc/ksh/README 644 root bin
+f none usr/share/doc/ksh/TYPES 644 root bin
+f none usr/share/doc/ksh/DESIGN 644 root bin
+f none usr/share/doc/ksh/COMPATIBILITY 644 root bin
+f none usr/share/doc/ksh/OBSOLETE 644 root bin
+d none usr/share/doc/ksh/images 755 root bin
+d none usr/share/doc/ksh/images/callouts 755 root bin
+f none usr/share/doc/ksh/images/callouts/1.png 644 root bin
+f none usr/share/doc/ksh/images/callouts/2.png 644 root bin
+f none usr/share/doc/ksh/images/callouts/3.png 644 root bin
+f none usr/share/doc/ksh/images/callouts/4.png 644 root bin
+f none usr/share/doc/ksh/images/callouts/5.png 644 root bin
+f none usr/share/doc/ksh/images/callouts/6.png 644 root bin
+f none usr/share/doc/ksh/images/callouts/7.png 644 root bin
+f none usr/share/doc/ksh/images/callouts/8.png 644 root bin
+f none usr/share/doc/ksh/images/callouts/9.png 644 root bin
+f none usr/share/doc/ksh/images/callouts/10.png 644 root bin
+f none usr/share/doc/ksh/images/tag_bourne.png 644 root bin
+f none usr/share/doc/ksh/images/tag_i18n.png 644 root bin
+f none usr/share/doc/ksh/images/tag_ksh88.png 644 root bin
+f none usr/share/doc/ksh/images/tag_ksh93.png 644 root bin
+f none usr/share/doc/ksh/images/tag_ksh.png 644 root bin
+f none usr/share/doc/ksh/images/tag_l10n.png 644 root bin
+f none usr/share/doc/ksh/images/tag_perf.png 644 root bin
+f none usr/share/doc/ksh/shell_styleguide.docbook 644 root bin
+f none usr/share/doc/ksh/shell_styleguide.html 644 root bin
 d none usr/share/lib 755 root sys
 d none usr/share/lib/mailx 755 root bin
 f none usr/share/lib/mailx/mailx.help 644 root bin
--- old/usr/src/pkgdefs/SUNWesu/prototype_com   Fri Sep 25 06:45:28 2009
+++ new/usr/src/pkgdefs/SUNWesu/prototype_com   Fri Sep 25 06:45:26 2009
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # This required package information file contains a list of package contents.
@@ -53,7 +53,6 @@
 f none usr/bin/cal 555 root bin
 f none usr/bin/calendar 555 root bin
 f none usr/bin/col 555 root bin
-f none usr/bin/comm 555 root bin
 f none usr/bin/compress 555 root bin
 f none usr/bin/csplit 555 root bin
 f none usr/bin/dc 555 root bin
@@ -68,7 +67,6 @@
 f none usr/bin/kstat 555 root bin
 f none usr/bin/last 555 root bin
 f none usr/bin/lastcomm 555 root bin
-f none usr/bin/logname 555 root bin
 f none usr/bin/look 755 root bin
 f none usr/bin/lgrpinfo 555 root bin
 f none usr/bin/mkfifo 555 root bin
@@ -79,7 +77,6 @@
 l none usr/bin/oawk=../../usr/bin/awk
 f none usr/bin/pack 555 root bin
 l none usr/bin/pargs=../../usr/lib/isaexec
-f none usr/bin/paste 555 root bin
 s none usr/bin/pcat=./unpack
 l none usr/bin/pcred=../../usr/lib/isaexec
 l none usr/bin/pfiles=../../usr/lib/isaexec
@@ -108,7 +105,6 @@
 f none usr/bin/tcopy 555 root bin
 l none usr/bin/uncompress=../../usr/bin/compress
 f none usr/bin/unexpand 555 root bin
-f none usr/bin/uniq 555 root bin
 f none usr/bin/units 555 root bin
 f none usr/bin/unix2dos 555 root bin
 f none usr/bin/unpack 555 root bin
--- old/usr/src/pkgdefs/SUNWosdem/Makefile      Fri Sep 25 06:45:31 2009
+++ new/usr/src/pkgdefs/SUNWosdem/Makefile      Fri Sep 25 06:45:29 2009
@@ -18,21 +18,20 @@
 #
 # CDDL HEADER END
 #
+
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
 include ../Makefile.com
 
-DATAFILES += depend
-
 LICENSEFILES += \
        ../../lib/libshell/THIRDPARTYLICENSE
 
 .KEEP_STATE:
 
-all: $(FILES)
+all: $(FILES) depend
 
 install: all pkg
 
--- /dev/null   Fri Sep 25 06:45:34 2009
+++ new/usr/src/pkgdefs/SUNWosdem/depend        Fri Sep 25 06:45:32 2009
@@ -0,0 +1,58 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# This package information file defines software dependencies associated
+# with the pkg.  You can define three types of pkg dependencies with this file:
+#       P indicates a prerequisite for installation
+#       I indicates an incompatible package
+#       R indicates a reverse dependency
+# <pkg.abbr> see pkginfo(4), PKG parameter
+# <name> see pkginfo(4), NAME parameter
+# <version> see pkginfo(4), VERSION parameter
+# <arch> see pkginfo(4), ARCH parameter
+# <type> <pkg.abbr> <name>
+#      (<arch>)<version>
+#      (<arch>)<version>
+#      ...
+# <type> <pkg.abbr> <name>
+# ...
+#
+
+P SUNWcakr     Core Solaris Kernel Architecture (Root)
+P SUNWcar      Core Architecture, (Root)
+P SUNWckr      Core Solaris Kernel (Root)
+P SUNWcnetr    Core Solaris Network Infrastructure (Root)
+P SUNWcsd      Core Solaris Devices
+P SUNWcsl      Core Solaris Libraries
+P SUNWcsr      Core Solaris, (Root)
+P SUNWcsu      Core Solaris, (Usr)
+P SUNWesu      Extended System Utilities
+P SUNWkvm      Core Architecture, (Kvm)
+P SUNWopenssl-commands OpenSSL Commands (Usr)
+P SUNWwgetu    wget - GNU wget
+P SUNWxcu4     XCU4 Utilities
+P SUNWxcu6     XCU6 Utilities
--- old/usr/src/pkgdefs/SUNWosdem/prototype_com Fri Sep 25 06:45:36 2009
+++ new/usr/src/pkgdefs/SUNWosdem/prototype_com Fri Sep 25 06:45:35 2009
@@ -53,6 +53,7 @@
 f none usr/demo/ELF/tpcom.c 644 root bin
 d none usr/demo/ksh 755 root bin
 d none usr/demo/ksh/bin 755 root bin
+f none usr/demo/ksh/bin/cpvprint 755 root bin
 f none usr/demo/ksh/bin/crawlsrccomments 755 root bin
 f none usr/demo/ksh/bin/filemutexdemo1 755 root bin
 f none usr/demo/ksh/bin/filetree1 755 root bin
@@ -59,6 +60,7 @@
 f none usr/demo/ksh/bin/gnaw 755 root bin
 f none usr/demo/ksh/bin/mandelbrotset1 755 root bin
 f none usr/demo/ksh/bin/multifollow 755 root bin
+f none usr/demo/ksh/bin/numtree1 755 root bin
 f none usr/demo/ksh/bin/primenumbers1 755 root bin
 f none usr/demo/ksh/bin/rssread 755 root bin
 f none usr/demo/ksh/bin/shcalc 755 root bin
@@ -69,23 +71,44 @@
 f none usr/demo/ksh/bin/shpiano 755 root bin
 f none usr/demo/ksh/bin/shtinyurl 755 root bin
 f none usr/demo/ksh/bin/shtwitter 755 root bin
+f none usr/demo/ksh/bin/simplefileattributetree1 755 root bin
+f none usr/demo/ksh/bin/simplefiletree1 755 root bin
 f none usr/demo/ksh/bin/svcproptree1 755 root bin
 f none usr/demo/ksh/bin/termclock 755 root bin
 f none usr/demo/ksh/bin/test_net_sctp 755 root bin
 f none usr/demo/ksh/bin/xmldocumenttree1 755 root bin
-d none usr/demo/ksh/doc 755 root bin
-f none usr/demo/ksh/doc/COMPATIBILITY 644 root bin
-f none usr/demo/ksh/doc/DESIGN 644 root bin
-f none usr/demo/ksh/doc/OBSOLETE 644 root bin
-f none usr/demo/ksh/doc/README 644 root bin
-f none usr/demo/ksh/doc/RELEASE 644 root bin
-f none usr/demo/ksh/doc/TYPES 644 root bin
 d none usr/demo/ksh/fun 755 root bin
 f none usr/demo/ksh/fun/dirs 755 root bin
 f none usr/demo/ksh/fun/popd 755 root bin
 f none usr/demo/ksh/fun/pushd 755 root bin
 f none usr/demo/ksh/fun/title 755 root bin
+d none usr/demo/ksh/src 755 root bin
+f none usr/demo/ksh/src/cpvprint.sh 644 root bin
+f none usr/demo/ksh/src/crawlsrccomments.sh 644 root bin
+f none usr/demo/ksh/src/filemutexdemo1.sh 644 root bin
+f none usr/demo/ksh/src/filetree1.sh 644 root bin
+f none usr/demo/ksh/src/gnaw.sh 644 root bin
+f none usr/demo/ksh/src/mandelbrotset1.sh 644 root bin
+f none usr/demo/ksh/src/multifollow.sh 644 root bin
+f none usr/demo/ksh/src/numtree1.sh 644 root bin
+f none usr/demo/ksh/src/primenumbers1.sh 644 root bin
+f none usr/demo/ksh/src/rssread.sh 644 root bin
+f none usr/demo/ksh/src/shcalc.sh 644 root bin
+f none usr/demo/ksh/src/shircbot.sh 644 root bin
+f none usr/demo/ksh/src/shlint.sh 644 root bin
+f none usr/demo/ksh/src/shman.sh 644 root bin
+f none usr/demo/ksh/src/shnote.sh 644 root bin
+f none usr/demo/ksh/src/shpiano.sh 644 root bin
+f none usr/demo/ksh/src/shtinyurl.sh 644 root bin
+f none usr/demo/ksh/src/shtwitter.sh 644 root bin
+f none usr/demo/ksh/src/simplefileattributetree1.sh 644 root bin
+f none usr/demo/ksh/src/simplefiletree1.sh 644 root bin
+f none usr/demo/ksh/src/svcproptree1.sh 644 root bin
+f none usr/demo/ksh/src/termclock.sh 644 root bin
+f none usr/demo/ksh/src/test_net_sctp.sh 644 root bin
+f none usr/demo/ksh/src/xmldocumenttree1.sh 644 root bin
 d none usr/demo/ksh/tests 755 root bin
+f none usr/demo/ksh/tests/README.tests 644 root bin
 f none usr/demo/ksh/tests/alias.sh 644 root bin
 f none usr/demo/ksh/tests/append.sh 644 root bin
 f none usr/demo/ksh/tests/arith.sh 644 root bin
@@ -122,19 +145,36 @@
 f none usr/demo/ksh/tests/sigchld.sh 644 root bin
 f none usr/demo/ksh/tests/signal.sh 644 root bin
 f none usr/demo/ksh/tests/statics.sh 644 root bin
-f none usr/demo/ksh/tests/substring.sh 644 root bin
 f none usr/demo/ksh/tests/subshell.sh 644 root bin
+f none usr/demo/ksh/tests/substring.sh 644 root bin
+f none usr/demo/ksh/tests/sun_solaris_array_default_datatype.sh 644 root bin
+f none usr/demo/ksh/tests/sun_solaris_builtin_poll.sh 644 root bin
 f none usr/demo/ksh/tests/sun_solaris_builtin_sum.sh 644 root bin
+f none usr/demo/ksh/tests/sun_solaris_builtin_tail.sh 644 root bin
+f none usr/demo/ksh/tests/sun_solaris_command_substitution.sh 644 root bin
+f none usr/demo/ksh/tests/sun_solaris_compound_nameref.sh 644 root bin
 f none usr/demo/ksh/tests/sun_solaris_compoundvario.sh 644 root bin
-f none 
usr/demo/ksh/tests/sun_solaris_cr_6687139_command_substitution_exec_redirection_allocation_loop.sh
 644 root bin
 f none 
usr/demo/ksh/tests/sun_solaris_cr_6713682_compound_var_bleeds_through_subshell.sh
 644 root bin
+f none 
usr/demo/ksh/tests/sun_solaris_cr_6687139_command_substitution_exec_redirection_allocation_loop.sh
 644 root bin
 f none usr/demo/ksh/tests/sun_solaris_cr_6722134_background_CHLD_trap.sh 644 
root bin
 f none usr/demo/ksh/tests/sun_solaris_cr_6753538_subshell_leaks_umask.sh 644 
root bin
 f none 
usr/demo/ksh/tests/sun_solaris_cr_6754020_weird_square_bracket_expansion.sh 644 
root bin
 f none 
usr/demo/ksh/tests/sun_solaris_cr_6763594_command_failure_execs_twice.sh 644 
root bin
 f none usr/demo/ksh/tests/sun_solaris_cr_6766246_pattern_matching_bug.sh 644 
root bin
+f none 
usr/demo/ksh/tests/sun_solaris_cr_6769332_substitutions_terminate_shell_after_257_iterations.sh
 644 root bin
+f none 
usr/demo/ksh/tests/sun_solaris_cr_6777491_lacks_arithmetric_function_iszero.sh 
644 root bin
+f none usr/demo/ksh/tests/sun_solaris_cr_6778077_sigthaw_trap.sh 644 root bin
+f none usr/demo/ksh/tests/sun_solaris_cr_6789247_printf_hexfloat_rounding.sh 
644 root bin
 f none 
usr/demo/ksh/tests/sun_solaris_cr_6800929_large_command_substitution_hang.sh 
644 root bin
+f none usr/demo/ksh/tests/sun_solaris_cr_6805792_varmovetest1.sh 644 root bin
+f none 
usr/demo/ksh/tests/sun_solaris_cr_6805794_character_to_wchar_not_working.sh 644 
root bin
+f none usr/demo/ksh/tests/sun_solaris_cr_6805795_negative_zero.sh 644 root bin
 f none usr/demo/ksh/tests/sun_solaris_cr_6807179_shellpattern_uses_getpwnam.sh 
644 root bin
+f none usr/demo/ksh/tests/sun_solaris_cr_6835835_builtin_cat_n_broken.sh 644 
root bin
+f none 
usr/demo/ksh/tests/sun_solaris_cr_6848486_echo_test_with_test_undefined_executes_test_builtin.sh
 644 root bin
+f none 
usr/demo/ksh/tests/sun_solaris_cr_6855875_typeset_hexfloat_has_too_few_digits.sh
 644 root bin
+f none 
usr/demo/ksh/tests/sun_solaris_cr_6862121_shbinexec_kernel_module_defunct.sh 
644 root bin
+f none 
usr/demo/ksh/tests/sun_solaris_cr_6881017_background_process_in_subshell_hangs_caller.sh
 644 root bin
 f none usr/demo/ksh/tests/sun_solaris_getconf.sh 644 root bin
 f none usr/demo/ksh/tests/sun_solaris_local_compound_nameref001.sh 644 root bin
 f none usr/demo/ksh/tests/sun_solaris_staticvariables.sh 644 root bin
@@ -143,6 +183,7 @@
 f none usr/demo/ksh/tests/sun_solaris_vartree003.sh 644 root bin
 f none usr/demo/ksh/tests/tilde.sh 644 root bin
 f none usr/demo/ksh/tests/timetype.sh 644 root bin
+f none usr/demo/ksh/tests/treemove.sh 644 root bin
 f none usr/demo/ksh/tests/types.sh 644 root bin
 f none usr/demo/ksh/tests/variables.sh 644 root bin
 f none usr/demo/ksh/tests/vartree1.sh 644 root bin
--- old/usr/src/tools/findunref/exception_list.open     Fri Sep 25 06:45:39 2009
+++ new/usr/src/tools/findunref/exception_list.open     Fri Sep 25 06:45:38 2009
@@ -55,6 +55,7 @@
 # configuration with upstream.
 #
 ./usr/src/lib/libast/*/src/lib/libast/FEATURE
+./usr/src/lib/libast/*/src/lib/libast/ast_namval.h
 ./usr/src/lib/libast/common/comp/conf.*
 ./usr/src/lib/libast/common/features
 ./usr/src/lib/libast/common/include/ast_windows.h
--- old/usr/src/tools/scripts/bfu.sh    Fri Sep 25 06:45:43 2009
+++ new/usr/src/tools/scripts/bfu.sh    Fri Sep 25 06:45:41 2009
@@ -3008,9 +3008,37 @@
 #
 bfuchameleons="
         /usr/bin/basename
+        /usr/bin/bg
+        /usr/bin/cd
+        /usr/bin/cksum
+        /usr/bin/cmp
+        /usr/bin/comm
+        /usr/bin/command
         /usr/bin/dirname
+        /usr/bin/cut
+        /usr/bin/fc
+        /usr/bin/fg
+        /usr/bin/getopts
+        /usr/bin/hash
+        /usr/bin/jobs
+        /usr/bin/join
+        /usr/bin/kill
+        /usr/bin/logname
+        /usr/bin/paste
+        /usr/bin/print
+        /usr/bin/read
+        /usr/bin/rev
         /usr/bin/sleep
         /usr/bin/sum
+        /usr/bin/tee
+        /usr/bin/test
+        /usr/bin/type
+        /usr/bin/ulimit
+        /usr/bin/umask
+        /usr/bin/unalias
+        /usr/bin/uniq
+        /usr/bin/wait
+        /usr/bin/wc
 "
 
 for chameleon in ${bfuchameleons} ; do

Reply via email to