4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
23 # Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
29 # Errata/problems/notes about problems in the current sources
32 ######## Errata #001: ########
33 The usage of |posix_spawn()| has been manually disabled because there seems to be a
34 race condition which cases sporadic failures like this:
36 $ builtin | fgrep sum | fgrep sum
39 $ builtin | fgrep sum | fgrep sum
40 fgrep: fgrep: cannot execute [Exec format error]
42 The following files have been changed:
44 Index: src/lib/libast/sparcv9/include/ast/ast_lib.h
45 ===================================================================
46 --- usr/src/lib/libast/sparcv9/include/ast/ast_lib.h (revision 888)
47 +++ usr/src/lib/libast/sparcv9/include/ast/ast_lib.h (working copy)
49 #define _hdr_unistd 1 /* #include <unistd.h> ok */
50 #define _lib_vfork 1 /* vfork exists and it works */
51 #define _real_vfork 1 /* vfork child shares data with parent */
52 -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
53 +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
54 #define _stream_peek 1 /* ioctl(I_PEEK) works */
55 #define _socket_peek 1 /* recv(MSG_PEEK) works */
56 #define _hdr_string 1 /* #include <string.h> ok */
57 Index: src/lib/libast/sparcv9/src/lib/libast/ast_lib.h
58 ===================================================================
59 --- usr/src/lib/libast/sparcv9/src/lib/libast/ast_lib.h (revision 888)
60 +++ usr/src/lib/libast/sparcv9/src/lib/libast/ast_lib.h (working copy)
62 #define _hdr_unistd 1 /* #include <unistd.h> ok */
63 #define _lib_vfork 1 /* vfork exists and it works */
64 #define _real_vfork 1 /* vfork child shares data with parent */
65 -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
66 +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
67 #define _stream_peek 1 /* ioctl(I_PEEK) works */
68 #define _socket_peek 1 /* recv(MSG_PEEK) works */
69 #define _hdr_string 1 /* #include <string.h> ok */
70 Index: src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib
71 ===================================================================
72 --- usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib (revision 888)
73 +++ usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib (working copy)
75 #define _hdr_unistd 1 /* #include <unistd.h> ok */
76 #define _lib_vfork 1 /* vfork exists and it works */
77 #define _real_vfork 1 /* vfork child shares data with parent */
78 -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
79 +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
80 #define _stream_peek 1 /* ioctl(I_PEEK) works */
81 #define _socket_peek 1 /* recv(MSG_PEEK) works */
82 #define _hdr_string 1 /* #include <string.h> ok */
83 Index: src/lib/libast/sparc/include/ast/ast_lib.h
84 ===================================================================
85 --- usr/src/lib/libast/sparc/include/ast/ast_lib.h (revision 888)
86 +++ usr/src/lib/libast/sparc/include/ast/ast_lib.h (working copy)
88 #define _hdr_unistd 1 /* #include <unistd.h> ok */
89 #define _lib_vfork 1 /* vfork exists and it works */
90 #define _real_vfork 1 /* vfork child shares data with parent */
91 -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
92 +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
93 #define _stream_peek 1 /* ioctl(I_PEEK) works */
94 #define _socket_peek 1 /* recv(MSG_PEEK) works */
95 #define _hdr_string 1 /* #include <string.h> ok */
96 Index: src/lib/libast/sparc/src/lib/libast/ast_lib.h
97 ===================================================================
98 --- usr/src/lib/libast/sparc/src/lib/libast/ast_lib.h (revision 888)
99 +++ usr/src/lib/libast/sparc/src/lib/libast/ast_lib.h (working copy)
101 #define _hdr_unistd 1 /* #include <unistd.h> ok */
102 #define _lib_vfork 1 /* vfork exists and it works */
103 #define _real_vfork 1 /* vfork child shares data with parent */
104 -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
105 +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
106 #define _stream_peek 1 /* ioctl(I_PEEK) works */
107 #define _socket_peek 1 /* recv(MSG_PEEK) works */
108 #define _hdr_string 1 /* #include <string.h> ok */
109 Index: src/lib/libast/sparc/src/lib/libast/FEATURE/lib
110 ===================================================================
111 --- usr/src/lib/libast/sparc/src/lib/libast/FEATURE/lib (revision 888)
112 +++ usr/src/lib/libast/sparc/src/lib/libast/FEATURE/lib (working copy)
114 #define _hdr_unistd 1 /* #include <unistd.h> ok */
115 #define _lib_vfork 1 /* vfork exists and it works */
116 #define _real_vfork 1 /* vfork child shares data with parent */
117 -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
118 +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
119 #define _stream_peek 1 /* ioctl(I_PEEK) works */
120 #define _socket_peek 1 /* recv(MSG_PEEK) works */
121 #define _hdr_string 1 /* #include <string.h> ok */
122 Index: src/lib/libast/i386/include/ast/ast_lib.h
123 ===================================================================
124 --- usr/src/lib/libast/i386/include/ast/ast_lib.h (revision 888)
125 +++ usr/src/lib/libast/i386/include/ast/ast_lib.h (working copy)
127 #define _hdr_unistd 1 /* #include <unistd.h> ok */
128 #define _lib_vfork 1 /* vfork exists and it works */
129 #define _real_vfork 1 /* vfork child shares data with parent */
130 -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
131 +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
132 #define _stream_peek 1 /* ioctl(I_PEEK) works */
133 #define _socket_peek 1 /* recv(MSG_PEEK) works */
134 #define _hdr_string 1 /* #include <string.h> ok */
135 Index: src/lib/libast/i386/src/lib/libast/ast_lib.h
136 ===================================================================
137 --- usr/src/lib/libast/i386/src/lib/libast/ast_lib.h (revision 888)
138 +++ usr/src/lib/libast/i386/src/lib/libast/ast_lib.h (working copy)
140 #define _hdr_unistd 1 /* #include <unistd.h> ok */
141 #define _lib_vfork 1 /* vfork exists and it works */
142 #define _real_vfork 1 /* vfork child shares data with parent */
143 -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
144 +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
145 #define _stream_peek 1 /* ioctl(I_PEEK) works */
146 #define _socket_peek 1 /* recv(MSG_PEEK) works */
147 #define _hdr_string 1 /* #include <string.h> ok */
148 Index: src/lib/libast/i386/src/lib/libast/FEATURE/lib
149 ===================================================================
150 --- usr/src/lib/libast/i386/src/lib/libast/FEATURE/lib (revision 888)
151 +++ usr/src/lib/libast/i386/src/lib/libast/FEATURE/lib (working copy)
153 #define _hdr_unistd 1 /* #include <unistd.h> ok */
154 #define _lib_vfork 1 /* vfork exists and it works */
155 #define _real_vfork 1 /* vfork child shares data with parent */
156 -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
157 +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
158 #define _stream_peek 1 /* ioctl(I_PEEK) works */
159 #define _socket_peek 1 /* recv(MSG_PEEK) works */
160 #define _hdr_string 1 /* #include <string.h> ok */
161 Index: src/lib/libast/amd64/include/ast/ast_lib.h
162 ===================================================================
163 --- usr/src/lib/libast/amd64/include/ast/ast_lib.h (revision 888)
164 +++ usr/src/lib/libast/amd64/include/ast/ast_lib.h (working copy)
166 #define _hdr_unistd 1 /* #include <unistd.h> ok */
167 #define _lib_vfork 1 /* vfork exists and it works */
168 #define _real_vfork 1 /* vfork child shares data with parent */
169 -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
170 +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
171 #define _stream_peek 1 /* ioctl(I_PEEK) works */
172 #define _socket_peek 1 /* recv(MSG_PEEK) works */
173 #define _hdr_string 1 /* #include <string.h> ok */
174 Index: src/lib/libast/amd64/src/lib/libast/ast_lib.h
175 ===================================================================
176 --- usr/src/lib/libast/amd64/src/lib/libast/ast_lib.h (revision 888)
177 +++ usr/src/lib/libast/amd64/src/lib/libast/ast_lib.h (working copy)
179 #define _hdr_unistd 1 /* #include <unistd.h> ok */
180 #define _lib_vfork 1 /* vfork exists and it works */
181 #define _real_vfork 1 /* vfork child shares data with parent */
182 -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
183 +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
184 #define _stream_peek 1 /* ioctl(I_PEEK) works */
185 #define _socket_peek 1 /* recv(MSG_PEEK) works */
186 #define _hdr_string 1 /* #include <string.h> ok */
187 Index: src/lib/libast/amd64/src/lib/libast/FEATURE/lib
188 ===================================================================
189 --- usr/src/lib/libast/amd64/src/lib/libast/FEATURE/lib (revision 888)
190 +++ usr/src/lib/libast/amd64/src/lib/libast/FEATURE/lib (working copy)
192 #define _hdr_unistd 1 /* #include <unistd.h> ok */
193 #define _lib_vfork 1 /* vfork exists and it works */
194 #define _real_vfork 1 /* vfork child shares data with parent */
195 -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
196 +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
197 #define _stream_peek 1 /* ioctl(I_PEEK) works */
198 #define _socket_peek 1 /* recv(MSG_PEEK) works */
199 #define _hdr_string 1 /* #include <string.h> ok */
203 ######## Errata #002: ########
204 The usage of |mmap()| has been manually enabled to improve I/O performance.
205 The following files have been changed:
207 Index: usr/src/lib/libast/sparcv9/include/ast/ast_mmap.h
208 ===================================================================
209 --- usr/src/lib/libast/sparcv9/include/ast/ast_mmap.h (revision 1701)
210 +++ usr/src/lib/libast/sparcv9/include/ast/ast_mmap.h (working copy)
212 #define _lib_mmap64 1 /* mmap64 interface and implementation work */
213 #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
214 #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
215 +#define _mmap_worthy 2 /* mmap is good */
217 /* some systems get it wrong but escape concise detection */
219 Index: usr/src/lib/libast/sparcv9/src/lib/libast/ast_mmap.h
220 ===================================================================
221 --- usr/src/lib/libast/sparcv9/src/lib/libast/ast_mmap.h (revision 1701)
222 +++ usr/src/lib/libast/sparcv9/src/lib/libast/ast_mmap.h (working copy)
224 #define _lib_mmap64 1 /* mmap64 interface and implementation work */
225 #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
226 #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
227 +#define _mmap_worthy 2 /* mmap is good */
229 /* some systems get it wrong but escape concise detection */
231 Index: usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mmap
232 ===================================================================
233 --- usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mmap (revision 1701)
234 +++ usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mmap (working copy)
236 #define _lib_mmap64 1 /* mmap64 interface and implementation work */
237 #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
238 #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
239 +#define _mmap_worthy 2 /* mmap is good */
241 /* some systems get it wrong but escape concise detection */
243 Index: usr/src/lib/libast/sparc/include/ast/ast_mmap.h
244 ===================================================================
245 --- usr/src/lib/libast/sparc/include/ast/ast_mmap.h (revision 1701)
246 +++ usr/src/lib/libast/sparc/include/ast/ast_mmap.h (working copy)
248 #define _lib_mmap64 1 /* mmap64 interface and implementation work */
249 #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
250 #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
251 -#define _mmap_worthy 1 /* mmap is good */
252 +#define _mmap_worthy 2 /* mmap is good */
254 /* some systems get it wrong but escape concise detection */
256 Index: usr/src/lib/libast/sparc/src/lib/libast/ast_mmap.h
257 ===================================================================
258 --- usr/src/lib/libast/sparc/src/lib/libast/ast_mmap.h (revision 1701)
259 +++ usr/src/lib/libast/sparc/src/lib/libast/ast_mmap.h (working copy)
261 #define _lib_mmap64 1 /* mmap64 interface and implementation work */
262 #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
263 #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
264 -#define _mmap_worthy 1 /* mmap is good */
265 +#define _mmap_worthy 2 /* mmap is good */
267 /* some systems get it wrong but escape concise detection */
269 Index: usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mmap
270 ===================================================================
271 --- usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mmap (revision 1701)
272 +++ usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mmap (working copy)
274 #define _lib_mmap64 1 /* mmap64 interface and implementation work */
275 #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
276 #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
277 -#define _mmap_worthy 1 /* mmap is good */
278 +#define _mmap_worthy 2 /* mmap is good */
280 /* some systems get it wrong but escape concise detection */
282 Index: usr/src/lib/libast/i386/include/ast/ast_mmap.h
283 ===================================================================
284 --- usr/src/lib/libast/i386/include/ast/ast_mmap.h (revision 1701)
285 +++ usr/src/lib/libast/i386/include/ast/ast_mmap.h (working copy)
287 #define _lib_mmap64 1 /* mmap64 interface and implementation work */
288 #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
289 #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
290 +#define _mmap_worthy 2 /* mmap is good */
292 /* some systems get it wrong but escape concise detection */
294 Index: usr/src/lib/libast/i386/src/lib/libast/ast_mmap.h
295 ===================================================================
296 --- usr/src/lib/libast/i386/src/lib/libast/ast_mmap.h (revision 1701)
297 +++ usr/src/lib/libast/i386/src/lib/libast/ast_mmap.h (working copy)
299 #define _lib_mmap64 1 /* mmap64 interface and implementation work */
300 #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
301 #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
302 +#define _mmap_worthy 2 /* mmap is good */
304 /* some systems get it wrong but escape concise detection */
306 Index: usr/src/lib/libast/i386/src/lib/libast/FEATURE/mmap
307 ===================================================================
308 --- usr/src/lib/libast/i386/src/lib/libast/FEATURE/mmap (revision 1701)
309 +++ usr/src/lib/libast/i386/src/lib/libast/FEATURE/mmap (working copy)
311 #define _lib_mmap64 1 /* mmap64 interface and implementation work */
312 #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
313 #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
314 +#define _mmap_worthy 2 /* mmap is good */
316 /* some systems get it wrong but escape concise detection */
318 Index: usr/src/lib/libast/amd64/include/ast/ast_mmap.h
319 ===================================================================
320 --- usr/src/lib/libast/amd64/include/ast/ast_mmap.h (revision 1701)
321 +++ usr/src/lib/libast/amd64/include/ast/ast_mmap.h (working copy)
323 #define _lib_mmap64 1 /* mmap64 interface and implementation work */
324 #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
325 #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
326 +#define _mmap_worthy 2 /* mmap is good */
328 /* some systems get it wrong but escape concise detection */
330 Index: usr/src/lib/libast/amd64/src/lib/libast/ast_mmap.h
331 ===================================================================
332 --- usr/src/lib/libast/amd64/src/lib/libast/ast_mmap.h (revision 1701)
333 +++ usr/src/lib/libast/amd64/src/lib/libast/ast_mmap.h (working copy)
335 #define _lib_mmap64 1 /* mmap64 interface and implementation work */
336 #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
337 #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
338 +#define _mmap_worthy 2 /* mmap is good */
340 /* some systems get it wrong but escape concise detection */
342 Index: usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mmap
343 ===================================================================
344 --- usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mmap (revision 1701)
345 +++ usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mmap (working copy)
347 #define _lib_mmap64 1 /* mmap64 interface and implementation work */
348 #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
349 #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
350 +#define _mmap_worthy 2 /* mmap is good */
352 /* some systems get it wrong but escape concise detection */
357 ######## Errata #003: ########
358 A workaround was added for a problem with the "multiline" editor mode which
359 occurs when the edit line becomes longer than the terminal's width and the
360 terminal cursor is not at position 0 when PS1 is send to the terminal.
362 For example: The user executes a $ printf "foo"<enter> # the prompt will start
363 at position 3 instead of 0. If the user enters a command which is longer than
364 the terminal width and then removes enougth characters that the edit line fits
365 again into one line the "foo" at the beginning will be overwritten with the
368 The workaround is to add $(printf "%*s\r%s" COLUMNS "") at the beginning of
369 PS1 set by /etc/ksh.kshrc, this causes the shell to move to the beginning
370 of the next line if the terminal cursor is not at position 0.
373 ######## Errata #004: ########
374 The POSIX "cksum"/CRC and AT&T "sum" codepaths in libsum have been reworked
375 and then backpoprted to address a performance regression on some
376 machine/architecture combinations.
377 The following files have been changed:
379 Index: usr/src/lib/libsum/common/sum-crc.c
380 ===================================================================
381 --- usr/src/lib/libsum/common/sum-crc.c (revision 1724)
382 +++ usr/src/lib/libsum/common/sum-crc.c (working copy)
388 + const Crcnum_t *tab; /* use |const| to give the compiler a hint that the data won't change */
389 + Crcnum_t tabdata[256];
390 unsigned int addsize;
394 #define CRC(p,s,c) (s = (s >> 8) ^ (p)->tab[(s ^ (c)) & 0xff])
395 #define CRCROTATE(p,s,c) (s = (s << 8) ^ (p)->tab[((s >> 24) ^ (c)) & 0xff])
398 +Crcnum_t posix_cksum_tab[256] = {
400 + 0x04c11db7U, 0x09823b6eU, 0x0d4326d9U, 0x130476dcU, 0x17c56b6bU,
401 + 0x1a864db2U, 0x1e475005U, 0x2608edb8U, 0x22c9f00fU, 0x2f8ad6d6U,
402 + 0x2b4bcb61U, 0x350c9b64U, 0x31cd86d3U, 0x3c8ea00aU, 0x384fbdbdU,
403 + 0x4c11db70U, 0x48d0c6c7U, 0x4593e01eU, 0x4152fda9U, 0x5f15adacU,
404 + 0x5bd4b01bU, 0x569796c2U, 0x52568b75U, 0x6a1936c8U, 0x6ed82b7fU,
405 + 0x639b0da6U, 0x675a1011U, 0x791d4014U, 0x7ddc5da3U, 0x709f7b7aU,
406 + 0x745e66cdU, 0x9823b6e0U, 0x9ce2ab57U, 0x91a18d8eU, 0x95609039U,
407 + 0x8b27c03cU, 0x8fe6dd8bU, 0x82a5fb52U, 0x8664e6e5U, 0xbe2b5b58U,
408 + 0xbaea46efU, 0xb7a96036U, 0xb3687d81U, 0xad2f2d84U, 0xa9ee3033U,
409 + 0xa4ad16eaU, 0xa06c0b5dU, 0xd4326d90U, 0xd0f37027U, 0xddb056feU,
410 + 0xd9714b49U, 0xc7361b4cU, 0xc3f706fbU, 0xceb42022U, 0xca753d95U,
411 + 0xf23a8028U, 0xf6fb9d9fU, 0xfbb8bb46U, 0xff79a6f1U, 0xe13ef6f4U,
412 + 0xe5ffeb43U, 0xe8bccd9aU, 0xec7dd02dU, 0x34867077U, 0x30476dc0U,
413 + 0x3d044b19U, 0x39c556aeU, 0x278206abU, 0x23431b1cU, 0x2e003dc5U,
414 + 0x2ac12072U, 0x128e9dcfU, 0x164f8078U, 0x1b0ca6a1U, 0x1fcdbb16U,
415 + 0x018aeb13U, 0x054bf6a4U, 0x0808d07dU, 0x0cc9cdcaU, 0x7897ab07U,
416 + 0x7c56b6b0U, 0x71159069U, 0x75d48ddeU, 0x6b93dddbU, 0x6f52c06cU,
417 + 0x6211e6b5U, 0x66d0fb02U, 0x5e9f46bfU, 0x5a5e5b08U, 0x571d7dd1U,
418 + 0x53dc6066U, 0x4d9b3063U, 0x495a2dd4U, 0x44190b0dU, 0x40d816baU,
419 + 0xaca5c697U, 0xa864db20U, 0xa527fdf9U, 0xa1e6e04eU, 0xbfa1b04bU,
420 + 0xbb60adfcU, 0xb6238b25U, 0xb2e29692U, 0x8aad2b2fU, 0x8e6c3698U,
421 + 0x832f1041U, 0x87ee0df6U, 0x99a95df3U, 0x9d684044U, 0x902b669dU,
422 + 0x94ea7b2aU, 0xe0b41de7U, 0xe4750050U, 0xe9362689U, 0xedf73b3eU,
423 + 0xf3b06b3bU, 0xf771768cU, 0xfa325055U, 0xfef34de2U, 0xc6bcf05fU,
424 + 0xc27dede8U, 0xcf3ecb31U, 0xcbffd686U, 0xd5b88683U, 0xd1799b34U,
425 + 0xdc3abdedU, 0xd8fba05aU, 0x690ce0eeU, 0x6dcdfd59U, 0x608edb80U,
426 + 0x644fc637U, 0x7a089632U, 0x7ec98b85U, 0x738aad5cU, 0x774bb0ebU,
427 + 0x4f040d56U, 0x4bc510e1U, 0x46863638U, 0x42472b8fU, 0x5c007b8aU,
428 + 0x58c1663dU, 0x558240e4U, 0x51435d53U, 0x251d3b9eU, 0x21dc2629U,
429 + 0x2c9f00f0U, 0x285e1d47U, 0x36194d42U, 0x32d850f5U, 0x3f9b762cU,
430 + 0x3b5a6b9bU, 0x0315d626U, 0x07d4cb91U, 0x0a97ed48U, 0x0e56f0ffU,
431 + 0x1011a0faU, 0x14d0bd4dU, 0x19939b94U, 0x1d528623U, 0xf12f560eU,
432 + 0xf5ee4bb9U, 0xf8ad6d60U, 0xfc6c70d7U, 0xe22b20d2U, 0xe6ea3d65U,
433 + 0xeba91bbcU, 0xef68060bU, 0xd727bbb6U, 0xd3e6a601U, 0xdea580d8U,
434 + 0xda649d6fU, 0xc423cd6aU, 0xc0e2d0ddU, 0xcda1f604U, 0xc960ebb3U,
435 + 0xbd3e8d7eU, 0xb9ff90c9U, 0xb4bcb610U, 0xb07daba7U, 0xae3afba2U,
436 + 0xaafbe615U, 0xa7b8c0ccU, 0xa379dd7bU, 0x9b3660c6U, 0x9ff77d71U,
437 + 0x92b45ba8U, 0x9675461fU, 0x8832161aU, 0x8cf30badU, 0x81b02d74U,
438 + 0x857130c3U, 0x5d8a9099U, 0x594b8d2eU, 0x5408abf7U, 0x50c9b640U,
439 + 0x4e8ee645U, 0x4a4ffbf2U, 0x470cdd2bU, 0x43cdc09cU, 0x7b827d21U,
440 + 0x7f436096U, 0x7200464fU, 0x76c15bf8U, 0x68860bfdU, 0x6c47164aU,
441 + 0x61043093U, 0x65c52d24U, 0x119b4be9U, 0x155a565eU, 0x18197087U,
442 + 0x1cd86d30U, 0x029f3d35U, 0x065e2082U, 0x0b1d065bU, 0x0fdc1becU,
443 + 0x3793a651U, 0x3352bbe6U, 0x3e119d3fU, 0x3ad08088U, 0x2497d08dU,
444 + 0x2056cd3aU, 0x2d15ebe3U, 0x29d4f654U, 0xc5a92679U, 0xc1683bceU,
445 + 0xcc2b1d17U, 0xc8ea00a0U, 0xd6ad50a5U, 0xd26c4d12U, 0xdf2f6bcbU,
446 + 0xdbee767cU, 0xe3a1cbc1U, 0xe760d676U, 0xea23f0afU, 0xeee2ed18U,
447 + 0xf0a5bd1dU, 0xf464a0aaU, 0xf9278673U, 0xfde69bc4U, 0x89b8fd09U,
448 + 0x8d79e0beU, 0x803ac667U, 0x84fbdbd0U, 0x9abc8bd5U, 0x9e7d9662U,
449 + 0x933eb0bbU, 0x97ffad0cU, 0xafb010b1U, 0xab710d06U, 0xa6322bdfU,
450 + 0xa2f33668U, 0xbcb4666dU, 0xb8757bdaU, 0xb5365d03U, 0xb1f740b4U
454 crc_open(const Method_t* method, const char* name)
457 sum->method = (Method_t*)method;
460 - polynomial = 0xedb88320;
464 + if(!strcmp(name, "crc-0x04c11db7-rotate-done-size"))
466 - for (t = s, v = 0; *s && *s != '-'; s++)
467 - if (*s == '=' && !v)
469 - i = (v ? v : s) - t;
470 - if (isdigit(*t) || v && i >= 4 && strneq(t, "poly", 4) && (t = v + 1))
471 - polynomial = strtoul(t, NiL, 0);
472 - else if (strneq(t, "done", i))
473 - sum->done = v ? strtoul(v + 1, NiL, 0) : ~sum->done;
474 - else if (strneq(t, "init", i))
475 - sum->init = v ? strtoul(v + 1, NiL, 0) : ~sum->init;
476 - else if (strneq(t, "rotate", i))
478 - else if (strneq(t, "size", i))
482 - sum->xorsize = strtoul(v + 1, NiL, 0);
487 + sum->done=0xffffffff;
492 + /* Optimized codepath for POSIX cksum to save startup time */
493 + sum->tab=posix_cksum_tab;
502 - for (i = 1; i < 8; i++)
503 - p[i] = (p[i-1] << 1) ^ ((p[i-1] & 0x80000000) ? polynomial : 0);
504 - for (i = 0; i < elementsof(sum->tab); i++)
505 + polynomial = 0xedb88320;
511 - for (j = 0; j < 8; j++)
512 + for (t = s, v = 0; *s && *s != '-'; s++)
513 + if (*s == '=' && !v)
515 + i = (v ? v : s) - t;
516 + if (isdigit(*t) || v && i >= 4 && strneq(t, "poly", 4) && (t = v + 1))
517 + polynomial = strtoul(t, NiL, 0);
518 + else if (strneq(t, "done", i))
519 + sum->done = v ? strtoul(v + 1, NiL, 0) : ~sum->done;
520 + else if (strneq(t, "init", i))
521 + sum->init = v ? strtoul(v + 1, NiL, 0) : ~sum->init;
522 + else if (strneq(t, "rotate", i))
524 + else if (strneq(t, "size", i))
531 + sum->xorsize = strtoul(v + 1, NiL, 0);
540 - for (i = 0; i < elementsof(sum->tab); i++)
544 - for (j = 0; j < 8; j++)
545 - x = (x>>1) ^ ((x & 1) ? polynomial : 0);
551 + for (i = 1; i < 8; i++)
552 + p[i] = (p[i-1] << 1) ^ ((p[i-1] & 0x80000000) ? polynomial : 0);
553 + for (i = 0; i < elementsof(sum->tabdata); i++)
557 + for (j = 0; j < 8; j++)
563 + sum->tabdata[i] = t;
568 + for (i = 0; i < elementsof(sum->tabdata); i++)
571 + for (j = 0; j < 8; j++)
572 + x = (x>>1) ^ ((x & 1) ? polynomial : 0);
573 + sum->tabdata[i] = x;
577 + sum->tab=sum->tabdata;
583 @@ -141,11 +216,77 @@
587 +#if defined(__SUNPRO_C) || defined(__GNUC__)
589 +#if defined(__SUNPRO_C)
590 +# include <sun_prefetch.h>
591 +# define sum_prefetch(addr) sun_prefetch_read_many((void *)(addr))
592 +#elif defined(__GNUC__)
593 +# define sum_prefetch(addr) __builtin_prefetch((addr), 0, 3)
595 +# error Unknown compiler
598 +#define CBLOCK_SIZE (64)
602 crc_block(Sum_t* p, const void* s, size_t n)
604 Crc_t* sum = (Crc_t*)p;
605 register Crcnum_t c = sum->sum;
606 + register const unsigned char* b = (const unsigned char*)s;
607 + register const unsigned char* e = b + n;
614 + while (n > CBLOCK_SIZE)
616 + sum_prefetch(b+CBLOCK_SIZE);
617 + for(i=0 ; i < CBLOCK_SIZE ; i++)
619 + CRCROTATE(sum, c, *b++);
627 + CRCROTATE(sum, c, *b++);
632 + while (n > CBLOCK_SIZE)
634 + sum_prefetch(b+CBLOCK_SIZE);
635 + for(i=0 ; i < CBLOCK_SIZE ; i++)
654 +crc_block(Sum_t* p, const void* s, size_t n)
656 + Crc_t* sum = (Crc_t*)p;
657 + register Crcnum_t c = sum->sum;
658 register unsigned char* b = (unsigned char*)s;
659 register unsigned char* e = b + n;
665 +#endif /* defined(__SUNPRO_C) || defined(__GNUC__) */
669 Index: usr/src/lib/libsum/common/sum-att.c
670 ===================================================================
671 --- usr/src/lib/libsum/common/sum-att.c (revision 1724)
672 +++ usr/src/lib/libsum/common/sum-att.c (working copy)
674 #define att_data long_data
675 #define att_scale 512
677 +#if defined(__SUNPRO_C) || defined(__GNUC__)
679 +#if defined(__SUNPRO_C)
680 +# include <sun_prefetch.h>
681 +# define sum_prefetch(addr) sun_prefetch_read_many((void *)(addr))
682 +#elif defined(__GNUC__)
683 +# define sum_prefetch(addr) __builtin_prefetch((addr), 0, 3)
685 +# error Unknown compiler
688 +#define CBLOCK_SIZE (64)
691 +/* Inmos transputer would love this algorithm */
693 att_block(register Sum_t* p, const void* s, size_t n)
695 register uint32_t c = ((Integral_t*)p)->sum;
696 + register const unsigned char* b = (const unsigned char*)s;
697 + register const unsigned char* e = b + n;
698 + register uint32_t s0, s1, s2, s3, s4, s5, s6, s7;
699 + register unsigned int i;
701 + s0=s1=s2=s3=s4=s5=s6=s7=0U;
703 + sum_prefetch((void *)b);
705 + while (n > CBLOCK_SIZE)
707 + sum_prefetch((b+CBLOCK_SIZE));
709 + /* Compiler will unroll for() loops per #pragma unroll */
710 + for (i=0 ; i < (CBLOCK_SIZE/8) ; i++)
713 + * use s0-s7 to decouple calculations (this improves pipelining)
714 + * because each operation is completely independent from it's
731 + c+=s0+s1+s2+s3+s4+s5+s6+s7;
735 + ((Integral_t*)p)->sum = c;
741 +att_block(register Sum_t* p, const void* s, size_t n)
743 + register uint32_t c = ((Integral_t*)p)->sum;
744 register unsigned char* b = (unsigned char*)s;
745 register unsigned char* e = b + n;
748 ((Integral_t*)p)->sum = c;
751 +#endif /* defined(__SUNPRO_C) || defined(__GNUC__) */
759 ######## Errata #005: ########
760 A fix for an off-by-one buffer overflow in the regex expression cache
762 The following files have been changed:
764 Index: usr/src/lib/libast/common/regex/regcache.c
765 ===================================================================
766 --- usr/src/lib/libast/common/regex/regcache.c (revision 1821)
767 +++ usr/src/lib/libast/common/regex/regcache.c (working copy)
772 - if ((i = strlen(pattern)) >= cp->size)
773 + if ((i = strlen(pattern) + 1) >= cp->size)
775 cp->size = roundof(i, ROUND);
776 if (!(cp->pattern = newof(cp->pattern, char, cp->size, 0)))
780 ######## Errata #006: ########
781 A fix for an issue with tail -f becoming stuck after a few 1000 lines
783 The following files have been changed:
785 Index: usr/src/lib/libcmd/common/tail.c
786 ===================================================================
787 --- usr/src/lib/libcmd/common/tail.c (revision 1822)
788 +++ usr/src/lib/libcmd/common/tail.c (working copy)
792 static const char usage[] =
793 -"+[-?\n@(#)$Id: tail (AT&T Research) 2010-03-07 $\n]"
794 +"+[-?\n@(#)$Id: tail (AT&T Research) 2010-03-23 $\n]"
796 "[+NAME?tail - output trailing portion of one or more files ]"
797 "[+DESCRIPTION?\btail\b copies one or more input files to standard output "
798 @@ -647,16 +647,14 @@
799 error(ERROR_system(0), "%s: cannot stat", fp->name);
800 else if (fp->fifo || fp->end < st.st_size)
802 - fp->end = st.st_size;
805 fp->expire = NOW + timeout;
806 - z = fp->fifo ? SF_UNBOUND : fp->end - fp->cur;
807 + z = fp->fifo ? SF_UNBOUND : st.st_size - fp->cur;
809 if ((s = sfreserve(fp->sp, z, SF_LOCKR)) || (z = sfvalue(fp->sp)) && (s = sfreserve(fp->sp, z, SF_LOCKR)) && (i = 1))
812 - z = sfvalue(fp->sp);
813 + z = sfvalue(fp->sp);
814 for (r = s + z; r > s && *(r - 1) != '\n'; r--);
815 if ((w = r - s) || i && (w = z))
820 sfread(fp->sp, s, w);
830 ######## Errata #007: ########
831 A warning for shcomp -n has been backported from ksh93 version 'u' to
832 handle the possible loss of precision in (( var=$var2 )) vs.
834 The following files have been changed:
836 Index: usr/src/lib/libshell/common/sh/parse.c
837 ===================================================================
838 --- usr/src/lib/libshell/common/sh/parse.c (revision 1822)
839 +++ usr/src/lib/libshell/common/sh/parse.c (working copy)
844 +static int paramsub(const char *str)
846 + register int c,sub=0,lit=0;
857 + if(!isdigit(*str) && strchr("?#@*!$ ",*str)==0)
862 + else if(c=='[' && !lit)
864 + else if(c==']' && !lit)
872 static Shnode_t *getanode(Lex_t *lp, struct argnod *ap)
874 register Shnode_t *t = getnode(arithnod);
876 if(ap->argflag&ARG_RAW)
877 t->ar.arcomp = sh_arithcomp(ap->argval);
880 + if(sh_isoption(SH_NOEXEC) && (ap->argflag&ARG_MAC) && paramsub(ap->argval))
881 + errormsg(SH_DICT,ERROR_warn(0),"%d: parameter substitution requires unnecessary string to number conversion",lp->sh->inlineno-(lp->token=='\n'));
890 ######## Errata #008: ########
891 A fix for an issue with a Sun Studio warning has been backported:
892 The following files have been changed:
894 Index: usr/src/lib/libast/common/path/pathtemp.c
895 ===================================================================
896 --- usr/src/lib/libast/common/path/pathtemp.c (revision 1822)
897 +++ usr/src/lib/libast/common/path/pathtemp.c (working copy)
902 - tmp.rng = (uint32_t)tmp.pid * ((uint32_t)time(NiL) ^ (((uint32_t)(&attempt)) >> 3) ^ (((uint32_t)tmp.dir) >> 3));
903 + tmp.rng = (uintptr_t)tmp.pid * ((uintptr_t)time(NiL) ^ (((uintptr_t)(&attempt)) >> 3) ^ (((uintptr_t)tmp.dir) >> 3));
905 tmp.key = (tmp.rng >> 16) | ((tmp.rng & 0xffff) << 16);
910 ######## Errata #009: ########
911 A fix for an issue with a typeset -p having problems with compound
912 variables and typeset -a -C loosing the -C attribute has been
913 backported from ksh93 version "u-":
915 Index: usr/src/lib/libshell/common/bltins/typeset.c
916 ===================================================================
917 --- usr/src/lib/libshell/common/bltins/typeset.c (revision 1863)
918 +++ usr/src/lib/libshell/common/bltins/typeset.c (working copy)
920 else if(nv_isnull(np))
921 nv_onattr(np,NV_ARRAY|(comvar?NV_NOFREE:0));
924 + Namarr_t *ap=nv_arrayptr(np);
926 + ap->nelem |= ARRAY_TREE;
927 nv_putsub(np, (char*)0, 0);
930 else if(nvflags&NV_ARRAY)
932 Index: usr/src/lib/libshell/common/sh/nvtree.c
933 ===================================================================
934 --- usr/src/lib/libshell/common/sh/nvtree.c (revision 1863)
935 +++ usr/src/lib/libshell/common/sh/nvtree.c (working copy)
937 static Namval_t *create_tree(Namval_t *np,const char *name,int flag,Namfun_t *dp)
939 register Namfun_t *fp=dp;
943 if(fp->disc && fp->disc->createf)
945 nv_attribute(np,wp->out,"typeset",'=');
946 nv_outname(wp->out,name,-1);
947 if((np->nvalue.cp && np->nvalue.cp!=Empty) || nv_isattr(np,~(NV_MINIMAL|NV_NOFREE)) || nv_isvtree(np))
948 - sfputc(wp->out,(isarray==2?'\n':'='));
950 + if(wp->indent>=0 || isarray!=2)
951 + sfputc(wp->out,(isarray==2?'\n':'='));
956 @@ -1015,7 +1019,7 @@
958 char *nv_getvtree(register Namval_t *np, Namfun_t *fp)
961 + int flags=0, dsize=fp->dsize;
962 for(; fp && fp->next; fp=fp->next)
964 if(fp->next->disc && (fp->next->disc->getnum || fp->next->disc->getval))
965 @@ -1027,6 +1031,8 @@
966 return(nv_getv(np,fp));
967 if(flags = nv_isattr(np,NV_EXPORT))
968 nv_offattr(np,NV_EXPORT);
969 + if(dsize && (flags&NV_EXPORT))
971 return(walk_tree(np,(Namval_t*)0,flags));
974 @@ -1083,6 +1089,7 @@
976 nfp = newof(NIL(void*),Namfun_t,1,0);
977 nfp->disc = &treedisc;
978 + nfp->dsize = sizeof(Namfun_t);
982 Index: usr/src/lib/libshell/common/sh/array.c
983 ===================================================================
984 --- usr/src/lib/libshell/common/sh/array.c (revision 1863)
985 +++ usr/src/lib/libshell/common/sh/array.c (working copy)
987 if(array_isbit(aq->bits, dot,ARRAY_CHILD))
989 Namval_t *mp = aq->val[dot].np;
990 - if((aq->header.nelem&ARRAY_NOCHILD) && nv_isvtree(mp))
991 + if((aq->header.nelem&ARRAY_NOCHILD) && nv_isvtree(mp) && !mp->nvfun->dsize)
993 - nv_putsub(mp,NIL(char*),ARRAY_UNDEF);
995 + nv_putsub(mp,NIL(char*),ARRAY_UNDEF);
999 Index: usr/src/lib/libshell/common/sh/name.c
1000 ===================================================================
1001 --- usr/src/lib/libshell/common/sh/name.c (revision 1863)
1002 +++ usr/src/lib/libshell/common/sh/name.c (working copy)
1003 @@ -538,7 +538,11 @@
1006 if(!nv_isarray(np) && !typ && (tp->com.comarg || !tp->com.comset || tp->com.comset->argval[0]!='['))
1009 + if(tp->com.comarg || tp->com.comset)
1010 + np->nvfun->dsize = 0;