xref: /titanic_50/usr/src/lib/libshell/misc/ERRATA.txt (revision 3e14f97f673e8a630f076077de35afdd43dc1587)
1da2e3ebdSchin#
2da2e3ebdSchin# CDDL HEADER START
3da2e3ebdSchin#
4da2e3ebdSchin# The contents of this file are subject to the terms of the
5da2e3ebdSchin# Common Development and Distribution License (the "License").
6da2e3ebdSchin# You may not use this file except in compliance with the License.
7da2e3ebdSchin#
8da2e3ebdSchin# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9da2e3ebdSchin# or http://www.opensolaris.org/os/licensing.
10da2e3ebdSchin# See the License for the specific language governing permissions
11da2e3ebdSchin# and limitations under the License.
12da2e3ebdSchin#
13da2e3ebdSchin# When distributing Covered Code, include this CDDL HEADER in each
14da2e3ebdSchin# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15da2e3ebdSchin# If applicable, add the following below this CDDL HEADER, with the
16da2e3ebdSchin# fields enclosed by brackets "[]" replaced with your own identifying
17da2e3ebdSchin# information: Portions Copyright [yyyy] [name of copyright owner]
18da2e3ebdSchin#
19da2e3ebdSchin# CDDL HEADER END
20da2e3ebdSchin#
217c2fbfb3SApril Chin
22da2e3ebdSchin#
23*3e14f97fSRoger A. Faulkner# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
24da2e3ebdSchin#
25da2e3ebdSchin
26da2e3ebdSchin#
27da2e3ebdSchin# ERRATA.txt
28da2e3ebdSchin#
29da2e3ebdSchin# Errata/problems/notes about problems in the current sources
30da2e3ebdSchin#
31da2e3ebdSchin
32da2e3ebdSchin######## Errata #001: ########
337c2fbfb3SApril ChinThe usage of |posix_spawn()| has been manually disabled because there seems to be a
347c2fbfb3SApril Chinrace condition which cases sporadic failures like this:
3534f9b3eeSRoland Mainz-- snip --
367c2fbfb3SApril Chin$ builtin | fgrep sum | fgrep sum
377c2fbfb3SApril Chin/usr/ast/bin/sum
387c2fbfb3SApril Chin/usr/bin/sum
397c2fbfb3SApril Chin$ builtin | fgrep sum | fgrep sum
407c2fbfb3SApril Chinfgrep: fgrep: cannot execute [Exec format error]
417c2fbfb3SApril Chin-- snip --.
427c2fbfb3SApril ChinThe following files have been changed:
43da2e3ebdSchin-- snip --
447c2fbfb3SApril ChinIndex: src/lib/libast/sparcv9/include/ast/ast_lib.h
457c2fbfb3SApril Chin===================================================================
4634f9b3eeSRoland Mainz--- usr/src/lib/libast/sparcv9/include/ast/ast_lib.h	(revision 888)
4734f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparcv9/include/ast/ast_lib.h	(working copy)
487c2fbfb3SApril Chin@@ -160,7 +160,7 @@
497c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
507c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
517c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
527c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
537c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
547c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
557c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
567c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
577c2fbfb3SApril ChinIndex: src/lib/libast/sparcv9/src/lib/libast/ast_lib.h
587c2fbfb3SApril Chin===================================================================
5934f9b3eeSRoland Mainz--- usr/src/lib/libast/sparcv9/src/lib/libast/ast_lib.h	(revision 888)
6034f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparcv9/src/lib/libast/ast_lib.h	(working copy)
617c2fbfb3SApril Chin@@ -139,7 +139,7 @@
627c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
637c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
647c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
657c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
667c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
677c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
687c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
697c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
707c2fbfb3SApril ChinIndex: src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib
717c2fbfb3SApril Chin===================================================================
7234f9b3eeSRoland Mainz--- usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib	(revision 888)
7334f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib	(working copy)
747c2fbfb3SApril Chin@@ -139,7 +139,7 @@
757c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
767c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
777c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
787c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
797c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
807c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
817c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
827c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
837c2fbfb3SApril ChinIndex: src/lib/libast/sparc/include/ast/ast_lib.h
847c2fbfb3SApril Chin===================================================================
8534f9b3eeSRoland Mainz--- usr/src/lib/libast/sparc/include/ast/ast_lib.h	(revision 888)
8634f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparc/include/ast/ast_lib.h	(working copy)
877c2fbfb3SApril Chin@@ -171,7 +171,7 @@
887c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
897c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
907c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
917c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
927c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
937c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
947c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
957c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
967c2fbfb3SApril ChinIndex: src/lib/libast/sparc/src/lib/libast/ast_lib.h
977c2fbfb3SApril Chin===================================================================
9834f9b3eeSRoland Mainz--- usr/src/lib/libast/sparc/src/lib/libast/ast_lib.h	(revision 888)
9934f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparc/src/lib/libast/ast_lib.h	(working copy)
1007c2fbfb3SApril Chin@@ -150,7 +150,7 @@
1017c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
1027c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
1037c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
1047c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
1057c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
1067c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
1077c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
1087c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
1097c2fbfb3SApril ChinIndex: src/lib/libast/sparc/src/lib/libast/FEATURE/lib
1107c2fbfb3SApril Chin===================================================================
11134f9b3eeSRoland Mainz--- usr/src/lib/libast/sparc/src/lib/libast/FEATURE/lib	(revision 888)
11234f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparc/src/lib/libast/FEATURE/lib	(working copy)
1137c2fbfb3SApril Chin@@ -150,7 +150,7 @@
1147c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
1157c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
1167c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
1177c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
1187c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
1197c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
1207c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
1217c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
1227c2fbfb3SApril ChinIndex: src/lib/libast/i386/include/ast/ast_lib.h
1237c2fbfb3SApril Chin===================================================================
12434f9b3eeSRoland Mainz--- usr/src/lib/libast/i386/include/ast/ast_lib.h	(revision 888)
12534f9b3eeSRoland Mainz+++ usr/src/lib/libast/i386/include/ast/ast_lib.h	(working copy)
1267c2fbfb3SApril Chin@@ -171,7 +171,7 @@
1277c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
1287c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
1297c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
1307c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
1317c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
1327c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
1337c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
1347c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
1357c2fbfb3SApril ChinIndex: src/lib/libast/i386/src/lib/libast/ast_lib.h
1367c2fbfb3SApril Chin===================================================================
13734f9b3eeSRoland Mainz--- usr/src/lib/libast/i386/src/lib/libast/ast_lib.h	(revision 888)
13834f9b3eeSRoland Mainz+++ usr/src/lib/libast/i386/src/lib/libast/ast_lib.h	(working copy)
1397c2fbfb3SApril Chin@@ -150,7 +150,7 @@
1407c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
1417c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
1427c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
1437c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
1447c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
1457c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
1467c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
1477c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
1487c2fbfb3SApril ChinIndex: src/lib/libast/i386/src/lib/libast/FEATURE/lib
1497c2fbfb3SApril Chin===================================================================
15034f9b3eeSRoland Mainz--- usr/src/lib/libast/i386/src/lib/libast/FEATURE/lib	(revision 888)
15134f9b3eeSRoland Mainz+++ usr/src/lib/libast/i386/src/lib/libast/FEATURE/lib	(working copy)
1527c2fbfb3SApril Chin@@ -150,7 +150,7 @@
1537c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
1547c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
1557c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
1567c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
1577c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
1587c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
1597c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
1607c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
1617c2fbfb3SApril ChinIndex: src/lib/libast/amd64/include/ast/ast_lib.h
1627c2fbfb3SApril Chin===================================================================
16334f9b3eeSRoland Mainz--- usr/src/lib/libast/amd64/include/ast/ast_lib.h	(revision 888)
16434f9b3eeSRoland Mainz+++ usr/src/lib/libast/amd64/include/ast/ast_lib.h	(working copy)
1657c2fbfb3SApril Chin@@ -160,7 +160,7 @@
1667c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
1677c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
1687c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
1697c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
1707c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
1717c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
1727c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
1737c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
1747c2fbfb3SApril ChinIndex: src/lib/libast/amd64/src/lib/libast/ast_lib.h
1757c2fbfb3SApril Chin===================================================================
17634f9b3eeSRoland Mainz--- usr/src/lib/libast/amd64/src/lib/libast/ast_lib.h	(revision 888)
17734f9b3eeSRoland Mainz+++ usr/src/lib/libast/amd64/src/lib/libast/ast_lib.h	(working copy)
1787c2fbfb3SApril Chin@@ -139,7 +139,7 @@
1797c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
1807c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
1817c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
1827c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
1837c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
1847c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
1857c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
1867c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
1877c2fbfb3SApril ChinIndex: src/lib/libast/amd64/src/lib/libast/FEATURE/lib
1887c2fbfb3SApril Chin===================================================================
18934f9b3eeSRoland Mainz--- usr/src/lib/libast/amd64/src/lib/libast/FEATURE/lib	(revision 888)
19034f9b3eeSRoland Mainz+++ usr/src/lib/libast/amd64/src/lib/libast/FEATURE/lib	(working copy)
1917c2fbfb3SApril Chin@@ -139,7 +139,7 @@
1927c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
1937c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
1947c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
1957c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
1967c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
1977c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
1987c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
1997c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
200da2e3ebdSchin-- snip --
201da2e3ebdSchin
202da2e3ebdSchin
203da2e3ebdSchin######## Errata #002: ########
20434f9b3eeSRoland MainzThe usage of |mmap()| has been manually enabled to improve I/O performance.
20534f9b3eeSRoland MainzThe following files have been changed:
20634f9b3eeSRoland Mainz-- snip --
20734f9b3eeSRoland MainzIndex: usr/src/lib/libast/sparcv9/include/ast/ast_mmap.h
20834f9b3eeSRoland Mainz===================================================================
20934f9b3eeSRoland Mainz--- usr/src/lib/libast/sparcv9/include/ast/ast_mmap.h	(revision 1701)
21034f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparcv9/include/ast/ast_mmap.h	(working copy)
21134f9b3eeSRoland Mainz@@ -28,6 +28,7 @@
21234f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
21334f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
21434f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
21534f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
21634f9b3eeSRoland Mainz
21734f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
21834f9b3eeSRoland Mainz #ifndef _NO_MMAP
21934f9b3eeSRoland MainzIndex: usr/src/lib/libast/sparcv9/src/lib/libast/ast_mmap.h
22034f9b3eeSRoland Mainz===================================================================
22134f9b3eeSRoland Mainz--- usr/src/lib/libast/sparcv9/src/lib/libast/ast_mmap.h	(revision 1701)
22234f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparcv9/src/lib/libast/ast_mmap.h	(working copy)
22334f9b3eeSRoland Mainz@@ -7,6 +7,7 @@
22434f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
22534f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
22634f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
22734f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
22834f9b3eeSRoland Mainz
22934f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
23034f9b3eeSRoland Mainz #ifndef _NO_MMAP
23134f9b3eeSRoland MainzIndex: usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mmap
23234f9b3eeSRoland Mainz===================================================================
23334f9b3eeSRoland Mainz--- usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mmap	(revision 1701)
23434f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mmap	(working copy)
23534f9b3eeSRoland Mainz@@ -7,6 +7,7 @@
23634f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
23734f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
23834f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
23934f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
24034f9b3eeSRoland Mainz
24134f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
24234f9b3eeSRoland Mainz #ifndef _NO_MMAP
24334f9b3eeSRoland MainzIndex: usr/src/lib/libast/sparc/include/ast/ast_mmap.h
24434f9b3eeSRoland Mainz===================================================================
24534f9b3eeSRoland Mainz--- usr/src/lib/libast/sparc/include/ast/ast_mmap.h	(revision 1701)
24634f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparc/include/ast/ast_mmap.h	(working copy)
24734f9b3eeSRoland Mainz@@ -28,7 +28,7 @@
24834f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
24934f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
25034f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
25134f9b3eeSRoland Mainz-#define _mmap_worthy	1	/* mmap is good */
25234f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
25334f9b3eeSRoland Mainz
25434f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
25534f9b3eeSRoland Mainz #ifndef _NO_MMAP
25634f9b3eeSRoland MainzIndex: usr/src/lib/libast/sparc/src/lib/libast/ast_mmap.h
25734f9b3eeSRoland Mainz===================================================================
25834f9b3eeSRoland Mainz--- usr/src/lib/libast/sparc/src/lib/libast/ast_mmap.h	(revision 1701)
25934f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparc/src/lib/libast/ast_mmap.h	(working copy)
26034f9b3eeSRoland Mainz@@ -7,7 +7,7 @@
26134f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
26234f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
26334f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
26434f9b3eeSRoland Mainz-#define _mmap_worthy	1	/* mmap is good */
26534f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
26634f9b3eeSRoland Mainz
26734f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
26834f9b3eeSRoland Mainz #ifndef _NO_MMAP
26934f9b3eeSRoland MainzIndex: usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mmap
27034f9b3eeSRoland Mainz===================================================================
27134f9b3eeSRoland Mainz--- usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mmap	(revision 1701)
27234f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mmap	(working copy)
27334f9b3eeSRoland Mainz@@ -7,7 +7,7 @@
27434f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
27534f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
27634f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
27734f9b3eeSRoland Mainz-#define _mmap_worthy	1	/* mmap is good */
27834f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
27934f9b3eeSRoland Mainz
28034f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
28134f9b3eeSRoland Mainz #ifndef _NO_MMAP
28234f9b3eeSRoland MainzIndex: usr/src/lib/libast/i386/include/ast/ast_mmap.h
28334f9b3eeSRoland Mainz===================================================================
28434f9b3eeSRoland Mainz--- usr/src/lib/libast/i386/include/ast/ast_mmap.h	(revision 1701)
28534f9b3eeSRoland Mainz+++ usr/src/lib/libast/i386/include/ast/ast_mmap.h	(working copy)
28634f9b3eeSRoland Mainz@@ -28,6 +28,7 @@
28734f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
28834f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
28934f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
29034f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
29134f9b3eeSRoland Mainz
29234f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
29334f9b3eeSRoland Mainz #ifndef _NO_MMAP
29434f9b3eeSRoland MainzIndex: usr/src/lib/libast/i386/src/lib/libast/ast_mmap.h
29534f9b3eeSRoland Mainz===================================================================
29634f9b3eeSRoland Mainz--- usr/src/lib/libast/i386/src/lib/libast/ast_mmap.h	(revision 1701)
29734f9b3eeSRoland Mainz+++ usr/src/lib/libast/i386/src/lib/libast/ast_mmap.h	(working copy)
29834f9b3eeSRoland Mainz@@ -7,6 +7,7 @@
29934f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
30034f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
30134f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
30234f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
30334f9b3eeSRoland Mainz
30434f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
30534f9b3eeSRoland Mainz #ifndef _NO_MMAP
30634f9b3eeSRoland MainzIndex: usr/src/lib/libast/i386/src/lib/libast/FEATURE/mmap
30734f9b3eeSRoland Mainz===================================================================
30834f9b3eeSRoland Mainz--- usr/src/lib/libast/i386/src/lib/libast/FEATURE/mmap	(revision 1701)
30934f9b3eeSRoland Mainz+++ usr/src/lib/libast/i386/src/lib/libast/FEATURE/mmap	(working copy)
31034f9b3eeSRoland Mainz@@ -7,6 +7,7 @@
31134f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
31234f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
31334f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
31434f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
31534f9b3eeSRoland Mainz
31634f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
31734f9b3eeSRoland Mainz #ifndef _NO_MMAP
31834f9b3eeSRoland MainzIndex: usr/src/lib/libast/amd64/include/ast/ast_mmap.h
31934f9b3eeSRoland Mainz===================================================================
32034f9b3eeSRoland Mainz--- usr/src/lib/libast/amd64/include/ast/ast_mmap.h	(revision 1701)
32134f9b3eeSRoland Mainz+++ usr/src/lib/libast/amd64/include/ast/ast_mmap.h	(working copy)
32234f9b3eeSRoland Mainz@@ -28,6 +28,7 @@
32334f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
32434f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
32534f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
32634f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
32734f9b3eeSRoland Mainz
32834f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
32934f9b3eeSRoland Mainz #ifndef _NO_MMAP
33034f9b3eeSRoland MainzIndex: usr/src/lib/libast/amd64/src/lib/libast/ast_mmap.h
33134f9b3eeSRoland Mainz===================================================================
33234f9b3eeSRoland Mainz--- usr/src/lib/libast/amd64/src/lib/libast/ast_mmap.h	(revision 1701)
33334f9b3eeSRoland Mainz+++ usr/src/lib/libast/amd64/src/lib/libast/ast_mmap.h	(working copy)
33434f9b3eeSRoland Mainz@@ -7,6 +7,7 @@
33534f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
33634f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
33734f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
33834f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
33934f9b3eeSRoland Mainz
34034f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
34134f9b3eeSRoland Mainz #ifndef _NO_MMAP
34234f9b3eeSRoland MainzIndex: usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mmap
34334f9b3eeSRoland Mainz===================================================================
34434f9b3eeSRoland Mainz--- usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mmap	(revision 1701)
34534f9b3eeSRoland Mainz+++ usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mmap	(working copy)
34634f9b3eeSRoland Mainz@@ -7,6 +7,7 @@
34734f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
34834f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
34934f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
35034f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
35134f9b3eeSRoland Mainz
35234f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
35334f9b3eeSRoland Mainz #ifndef _NO_MMAP
35434f9b3eeSRoland Mainz-- snip --
35534f9b3eeSRoland Mainz
35634f9b3eeSRoland Mainz
35734f9b3eeSRoland Mainz######## Errata #003: ########
3587c2fbfb3SApril ChinA workaround was added for a problem with the "multiline" editor mode which
3597c2fbfb3SApril Chinoccurs when the edit line becomes longer than the terminal's width and the
3607c2fbfb3SApril Chinterminal cursor is not at position 0 when PS1 is send to the terminal.
361da2e3ebdSchin
3627c2fbfb3SApril ChinFor example: The user executes a $ printf "foo"<enter> # the prompt will start
3637c2fbfb3SApril Chinat position 3 instead of 0. If the user enters a command which is longer than
3647c2fbfb3SApril Chinthe terminal width and then removes enougth characters that the edit line fits
3657c2fbfb3SApril Chinagain into one line the "foo" at the beginning will be overwritten with the
3667c2fbfb3SApril Chinprompt.
3677c2fbfb3SApril Chin
3687c2fbfb3SApril ChinThe workaround is to add $(printf "%*s\r%s" COLUMNS "") at the beginning of
3697c2fbfb3SApril ChinPS1 set by /etc/ksh.kshrc, this causes the shell to move to the beginning
3707c2fbfb3SApril Chinof the next line if the terminal cursor is not at position 0.
371da2e3ebdSchin
372da2e3ebdSchin
37381af778eSCasper H.S. Dik######## Errata #004: ########
37434f9b3eeSRoland MainzThe POSIX "cksum"/CRC and AT&T "sum" codepaths in libsum have been reworked
37534f9b3eeSRoland Mainzand then backpoprted to address a performance regression on some
37634f9b3eeSRoland Mainzmachine/architecture combinations.
3779a6f360eSCasper H.S. DikThe following files have been changed:
3789a6f360eSCasper H.S. Dik-- snip --
37934f9b3eeSRoland MainzIndex: usr/src/lib/libsum/common/sum-crc.c
38034f9b3eeSRoland Mainz===================================================================
38134f9b3eeSRoland Mainz--- usr/src/lib/libsum/common/sum-crc.c	(revision 1724)
38234f9b3eeSRoland Mainz+++ usr/src/lib/libsum/common/sum-crc.c	(working copy)
38334f9b3eeSRoland Mainz@@ -48,7 +48,8 @@
38434f9b3eeSRoland Mainz 	Crcnum_t		init;
38534f9b3eeSRoland Mainz 	Crcnum_t		done;
38634f9b3eeSRoland Mainz 	Crcnum_t		xorsize;
38734f9b3eeSRoland Mainz-	Crcnum_t		tab[256];
38834f9b3eeSRoland Mainz+	const Crcnum_t		*tab; /* use |const| to give the compiler a hint that the data won't change */
38934f9b3eeSRoland Mainz+	Crcnum_t		tabdata[256];
39034f9b3eeSRoland Mainz 	unsigned int		addsize;
39134f9b3eeSRoland Mainz 	unsigned int		rotate;
39234f9b3eeSRoland Mainz } Crc_t;
39334f9b3eeSRoland Mainz@@ -56,6 +57,62 @@
39434f9b3eeSRoland Mainz #define CRC(p,s,c)		(s = (s >> 8) ^ (p)->tab[(s ^ (c)) & 0xff])
39534f9b3eeSRoland Mainz #define CRCROTATE(p,s,c)	(s = (s << 8) ^ (p)->tab[((s >> 24) ^ (c)) & 0xff])
3969a6f360eSCasper H.S. Dik
39734f9b3eeSRoland Mainz+static const
39834f9b3eeSRoland Mainz+Crcnum_t posix_cksum_tab[256] = {
39934f9b3eeSRoland Mainz+	0x00000000U,
40034f9b3eeSRoland Mainz+	0x04c11db7U, 0x09823b6eU, 0x0d4326d9U, 0x130476dcU, 0x17c56b6bU,
40134f9b3eeSRoland Mainz+	0x1a864db2U, 0x1e475005U, 0x2608edb8U, 0x22c9f00fU, 0x2f8ad6d6U,
40234f9b3eeSRoland Mainz+	0x2b4bcb61U, 0x350c9b64U, 0x31cd86d3U, 0x3c8ea00aU, 0x384fbdbdU,
40334f9b3eeSRoland Mainz+	0x4c11db70U, 0x48d0c6c7U, 0x4593e01eU, 0x4152fda9U, 0x5f15adacU,
40434f9b3eeSRoland Mainz+	0x5bd4b01bU, 0x569796c2U, 0x52568b75U, 0x6a1936c8U, 0x6ed82b7fU,
40534f9b3eeSRoland Mainz+	0x639b0da6U, 0x675a1011U, 0x791d4014U, 0x7ddc5da3U, 0x709f7b7aU,
40634f9b3eeSRoland Mainz+	0x745e66cdU, 0x9823b6e0U, 0x9ce2ab57U, 0x91a18d8eU, 0x95609039U,
40734f9b3eeSRoland Mainz+	0x8b27c03cU, 0x8fe6dd8bU, 0x82a5fb52U, 0x8664e6e5U, 0xbe2b5b58U,
40834f9b3eeSRoland Mainz+	0xbaea46efU, 0xb7a96036U, 0xb3687d81U, 0xad2f2d84U, 0xa9ee3033U,
40934f9b3eeSRoland Mainz+	0xa4ad16eaU, 0xa06c0b5dU, 0xd4326d90U, 0xd0f37027U, 0xddb056feU,
41034f9b3eeSRoland Mainz+	0xd9714b49U, 0xc7361b4cU, 0xc3f706fbU, 0xceb42022U, 0xca753d95U,
41134f9b3eeSRoland Mainz+	0xf23a8028U, 0xf6fb9d9fU, 0xfbb8bb46U, 0xff79a6f1U, 0xe13ef6f4U,
41234f9b3eeSRoland Mainz+	0xe5ffeb43U, 0xe8bccd9aU, 0xec7dd02dU, 0x34867077U, 0x30476dc0U,
41334f9b3eeSRoland Mainz+	0x3d044b19U, 0x39c556aeU, 0x278206abU, 0x23431b1cU, 0x2e003dc5U,
41434f9b3eeSRoland Mainz+	0x2ac12072U, 0x128e9dcfU, 0x164f8078U, 0x1b0ca6a1U, 0x1fcdbb16U,
41534f9b3eeSRoland Mainz+	0x018aeb13U, 0x054bf6a4U, 0x0808d07dU, 0x0cc9cdcaU, 0x7897ab07U,
41634f9b3eeSRoland Mainz+	0x7c56b6b0U, 0x71159069U, 0x75d48ddeU, 0x6b93dddbU, 0x6f52c06cU,
41734f9b3eeSRoland Mainz+	0x6211e6b5U, 0x66d0fb02U, 0x5e9f46bfU, 0x5a5e5b08U, 0x571d7dd1U,
41834f9b3eeSRoland Mainz+	0x53dc6066U, 0x4d9b3063U, 0x495a2dd4U, 0x44190b0dU, 0x40d816baU,
41934f9b3eeSRoland Mainz+	0xaca5c697U, 0xa864db20U, 0xa527fdf9U, 0xa1e6e04eU, 0xbfa1b04bU,
42034f9b3eeSRoland Mainz+	0xbb60adfcU, 0xb6238b25U, 0xb2e29692U, 0x8aad2b2fU, 0x8e6c3698U,
42134f9b3eeSRoland Mainz+	0x832f1041U, 0x87ee0df6U, 0x99a95df3U, 0x9d684044U, 0x902b669dU,
42234f9b3eeSRoland Mainz+	0x94ea7b2aU, 0xe0b41de7U, 0xe4750050U, 0xe9362689U, 0xedf73b3eU,
42334f9b3eeSRoland Mainz+	0xf3b06b3bU, 0xf771768cU, 0xfa325055U, 0xfef34de2U, 0xc6bcf05fU,
42434f9b3eeSRoland Mainz+	0xc27dede8U, 0xcf3ecb31U, 0xcbffd686U, 0xd5b88683U, 0xd1799b34U,
42534f9b3eeSRoland Mainz+	0xdc3abdedU, 0xd8fba05aU, 0x690ce0eeU, 0x6dcdfd59U, 0x608edb80U,
42634f9b3eeSRoland Mainz+	0x644fc637U, 0x7a089632U, 0x7ec98b85U, 0x738aad5cU, 0x774bb0ebU,
42734f9b3eeSRoland Mainz+	0x4f040d56U, 0x4bc510e1U, 0x46863638U, 0x42472b8fU, 0x5c007b8aU,
42834f9b3eeSRoland Mainz+	0x58c1663dU, 0x558240e4U, 0x51435d53U, 0x251d3b9eU, 0x21dc2629U,
42934f9b3eeSRoland Mainz+	0x2c9f00f0U, 0x285e1d47U, 0x36194d42U, 0x32d850f5U, 0x3f9b762cU,
43034f9b3eeSRoland Mainz+	0x3b5a6b9bU, 0x0315d626U, 0x07d4cb91U, 0x0a97ed48U, 0x0e56f0ffU,
43134f9b3eeSRoland Mainz+	0x1011a0faU, 0x14d0bd4dU, 0x19939b94U, 0x1d528623U, 0xf12f560eU,
43234f9b3eeSRoland Mainz+	0xf5ee4bb9U, 0xf8ad6d60U, 0xfc6c70d7U, 0xe22b20d2U, 0xe6ea3d65U,
43334f9b3eeSRoland Mainz+	0xeba91bbcU, 0xef68060bU, 0xd727bbb6U, 0xd3e6a601U, 0xdea580d8U,
43434f9b3eeSRoland Mainz+	0xda649d6fU, 0xc423cd6aU, 0xc0e2d0ddU, 0xcda1f604U, 0xc960ebb3U,
43534f9b3eeSRoland Mainz+	0xbd3e8d7eU, 0xb9ff90c9U, 0xb4bcb610U, 0xb07daba7U, 0xae3afba2U,
43634f9b3eeSRoland Mainz+	0xaafbe615U, 0xa7b8c0ccU, 0xa379dd7bU, 0x9b3660c6U, 0x9ff77d71U,
43734f9b3eeSRoland Mainz+	0x92b45ba8U, 0x9675461fU, 0x8832161aU, 0x8cf30badU, 0x81b02d74U,
43834f9b3eeSRoland Mainz+	0x857130c3U, 0x5d8a9099U, 0x594b8d2eU, 0x5408abf7U, 0x50c9b640U,
43934f9b3eeSRoland Mainz+	0x4e8ee645U, 0x4a4ffbf2U, 0x470cdd2bU, 0x43cdc09cU, 0x7b827d21U,
44034f9b3eeSRoland Mainz+	0x7f436096U, 0x7200464fU, 0x76c15bf8U, 0x68860bfdU, 0x6c47164aU,
44134f9b3eeSRoland Mainz+	0x61043093U, 0x65c52d24U, 0x119b4be9U, 0x155a565eU, 0x18197087U,
44234f9b3eeSRoland Mainz+	0x1cd86d30U, 0x029f3d35U, 0x065e2082U, 0x0b1d065bU, 0x0fdc1becU,
44334f9b3eeSRoland Mainz+	0x3793a651U, 0x3352bbe6U, 0x3e119d3fU, 0x3ad08088U, 0x2497d08dU,
44434f9b3eeSRoland Mainz+	0x2056cd3aU, 0x2d15ebe3U, 0x29d4f654U, 0xc5a92679U, 0xc1683bceU,
44534f9b3eeSRoland Mainz+	0xcc2b1d17U, 0xc8ea00a0U, 0xd6ad50a5U, 0xd26c4d12U, 0xdf2f6bcbU,
44634f9b3eeSRoland Mainz+	0xdbee767cU, 0xe3a1cbc1U, 0xe760d676U, 0xea23f0afU, 0xeee2ed18U,
44734f9b3eeSRoland Mainz+	0xf0a5bd1dU, 0xf464a0aaU, 0xf9278673U, 0xfde69bc4U, 0x89b8fd09U,
44834f9b3eeSRoland Mainz+	0x8d79e0beU, 0x803ac667U, 0x84fbdbd0U, 0x9abc8bd5U, 0x9e7d9662U,
44934f9b3eeSRoland Mainz+	0x933eb0bbU, 0x97ffad0cU, 0xafb010b1U, 0xab710d06U, 0xa6322bdfU,
45034f9b3eeSRoland Mainz+	0xa2f33668U, 0xbcb4666dU, 0xb8757bdaU, 0xb5365d03U, 0xb1f740b4U
45134f9b3eeSRoland Mainz+};
45234f9b3eeSRoland Mainz+
45334f9b3eeSRoland Mainz static Sum_t*
45434f9b3eeSRoland Mainz crc_open(const Method_t* method, const char* name)
45534f9b3eeSRoland Mainz {
45634f9b3eeSRoland Mainz@@ -73,62 +130,80 @@
45734f9b3eeSRoland Mainz 		sum->method = (Method_t*)method;
45834f9b3eeSRoland Mainz 		sum->name = name;
45934f9b3eeSRoland Mainz 	}
46034f9b3eeSRoland Mainz-	polynomial = 0xedb88320;
46134f9b3eeSRoland Mainz-	s = name;
46234f9b3eeSRoland Mainz-	while (*(t = s))
46334f9b3eeSRoland Mainz+
46434f9b3eeSRoland Mainz+	if(!strcmp(name, "crc-0x04c11db7-rotate-done-size"))
46534f9b3eeSRoland Mainz 	{
46634f9b3eeSRoland Mainz-		for (t = s, v = 0; *s && *s != '-'; s++)
46734f9b3eeSRoland Mainz-			if (*s == '=' && !v)
46834f9b3eeSRoland Mainz-				v = s;
46934f9b3eeSRoland Mainz-		i = (v ? v : s) - t;
47034f9b3eeSRoland Mainz-		if (isdigit(*t) || v && i >= 4 && strneq(t, "poly", 4) && (t = v + 1))
47134f9b3eeSRoland Mainz-			polynomial = strtoul(t, NiL, 0);
47234f9b3eeSRoland Mainz-		else if (strneq(t, "done", i))
47334f9b3eeSRoland Mainz-			sum->done = v ? strtoul(v + 1, NiL, 0) : ~sum->done;
47434f9b3eeSRoland Mainz-		else if (strneq(t, "init", i))
47534f9b3eeSRoland Mainz-			sum->init = v ? strtoul(v + 1, NiL, 0) : ~sum->init;
47634f9b3eeSRoland Mainz-		else if (strneq(t, "rotate", i))
47734f9b3eeSRoland Mainz-			sum->rotate = 1;
47834f9b3eeSRoland Mainz-		else if (strneq(t, "size", i))
47934f9b3eeSRoland Mainz-		{
48034f9b3eeSRoland Mainz-			sum->addsize = 1;
48134f9b3eeSRoland Mainz-			if (v)
48234f9b3eeSRoland Mainz-				sum->xorsize = strtoul(v + 1, NiL, 0);
48334f9b3eeSRoland Mainz-		}
48434f9b3eeSRoland Mainz-		if (*s == '-')
48534f9b3eeSRoland Mainz-			s++;
48634f9b3eeSRoland Mainz+		sum->init=0;
48734f9b3eeSRoland Mainz+		sum->done=0xffffffff;
48834f9b3eeSRoland Mainz+		sum->xorsize=0x0;
48934f9b3eeSRoland Mainz+		sum->addsize=0x1;
49034f9b3eeSRoland Mainz+		sum->rotate=1;
49134f9b3eeSRoland Mainz+
49234f9b3eeSRoland Mainz+		/* Optimized codepath for POSIX cksum to save startup time */
49334f9b3eeSRoland Mainz+		sum->tab=posix_cksum_tab;
49434f9b3eeSRoland Mainz 	}
49534f9b3eeSRoland Mainz-	if (sum->rotate)
49634f9b3eeSRoland Mainz+	else
49734f9b3eeSRoland Mainz 	{
49834f9b3eeSRoland Mainz-		Crcnum_t	t;
49934f9b3eeSRoland Mainz-		Crcnum_t	p[8];
50034f9b3eeSRoland Mainz-
50134f9b3eeSRoland Mainz-		p[0] = polynomial;
50234f9b3eeSRoland Mainz-		for (i = 1; i < 8; i++)
50334f9b3eeSRoland Mainz-			p[i] = (p[i-1] << 1) ^ ((p[i-1] & 0x80000000) ? polynomial : 0);
50434f9b3eeSRoland Mainz-		for (i = 0; i < elementsof(sum->tab); i++)
50534f9b3eeSRoland Mainz+		polynomial = 0xedb88320;
50634f9b3eeSRoland Mainz+		s = name;
50734f9b3eeSRoland Mainz+		while (*(t = s))
50834f9b3eeSRoland Mainz 		{
50934f9b3eeSRoland Mainz-			t = 0;
51034f9b3eeSRoland Mainz-			x = i;
51134f9b3eeSRoland Mainz-			for (j = 0; j < 8; j++)
51234f9b3eeSRoland Mainz+			for (t = s, v = 0; *s && *s != '-'; s++)
51334f9b3eeSRoland Mainz+				if (*s == '=' && !v)
51434f9b3eeSRoland Mainz+					v = s;
51534f9b3eeSRoland Mainz+			i = (v ? v : s) - t;
51634f9b3eeSRoland Mainz+			if (isdigit(*t) || v && i >= 4 && strneq(t, "poly", 4) && (t = v + 1))
51734f9b3eeSRoland Mainz+				polynomial = strtoul(t, NiL, 0);
51834f9b3eeSRoland Mainz+			else if (strneq(t, "done", i))
51934f9b3eeSRoland Mainz+				sum->done = v ? strtoul(v + 1, NiL, 0) : ~sum->done;
52034f9b3eeSRoland Mainz+			else if (strneq(t, "init", i))
52134f9b3eeSRoland Mainz+				sum->init = v ? strtoul(v + 1, NiL, 0) : ~sum->init;
52234f9b3eeSRoland Mainz+			else if (strneq(t, "rotate", i))
52334f9b3eeSRoland Mainz+				sum->rotate = 1;
52434f9b3eeSRoland Mainz+			else if (strneq(t, "size", i))
52534f9b3eeSRoland Mainz 			{
52634f9b3eeSRoland Mainz-				if (x & 1)
52734f9b3eeSRoland Mainz-					t ^= p[j];
52834f9b3eeSRoland Mainz-				x >>= 1;
52934f9b3eeSRoland Mainz+				sum->addsize = 1;
53034f9b3eeSRoland Mainz+				if (v)
53134f9b3eeSRoland Mainz+					sum->xorsize = strtoul(v + 1, NiL, 0);
53234f9b3eeSRoland Mainz 			}
53334f9b3eeSRoland Mainz-			sum->tab[i] = t;
53434f9b3eeSRoland Mainz+			if (*s == '-')
53534f9b3eeSRoland Mainz+				s++;
53634f9b3eeSRoland Mainz 		}
53734f9b3eeSRoland Mainz-	}
53834f9b3eeSRoland Mainz-	else
53934f9b3eeSRoland Mainz-	{
54034f9b3eeSRoland Mainz-		for (i = 0; i < elementsof(sum->tab); i++)
54134f9b3eeSRoland Mainz+		if (sum->rotate)
54234f9b3eeSRoland Mainz 		{
54334f9b3eeSRoland Mainz-			x = i;
54434f9b3eeSRoland Mainz-			for (j = 0; j < 8; j++)
54534f9b3eeSRoland Mainz-				x = (x>>1) ^ ((x & 1) ? polynomial : 0);
54634f9b3eeSRoland Mainz-			sum->tab[i] = x;
54734f9b3eeSRoland Mainz+			Crcnum_t	t;
54834f9b3eeSRoland Mainz+			Crcnum_t	p[8];
54934f9b3eeSRoland Mainz+
55034f9b3eeSRoland Mainz+			p[0] = polynomial;
55134f9b3eeSRoland Mainz+			for (i = 1; i < 8; i++)
55234f9b3eeSRoland Mainz+				p[i] = (p[i-1] << 1) ^ ((p[i-1] & 0x80000000) ? polynomial : 0);
55334f9b3eeSRoland Mainz+			for (i = 0; i < elementsof(sum->tabdata); i++)
55434f9b3eeSRoland Mainz+			{
55534f9b3eeSRoland Mainz+				t = 0;
55634f9b3eeSRoland Mainz+				x = i;
55734f9b3eeSRoland Mainz+				for (j = 0; j < 8; j++)
55834f9b3eeSRoland Mainz+				{
55934f9b3eeSRoland Mainz+					if (x & 1)
56034f9b3eeSRoland Mainz+						t ^= p[j];
56134f9b3eeSRoland Mainz+					x >>= 1;
56234f9b3eeSRoland Mainz+				}
56334f9b3eeSRoland Mainz+				sum->tabdata[i] = t;
56434f9b3eeSRoland Mainz+			}
56534f9b3eeSRoland Mainz 		}
56634f9b3eeSRoland Mainz+		else
56734f9b3eeSRoland Mainz+		{
56834f9b3eeSRoland Mainz+			for (i = 0; i < elementsof(sum->tabdata); i++)
56934f9b3eeSRoland Mainz+			{
57034f9b3eeSRoland Mainz+				x = i;
57134f9b3eeSRoland Mainz+				for (j = 0; j < 8; j++)
57234f9b3eeSRoland Mainz+					x = (x>>1) ^ ((x & 1) ? polynomial : 0);
57334f9b3eeSRoland Mainz+				sum->tabdata[i] = x;
57434f9b3eeSRoland Mainz+			}
57534f9b3eeSRoland Mainz+		}
57634f9b3eeSRoland Mainz+
57734f9b3eeSRoland Mainz+		sum->tab=sum->tabdata;
57834f9b3eeSRoland Mainz 	}
57934f9b3eeSRoland Mainz+
58034f9b3eeSRoland Mainz 	return (Sum_t*)sum;
58134f9b3eeSRoland Mainz }
58234f9b3eeSRoland Mainz
58334f9b3eeSRoland Mainz@@ -141,11 +216,77 @@
58434f9b3eeSRoland Mainz 	return 0;
58534f9b3eeSRoland Mainz }
58634f9b3eeSRoland Mainz
58734f9b3eeSRoland Mainz+#if defined(__SUNPRO_C) || defined(__GNUC__)
58834f9b3eeSRoland Mainz+
58934f9b3eeSRoland Mainz+#if defined(__SUNPRO_C)
59034f9b3eeSRoland Mainz+#    include <sun_prefetch.h>
59134f9b3eeSRoland Mainz+#    define sum_prefetch(addr) sun_prefetch_read_many((void *)(addr))
59234f9b3eeSRoland Mainz+#elif defined(__GNUC__)
59334f9b3eeSRoland Mainz+#    define sum_prefetch(addr) __builtin_prefetch((addr), 0, 3)
59434f9b3eeSRoland Mainz+#else
59534f9b3eeSRoland Mainz+#    error Unknown compiler
59634f9b3eeSRoland Mainz+#endif
59734f9b3eeSRoland Mainz+
59834f9b3eeSRoland Mainz+#define CBLOCK_SIZE (64)
59934f9b3eeSRoland Mainz+#pragma unroll(16)
60034f9b3eeSRoland Mainz+
60134f9b3eeSRoland Mainz static int
60234f9b3eeSRoland Mainz crc_block(Sum_t* p, const void* s, size_t n)
60334f9b3eeSRoland Mainz {
60434f9b3eeSRoland Mainz 	Crc_t*			sum = (Crc_t*)p;
60534f9b3eeSRoland Mainz 	register Crcnum_t	c = sum->sum;
60634f9b3eeSRoland Mainz+	register const unsigned char*	b = (const unsigned char*)s;
60734f9b3eeSRoland Mainz+	register const unsigned char*	e = b + n;
60834f9b3eeSRoland Mainz+	unsigned short i;
60934f9b3eeSRoland Mainz+
61034f9b3eeSRoland Mainz+	sum_prefetch(b);
61134f9b3eeSRoland Mainz+
61234f9b3eeSRoland Mainz+	if (sum->rotate)
61334f9b3eeSRoland Mainz+	{
61434f9b3eeSRoland Mainz+		while (n > CBLOCK_SIZE)
61534f9b3eeSRoland Mainz+		{
61634f9b3eeSRoland Mainz+			sum_prefetch(b+CBLOCK_SIZE);
61734f9b3eeSRoland Mainz+			for(i=0 ; i < CBLOCK_SIZE ; i++)
61834f9b3eeSRoland Mainz+			{
61934f9b3eeSRoland Mainz+				CRCROTATE(sum, c, *b++);
62034f9b3eeSRoland Mainz+			}
62134f9b3eeSRoland Mainz+
62234f9b3eeSRoland Mainz+			n-=CBLOCK_SIZE;
62334f9b3eeSRoland Mainz+		}
62434f9b3eeSRoland Mainz+
62534f9b3eeSRoland Mainz+		while (b < e)
62634f9b3eeSRoland Mainz+		{
62734f9b3eeSRoland Mainz+			CRCROTATE(sum, c, *b++);
62834f9b3eeSRoland Mainz+		}
62934f9b3eeSRoland Mainz+	}
63034f9b3eeSRoland Mainz+	else
63134f9b3eeSRoland Mainz+	{
63234f9b3eeSRoland Mainz+		while (n > CBLOCK_SIZE)
63334f9b3eeSRoland Mainz+		{
63434f9b3eeSRoland Mainz+			sum_prefetch(b+CBLOCK_SIZE);
63534f9b3eeSRoland Mainz+			for(i=0 ; i < CBLOCK_SIZE ; i++)
63634f9b3eeSRoland Mainz+			{
63734f9b3eeSRoland Mainz+				CRC(sum, c, *b++);
63834f9b3eeSRoland Mainz+			}
63934f9b3eeSRoland Mainz+
64034f9b3eeSRoland Mainz+			n-=CBLOCK_SIZE;
64134f9b3eeSRoland Mainz+		}
64234f9b3eeSRoland Mainz+
64334f9b3eeSRoland Mainz+		while (b < e)
64434f9b3eeSRoland Mainz+		{
64534f9b3eeSRoland Mainz+			CRC(sum, c, *b++);
64634f9b3eeSRoland Mainz+		}
64734f9b3eeSRoland Mainz+	}
64834f9b3eeSRoland Mainz+
64934f9b3eeSRoland Mainz+	sum->sum = c;
65034f9b3eeSRoland Mainz+	return 0;
65134f9b3eeSRoland Mainz+}
65234f9b3eeSRoland Mainz+#else
65334f9b3eeSRoland Mainz+static int
65434f9b3eeSRoland Mainz+crc_block(Sum_t* p, const void* s, size_t n)
65534f9b3eeSRoland Mainz+{
65634f9b3eeSRoland Mainz+	Crc_t*			sum = (Crc_t*)p;
65734f9b3eeSRoland Mainz+	register Crcnum_t	c = sum->sum;
65834f9b3eeSRoland Mainz 	register unsigned char*	b = (unsigned char*)s;
65934f9b3eeSRoland Mainz 	register unsigned char*	e = b + n;
66034f9b3eeSRoland Mainz
66134f9b3eeSRoland Mainz@@ -158,6 +299,7 @@
66234f9b3eeSRoland Mainz 	sum->sum = c;
66334f9b3eeSRoland Mainz 	return 0;
66434f9b3eeSRoland Mainz }
66534f9b3eeSRoland Mainz+#endif /* defined(__SUNPRO_C) || defined(__GNUC__) */
66634f9b3eeSRoland Mainz
66734f9b3eeSRoland Mainz static int
66834f9b3eeSRoland Mainz crc_done(Sum_t* p)
66934f9b3eeSRoland MainzIndex: usr/src/lib/libsum/common/sum-att.c
67034f9b3eeSRoland Mainz===================================================================
67134f9b3eeSRoland Mainz--- usr/src/lib/libsum/common/sum-att.c	(revision 1724)
67234f9b3eeSRoland Mainz+++ usr/src/lib/libsum/common/sum-att.c	(working copy)
67334f9b3eeSRoland Mainz@@ -35,10 +35,73 @@
67434f9b3eeSRoland Mainz #define att_data	long_data
67534f9b3eeSRoland Mainz #define att_scale	512
67634f9b3eeSRoland Mainz
67734f9b3eeSRoland Mainz+#if defined(__SUNPRO_C) || defined(__GNUC__)
67834f9b3eeSRoland Mainz+
67934f9b3eeSRoland Mainz+#if defined(__SUNPRO_C)
68034f9b3eeSRoland Mainz+#    include <sun_prefetch.h>
68134f9b3eeSRoland Mainz+#    define sum_prefetch(addr) sun_prefetch_read_many((void *)(addr))
68234f9b3eeSRoland Mainz+#elif defined(__GNUC__)
68334f9b3eeSRoland Mainz+#    define sum_prefetch(addr) __builtin_prefetch((addr), 0, 3)
68434f9b3eeSRoland Mainz+#else
68534f9b3eeSRoland Mainz+#    error Unknown compiler
68634f9b3eeSRoland Mainz+#endif
68734f9b3eeSRoland Mainz+
68834f9b3eeSRoland Mainz+#define CBLOCK_SIZE (64)
68934f9b3eeSRoland Mainz+#pragma unroll(16)
69034f9b3eeSRoland Mainz+
69134f9b3eeSRoland Mainz+/* Inmos transputer would love this algorithm */
69234f9b3eeSRoland Mainz static int
69334f9b3eeSRoland Mainz att_block(register Sum_t* p, const void* s, size_t n)
69434f9b3eeSRoland Mainz {
69534f9b3eeSRoland Mainz 	register uint32_t	c = ((Integral_t*)p)->sum;
69634f9b3eeSRoland Mainz+	register const unsigned char*	b = (const unsigned char*)s;
69734f9b3eeSRoland Mainz+	register const unsigned char*	e = b + n;
69834f9b3eeSRoland Mainz+	register uint32_t s0, s1, s2, s3, s4, s5, s6, s7;
69934f9b3eeSRoland Mainz+	register unsigned int i;
70034f9b3eeSRoland Mainz+
70134f9b3eeSRoland Mainz+	s0=s1=s2=s3=s4=s5=s6=s7=0U;
70234f9b3eeSRoland Mainz+
70334f9b3eeSRoland Mainz+	sum_prefetch((void *)b);
70434f9b3eeSRoland Mainz+
70534f9b3eeSRoland Mainz+	while (n > CBLOCK_SIZE)
70634f9b3eeSRoland Mainz+	{
70734f9b3eeSRoland Mainz+		sum_prefetch((b+CBLOCK_SIZE));
70834f9b3eeSRoland Mainz+
70934f9b3eeSRoland Mainz+		/* Compiler will unroll for() loops per #pragma unroll */
71034f9b3eeSRoland Mainz+		for (i=0 ; i < (CBLOCK_SIZE/8) ; i++)
71134f9b3eeSRoland Mainz+		{
71234f9b3eeSRoland Mainz+			/*
71334f9b3eeSRoland Mainz+			 * use s0-s7 to decouple calculations (this improves pipelining)
71434f9b3eeSRoland Mainz+			 * because each operation is completely independent from it's
71534f9b3eeSRoland Mainz+			 * siblings
71634f9b3eeSRoland Mainz+			 */
71734f9b3eeSRoland Mainz+			s0+=b[0];
71834f9b3eeSRoland Mainz+			s1+=b[1];
71934f9b3eeSRoland Mainz+			s2+=b[2];
72034f9b3eeSRoland Mainz+			s3+=b[3];
72134f9b3eeSRoland Mainz+			s4+=b[4];
72234f9b3eeSRoland Mainz+			s5+=b[5];
72334f9b3eeSRoland Mainz+			s6+=b[6];
72434f9b3eeSRoland Mainz+			s7+=b[7];
72534f9b3eeSRoland Mainz+
72634f9b3eeSRoland Mainz+			b+=8;
72734f9b3eeSRoland Mainz+			n-=8;
72834f9b3eeSRoland Mainz+		}
72934f9b3eeSRoland Mainz+	}
73034f9b3eeSRoland Mainz+
73134f9b3eeSRoland Mainz+	c+=s0+s1+s2+s3+s4+s5+s6+s7;
73234f9b3eeSRoland Mainz+
73334f9b3eeSRoland Mainz+	while (b < e)
73434f9b3eeSRoland Mainz+		c += *b++;
73534f9b3eeSRoland Mainz+	((Integral_t*)p)->sum = c;
73634f9b3eeSRoland Mainz+	return 0;
73734f9b3eeSRoland Mainz+}
73834f9b3eeSRoland Mainz+
73934f9b3eeSRoland Mainz+#else
74034f9b3eeSRoland Mainz+static int
74134f9b3eeSRoland Mainz+att_block(register Sum_t* p, const void* s, size_t n)
74234f9b3eeSRoland Mainz+{
74334f9b3eeSRoland Mainz+	register uint32_t	c = ((Integral_t*)p)->sum;
74434f9b3eeSRoland Mainz 	register unsigned char*	b = (unsigned char*)s;
74534f9b3eeSRoland Mainz 	register unsigned char*	e = b + n;
74634f9b3eeSRoland Mainz
74734f9b3eeSRoland Mainz@@ -47,6 +110,7 @@
74834f9b3eeSRoland Mainz 	((Integral_t*)p)->sum = c;
74934f9b3eeSRoland Mainz 	return 0;
75034f9b3eeSRoland Mainz }
75134f9b3eeSRoland Mainz+#endif /* defined(__SUNPRO_C) || defined(__GNUC__) */
75234f9b3eeSRoland Mainz
75334f9b3eeSRoland Mainz static int
75434f9b3eeSRoland Mainz att_done(Sum_t* p)
7559a6f360eSCasper H.S. Dik-- snip --
7569a6f360eSCasper H.S. Dik
757*3e14f97fSRoger A. Faulkner
758*3e14f97fSRoger A. Faulkner
759*3e14f97fSRoger A. Faulkner######## Errata #005: ########
760*3e14f97fSRoger A. FaulknerA fix for an off-by-one buffer overflow in the regex expression cache
761*3e14f97fSRoger A. Faulknerhas been backported.
762*3e14f97fSRoger A. FaulknerThe following files have been changed:
763*3e14f97fSRoger A. Faulkner-- snip --
764*3e14f97fSRoger A. FaulknerIndex: usr/src/lib/libast/common/regex/regcache.c
765*3e14f97fSRoger A. Faulkner===================================================================
766*3e14f97fSRoger A. Faulkner--- usr/src/lib/libast/common/regex/regcache.c	(revision 1821)
767*3e14f97fSRoger A. Faulkner+++ usr/src/lib/libast/common/regex/regcache.c	(working copy)
768*3e14f97fSRoger A. Faulkner@@ -166,7 +166,7 @@
769*3e14f97fSRoger A. Faulkner 			cp->keep = 0;
770*3e14f97fSRoger A. Faulkner 			regfree(&cp->re);
771*3e14f97fSRoger A. Faulkner 		}
772*3e14f97fSRoger A. Faulkner-		if ((i = strlen(pattern)) >= cp->size)
773*3e14f97fSRoger A. Faulkner+		if ((i = strlen(pattern) + 1) >= cp->size)
774*3e14f97fSRoger A. Faulkner 		{
775*3e14f97fSRoger A. Faulkner 			cp->size = roundof(i, ROUND);
776*3e14f97fSRoger A. Faulkner 			if (!(cp->pattern = newof(cp->pattern, char, cp->size, 0)))
777*3e14f97fSRoger A. Faulkner-- snip --
778*3e14f97fSRoger A. Faulkner
779*3e14f97fSRoger A. Faulkner
780*3e14f97fSRoger A. Faulkner######## Errata #006: ########
781*3e14f97fSRoger A. FaulknerA fix for an issue with tail -f becoming stuck after a few 1000 lines
782*3e14f97fSRoger A. Faulknerhas been backported:
783*3e14f97fSRoger A. FaulknerThe following files have been changed:
784*3e14f97fSRoger A. Faulkner-- snip --
785*3e14f97fSRoger A. FaulknerIndex: usr/src/lib/libcmd/common/tail.c
786*3e14f97fSRoger A. Faulkner===================================================================
787*3e14f97fSRoger A. Faulkner--- usr/src/lib/libcmd/common/tail.c	(revision 1822)
788*3e14f97fSRoger A. Faulkner+++ usr/src/lib/libcmd/common/tail.c	(working copy)
789*3e14f97fSRoger A. Faulkner@@ -28,7 +28,7 @@
790*3e14f97fSRoger A. Faulkner  */
791*3e14f97fSRoger A. Faulkner
792*3e14f97fSRoger A. Faulkner static const char usage[] =
793*3e14f97fSRoger A. Faulkner-"+[-?\n@(#)$Id: tail (AT&T Research) 2010-03-07 $\n]"
794*3e14f97fSRoger A. Faulkner+"+[-?\n@(#)$Id: tail (AT&T Research) 2010-03-23 $\n]"
795*3e14f97fSRoger A. Faulkner USAGE_LICENSE
796*3e14f97fSRoger A. Faulkner "[+NAME?tail - output trailing portion of one or more files ]"
797*3e14f97fSRoger A. Faulkner "[+DESCRIPTION?\btail\b copies one or more input files to standard output "
798*3e14f97fSRoger A. Faulkner@@ -647,16 +647,14 @@
799*3e14f97fSRoger A. Faulkner 					error(ERROR_system(0), "%s: cannot stat", fp->name);
800*3e14f97fSRoger A. Faulkner 				else if (fp->fifo || fp->end < st.st_size)
801*3e14f97fSRoger A. Faulkner 				{
802*3e14f97fSRoger A. Faulkner-					fp->end = st.st_size;
803*3e14f97fSRoger A. Faulkner 					n = 1;
804*3e14f97fSRoger A. Faulkner 					if (timeout)
805*3e14f97fSRoger A. Faulkner 						fp->expire = NOW + timeout;
806*3e14f97fSRoger A. Faulkner-					z = fp->fifo ? SF_UNBOUND : fp->end - fp->cur;
807*3e14f97fSRoger A. Faulkner+					z = fp->fifo ? SF_UNBOUND : st.st_size - fp->cur;
808*3e14f97fSRoger A. Faulkner 					i = 0;
809*3e14f97fSRoger A. Faulkner 					if ((s = sfreserve(fp->sp, z, SF_LOCKR)) || (z = sfvalue(fp->sp)) && (s = sfreserve(fp->sp, z, SF_LOCKR)) && (i = 1))
810*3e14f97fSRoger A. Faulkner 					{
811*3e14f97fSRoger A. Faulkner-						if (fp->fifo)
812*3e14f97fSRoger A. Faulkner-							z = sfvalue(fp->sp);
813*3e14f97fSRoger A. Faulkner+						z = sfvalue(fp->sp);
814*3e14f97fSRoger A. Faulkner 						for (r = s + z; r > s && *(r - 1) != '\n'; r--);
815*3e14f97fSRoger A. Faulkner 						if ((w = r - s) || i && (w = z))
816*3e14f97fSRoger A. Faulkner 						{
817*3e14f97fSRoger A. Faulkner@@ -672,6 +670,7 @@
818*3e14f97fSRoger A. Faulkner 						else
819*3e14f97fSRoger A. Faulkner 							w = 0;
820*3e14f97fSRoger A. Faulkner 						sfread(fp->sp, s, w);
821*3e14f97fSRoger A. Faulkner+						fp->end += w;
822*3e14f97fSRoger A. Faulkner 					}
823*3e14f97fSRoger A. Faulkner 					goto next;
824*3e14f97fSRoger A. Faulkner 				}
825*3e14f97fSRoger A. Faulkner-- snip --
826*3e14f97fSRoger A. Faulkner
827*3e14f97fSRoger A. Faulkner
828*3e14f97fSRoger A. Faulkner
829*3e14f97fSRoger A. Faulkner
830*3e14f97fSRoger A. Faulkner######## Errata #007: ########
831*3e14f97fSRoger A. FaulknerA warning for shcomp -n has been backported from ksh93 version 'u' to
832*3e14f97fSRoger A. Faulknerhandle the possible loss of precision in (( var=$var2 )) vs.
833*3e14f97fSRoger A. Faulkner(( var=var2 )):
834*3e14f97fSRoger A. FaulknerThe following files have been changed:
835*3e14f97fSRoger A. Faulkner-- snip --
836*3e14f97fSRoger A. FaulknerIndex: usr/src/lib/libshell/common/sh/parse.c
837*3e14f97fSRoger A. Faulkner===================================================================
838*3e14f97fSRoger A. Faulkner--- usr/src/lib/libshell/common/sh/parse.c	(revision 1822)
839*3e14f97fSRoger A. Faulkner+++ usr/src/lib/libshell/common/sh/parse.c	(working copy)
840*3e14f97fSRoger A. Faulkner@@ -247,6 +247,34 @@
841*3e14f97fSRoger A. Faulkner 	return(par);
842*3e14f97fSRoger A. Faulkner }
843*3e14f97fSRoger A. Faulkner
844*3e14f97fSRoger A. Faulkner+static int paramsub(const char *str)
845*3e14f97fSRoger A. Faulkner+{
846*3e14f97fSRoger A. Faulkner+	register int c,sub=0,lit=0;
847*3e14f97fSRoger A. Faulkner+	while(c= *str++)
848*3e14f97fSRoger A. Faulkner+	{
849*3e14f97fSRoger A. Faulkner+		if(c=='$' && !lit)
850*3e14f97fSRoger A. Faulkner+		{
851*3e14f97fSRoger A. Faulkner+			if(*str=='(')
852*3e14f97fSRoger A. Faulkner+				return(0);
853*3e14f97fSRoger A. Faulkner+			if(sub)
854*3e14f97fSRoger A. Faulkner+				continue;
855*3e14f97fSRoger A. Faulkner+			if(*str=='{')
856*3e14f97fSRoger A. Faulkner+				str++;
857*3e14f97fSRoger A. Faulkner+			if(!isdigit(*str) && strchr("?#@*!$ ",*str)==0)
858*3e14f97fSRoger A. Faulkner+				return(1);
859*3e14f97fSRoger A. Faulkner+		}
860*3e14f97fSRoger A. Faulkner+		else if(c=='`')
861*3e14f97fSRoger A. Faulkner+			return(0);
862*3e14f97fSRoger A. Faulkner+		else if(c=='[' && !lit)
863*3e14f97fSRoger A. Faulkner+			sub++;
864*3e14f97fSRoger A. Faulkner+		else if(c==']' && !lit)
865*3e14f97fSRoger A. Faulkner+			sub--;
866*3e14f97fSRoger A. Faulkner+		else if(c=='\'')
867*3e14f97fSRoger A. Faulkner+			lit = !lit;
868*3e14f97fSRoger A. Faulkner+	}
869*3e14f97fSRoger A. Faulkner+	return(0);
870*3e14f97fSRoger A. Faulkner+}
871*3e14f97fSRoger A. Faulkner+
872*3e14f97fSRoger A. Faulkner static Shnode_t *getanode(Lex_t *lp, struct argnod *ap)
873*3e14f97fSRoger A. Faulkner {
874*3e14f97fSRoger A. Faulkner 	register Shnode_t *t = getnode(arithnod);
875*3e14f97fSRoger A. Faulkner@@ -256,7 +284,11 @@
876*3e14f97fSRoger A. Faulkner 	if(ap->argflag&ARG_RAW)
877*3e14f97fSRoger A. Faulkner 		t->ar.arcomp = sh_arithcomp(ap->argval);
878*3e14f97fSRoger A. Faulkner 	else
879*3e14f97fSRoger A. Faulkner+	{
880*3e14f97fSRoger A. Faulkner+		if(sh_isoption(SH_NOEXEC) && (ap->argflag&ARG_MAC) && paramsub(ap->argval))
881*3e14f97fSRoger A. Faulkner+			errormsg(SH_DICT,ERROR_warn(0),"%d: parameter substitution requires unnecessary string to number conversion",lp->sh->inlineno-(lp->token=='\n'));
882*3e14f97fSRoger A. Faulkner 		t->ar.arcomp = 0;
883*3e14f97fSRoger A. Faulkner+	}
884*3e14f97fSRoger A. Faulkner 	return(t);
885*3e14f97fSRoger A. Faulkner }
886*3e14f97fSRoger A. Faulkner
887*3e14f97fSRoger A. Faulkner-- snip --
888*3e14f97fSRoger A. Faulkner
889*3e14f97fSRoger A. Faulkner
890*3e14f97fSRoger A. Faulkner######## Errata #008: ########
891*3e14f97fSRoger A. FaulknerA fix for an issue with a Sun Studio warning has been backported:
892*3e14f97fSRoger A. FaulknerThe following files have been changed:
893*3e14f97fSRoger A. Faulkner-- snip --
894*3e14f97fSRoger A. FaulknerIndex: usr/src/lib/libast/common/path/pathtemp.c
895*3e14f97fSRoger A. Faulkner===================================================================
896*3e14f97fSRoger A. Faulkner--- usr/src/lib/libast/common/path/pathtemp.c	(revision 1822)
897*3e14f97fSRoger A. Faulkner+++ usr/src/lib/libast/common/path/pathtemp.c	(working copy)
898*3e14f97fSRoger A. Faulkner@@ -297,7 +297,7 @@
899*3e14f97fSRoger A. Faulkner 			 */
900*3e14f97fSRoger A. Faulkner
901*3e14f97fSRoger A. Faulkner 			tmp.pid = getpid();
902*3e14f97fSRoger A. Faulkner-			tmp.rng = (uint32_t)tmp.pid * ((uint32_t)time(NiL) ^ (((uint32_t)(&attempt)) >> 3) ^ (((uint32_t)tmp.dir) >> 3));
903*3e14f97fSRoger A. Faulkner+			tmp.rng = (uintptr_t)tmp.pid * ((uintptr_t)time(NiL) ^ (((uintptr_t)(&attempt)) >> 3) ^ (((uintptr_t)tmp.dir) >> 3));
904*3e14f97fSRoger A. Faulkner 			if (!tmp.key)
905*3e14f97fSRoger A. Faulkner 				tmp.key = (tmp.rng >> 16) | ((tmp.rng & 0xffff) << 16);
906*3e14f97fSRoger A. Faulkner 			tmp.rng ^= tmp.key;
907*3e14f97fSRoger A. Faulkner-- snip --
908*3e14f97fSRoger A. Faulkner
909*3e14f97fSRoger A. Faulkner
910*3e14f97fSRoger A. Faulkner######## Errata #009: ########
911*3e14f97fSRoger A. FaulknerA fix for an issue with a typeset -p having problems with compound
912*3e14f97fSRoger A. Faulknervariables and typeset -a -C loosing the -C attribute has been
913*3e14f97fSRoger A. Faulknerbackported from ksh93 version "u-":
914*3e14f97fSRoger A. Faulkner-- snip --
915*3e14f97fSRoger A. FaulknerIndex: usr/src/lib/libshell/common/bltins/typeset.c
916*3e14f97fSRoger A. Faulkner===================================================================
917*3e14f97fSRoger A. Faulkner--- usr/src/lib/libshell/common/bltins/typeset.c	(revision 1863)
918*3e14f97fSRoger A. Faulkner+++ usr/src/lib/libshell/common/bltins/typeset.c	(working copy)
919*3e14f97fSRoger A. Faulkner@@ -540,7 +540,12 @@
920*3e14f97fSRoger A. Faulkner 					else if(nv_isnull(np))
921*3e14f97fSRoger A. Faulkner 						nv_onattr(np,NV_ARRAY|(comvar?NV_NOFREE:0));
922*3e14f97fSRoger A. Faulkner 					else
923*3e14f97fSRoger A. Faulkner+					{
924*3e14f97fSRoger A. Faulkner+						Namarr_t *ap=nv_arrayptr(np);
925*3e14f97fSRoger A. Faulkner+						if(ap && comvar)
926*3e14f97fSRoger A. Faulkner+							ap->nelem |= ARRAY_TREE;
927*3e14f97fSRoger A. Faulkner 						nv_putsub(np, (char*)0, 0);
928*3e14f97fSRoger A. Faulkner+					}
929*3e14f97fSRoger A. Faulkner 				}
930*3e14f97fSRoger A. Faulkner 				else if(nvflags&NV_ARRAY)
931*3e14f97fSRoger A. Faulkner 				{
932*3e14f97fSRoger A. FaulknerIndex: usr/src/lib/libshell/common/sh/nvtree.c
933*3e14f97fSRoger A. Faulkner===================================================================
934*3e14f97fSRoger A. Faulkner--- usr/src/lib/libshell/common/sh/nvtree.c	(revision 1863)
935*3e14f97fSRoger A. Faulkner+++ usr/src/lib/libshell/common/sh/nvtree.c	(working copy)
936*3e14f97fSRoger A. Faulkner@@ -69,6 +69,7 @@
937*3e14f97fSRoger A. Faulkner static Namval_t *create_tree(Namval_t *np,const char *name,int flag,Namfun_t *dp)
938*3e14f97fSRoger A. Faulkner {
939*3e14f97fSRoger A. Faulkner 	register Namfun_t *fp=dp;
940*3e14f97fSRoger A. Faulkner+	fp->dsize = 0;
941*3e14f97fSRoger A. Faulkner 	while(fp=fp->next)
942*3e14f97fSRoger A. Faulkner 	{
943*3e14f97fSRoger A. Faulkner 		if(fp->disc && fp->disc->createf)
944*3e14f97fSRoger A. Faulkner@@ -723,7 +724,10 @@
945*3e14f97fSRoger A. Faulkner 			nv_attribute(np,wp->out,"typeset",'=');
946*3e14f97fSRoger A. Faulkner 		nv_outname(wp->out,name,-1);
947*3e14f97fSRoger A. Faulkner 		if((np->nvalue.cp && np->nvalue.cp!=Empty) || nv_isattr(np,~(NV_MINIMAL|NV_NOFREE)) || nv_isvtree(np))
948*3e14f97fSRoger A. Faulkner-			sfputc(wp->out,(isarray==2?'\n':'='));
949*3e14f97fSRoger A. Faulkner+		{
950*3e14f97fSRoger A. Faulkner+			if(wp->indent>=0 || isarray!=2)
951*3e14f97fSRoger A. Faulkner+				sfputc(wp->out,(isarray==2?'\n':'='));
952*3e14f97fSRoger A. Faulkner+		}
953*3e14f97fSRoger A. Faulkner 		if(isarray==2)
954*3e14f97fSRoger A. Faulkner 			return;
955*3e14f97fSRoger A. Faulkner 	}
956*3e14f97fSRoger A. Faulkner@@ -1015,7 +1019,7 @@
957*3e14f97fSRoger A. Faulkner  */
958*3e14f97fSRoger A. Faulkner char *nv_getvtree(register Namval_t *np, Namfun_t *fp)
959*3e14f97fSRoger A. Faulkner {
960*3e14f97fSRoger A. Faulkner-	int flags=0;
961*3e14f97fSRoger A. Faulkner+	int flags=0, dsize=fp->dsize;
962*3e14f97fSRoger A. Faulkner 	for(; fp && fp->next; fp=fp->next)
963*3e14f97fSRoger A. Faulkner 	{
964*3e14f97fSRoger A. Faulkner 		if(fp->next->disc && (fp->next->disc->getnum || fp->next->disc->getval))
965*3e14f97fSRoger A. Faulkner@@ -1027,6 +1031,8 @@
966*3e14f97fSRoger A. Faulkner 		return(nv_getv(np,fp));
967*3e14f97fSRoger A. Faulkner 	if(flags = nv_isattr(np,NV_EXPORT))
968*3e14f97fSRoger A. Faulkner 		nv_offattr(np,NV_EXPORT);
969*3e14f97fSRoger A. Faulkner+	if(dsize && (flags&NV_EXPORT))
970*3e14f97fSRoger A. Faulkner+		return("()");
971*3e14f97fSRoger A. Faulkner 	return(walk_tree(np,(Namval_t*)0,flags));
972*3e14f97fSRoger A. Faulkner }
973*3e14f97fSRoger A. Faulkner
974*3e14f97fSRoger A. Faulkner@@ -1083,6 +1089,7 @@
975*3e14f97fSRoger A. Faulkner 		return;
976*3e14f97fSRoger A. Faulkner 	nfp = newof(NIL(void*),Namfun_t,1,0);
977*3e14f97fSRoger A. Faulkner 	nfp->disc = &treedisc;
978*3e14f97fSRoger A. Faulkner+	nfp->dsize = sizeof(Namfun_t);
979*3e14f97fSRoger A. Faulkner 	nv_stack(np, nfp);
980*3e14f97fSRoger A. Faulkner }
981*3e14f97fSRoger A. Faulkner
982*3e14f97fSRoger A. FaulknerIndex: usr/src/lib/libshell/common/sh/array.c
983*3e14f97fSRoger A. Faulkner===================================================================
984*3e14f97fSRoger A. Faulkner--- usr/src/lib/libshell/common/sh/array.c	(revision 1863)
985*3e14f97fSRoger A. Faulkner+++ usr/src/lib/libshell/common/sh/array.c	(working copy)
986*3e14f97fSRoger A. Faulkner@@ -923,9 +923,10 @@
987*3e14f97fSRoger A. Faulkner 			if(array_isbit(aq->bits, dot,ARRAY_CHILD))
988*3e14f97fSRoger A. Faulkner 			{
989*3e14f97fSRoger A. Faulkner 				Namval_t *mp = aq->val[dot].np;
990*3e14f97fSRoger A. Faulkner-				if((aq->header.nelem&ARRAY_NOCHILD) && nv_isvtree(mp))
991*3e14f97fSRoger A. Faulkner+				if((aq->header.nelem&ARRAY_NOCHILD) && nv_isvtree(mp) && !mp->nvfun->dsize)
992*3e14f97fSRoger A. Faulkner 					continue;
993*3e14f97fSRoger A. Faulkner-				nv_putsub(mp,NIL(char*),ARRAY_UNDEF);
994*3e14f97fSRoger A. Faulkner+				if(nv_isarray(mp))
995*3e14f97fSRoger A. Faulkner+					nv_putsub(mp,NIL(char*),ARRAY_UNDEF);
996*3e14f97fSRoger A. Faulkner 			}
997*3e14f97fSRoger A. Faulkner 			return(1);
998*3e14f97fSRoger A. Faulkner 		}
999*3e14f97fSRoger A. FaulknerIndex: usr/src/lib/libshell/common/sh/name.c
1000*3e14f97fSRoger A. Faulkner===================================================================
1001*3e14f97fSRoger A. Faulkner--- usr/src/lib/libshell/common/sh/name.c	(revision 1863)
1002*3e14f97fSRoger A. Faulkner+++ usr/src/lib/libshell/common/sh/name.c	(working copy)
1003*3e14f97fSRoger A. Faulkner@@ -538,7 +538,11 @@
1004*3e14f97fSRoger A. Faulkner
1005*3e14f97fSRoger A. Faulkner 				}
1006*3e14f97fSRoger A. Faulkner 				if(!nv_isarray(np) && !typ && (tp->com.comarg || !tp->com.comset || tp->com.comset->argval[0]!='['))
1007*3e14f97fSRoger A. Faulkner+				{
1008*3e14f97fSRoger A. Faulkner 					nv_setvtree(np);
1009*3e14f97fSRoger A. Faulkner+					if(tp->com.comarg || tp->com.comset)
1010*3e14f97fSRoger A. Faulkner+						np->nvfun->dsize = 0;
1011*3e14f97fSRoger A. Faulkner+				}
1012*3e14f97fSRoger A. Faulkner #if SHOPT_TYPEDEF
1013*3e14f97fSRoger A. Faulkner 				goto check_type;
1014*3e14f97fSRoger A. Faulkner #else
1015*3e14f97fSRoger A. Faulkner-- snip --
1016*3e14f97fSRoger A. Faulkner
1017da2e3ebdSchin# EOF.
1018