PageRenderTime 68ms CodeModel.GetById 38ms RepoModel.GetById 0ms app.codeStats 0ms

/usr/src/lib/libshell/misc/ERRATA.txt

https://bitbucket.org/nexenta/onnv_134
Plain Text | 785 lines | 751 code | 34 blank | 0 comment | 0 complexity | 0ac1715800963dcf8875c6d9e7a267d9 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, GPL-2.0, AGPL-1.0, LGPL-2.1, BSD-3-Clause-No-Nuclear-License-2014, LGPL-2.0, AGPL-3.0, BSD-3-Clause, GPL-3.0, LGPL-3.0, 0BSD
  1. #
  2. # CDDL HEADER START
  3. #
  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.
  7. #
  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.
  12. #
  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]
  18. #
  19. # CDDL HEADER END
  20. #
  21. #
  22. # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
  23. # Use is subject to license terms.
  24. #
  25. #
  26. # ERRATA.txt
  27. #
  28. # Errata/problems/notes about problems in the current sources
  29. #
  30. ######## Errata #001: ########
  31. The usage of |posix_spawn()| has been manually disabled because there seems to be a
  32. race condition which cases sporadic failures like this:
  33. -- snip --
  34. $ builtin | fgrep sum | fgrep sum
  35. /usr/ast/bin/sum
  36. /usr/bin/sum
  37. $ builtin | fgrep sum | fgrep sum
  38. fgrep: fgrep: cannot execute [Exec format error]
  39. -- snip --.
  40. The following files have been changed:
  41. -- snip --
  42. Index: src/lib/libast/sparcv9/include/ast/ast_lib.h
  43. ===================================================================
  44. --- usr/src/lib/libast/sparcv9/include/ast/ast_lib.h (revision 888)
  45. +++ usr/src/lib/libast/sparcv9/include/ast/ast_lib.h (working copy)
  46. @@ -160,7 +160,7 @@
  47. #define _hdr_unistd 1 /* #include <unistd.h> ok */
  48. #define _lib_vfork 1 /* vfork exists and it works */
  49. #define _real_vfork 1 /* vfork child shares data with parent */
  50. -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
  51. +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
  52. #define _stream_peek 1 /* ioctl(I_PEEK) works */
  53. #define _socket_peek 1 /* recv(MSG_PEEK) works */
  54. #define _hdr_string 1 /* #include <string.h> ok */
  55. Index: src/lib/libast/sparcv9/src/lib/libast/ast_lib.h
  56. ===================================================================
  57. --- usr/src/lib/libast/sparcv9/src/lib/libast/ast_lib.h (revision 888)
  58. +++ usr/src/lib/libast/sparcv9/src/lib/libast/ast_lib.h (working copy)
  59. @@ -139,7 +139,7 @@
  60. #define _hdr_unistd 1 /* #include <unistd.h> ok */
  61. #define _lib_vfork 1 /* vfork exists and it works */
  62. #define _real_vfork 1 /* vfork child shares data with parent */
  63. -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
  64. +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
  65. #define _stream_peek 1 /* ioctl(I_PEEK) works */
  66. #define _socket_peek 1 /* recv(MSG_PEEK) works */
  67. #define _hdr_string 1 /* #include <string.h> ok */
  68. Index: src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib
  69. ===================================================================
  70. --- usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib (revision 888)
  71. +++ usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib (working copy)
  72. @@ -139,7 +139,7 @@
  73. #define _hdr_unistd 1 /* #include <unistd.h> ok */
  74. #define _lib_vfork 1 /* vfork exists and it works */
  75. #define _real_vfork 1 /* vfork child shares data with parent */
  76. -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
  77. +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
  78. #define _stream_peek 1 /* ioctl(I_PEEK) works */
  79. #define _socket_peek 1 /* recv(MSG_PEEK) works */
  80. #define _hdr_string 1 /* #include <string.h> ok */
  81. Index: src/lib/libast/sparc/include/ast/ast_lib.h
  82. ===================================================================
  83. --- usr/src/lib/libast/sparc/include/ast/ast_lib.h (revision 888)
  84. +++ usr/src/lib/libast/sparc/include/ast/ast_lib.h (working copy)
  85. @@ -171,7 +171,7 @@
  86. #define _hdr_unistd 1 /* #include <unistd.h> ok */
  87. #define _lib_vfork 1 /* vfork exists and it works */
  88. #define _real_vfork 1 /* vfork child shares data with parent */
  89. -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
  90. +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
  91. #define _stream_peek 1 /* ioctl(I_PEEK) works */
  92. #define _socket_peek 1 /* recv(MSG_PEEK) works */
  93. #define _hdr_string 1 /* #include <string.h> ok */
  94. Index: src/lib/libast/sparc/src/lib/libast/ast_lib.h
  95. ===================================================================
  96. --- usr/src/lib/libast/sparc/src/lib/libast/ast_lib.h (revision 888)
  97. +++ usr/src/lib/libast/sparc/src/lib/libast/ast_lib.h (working copy)
  98. @@ -150,7 +150,7 @@
  99. #define _hdr_unistd 1 /* #include <unistd.h> ok */
  100. #define _lib_vfork 1 /* vfork exists and it works */
  101. #define _real_vfork 1 /* vfork child shares data with parent */
  102. -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
  103. +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
  104. #define _stream_peek 1 /* ioctl(I_PEEK) works */
  105. #define _socket_peek 1 /* recv(MSG_PEEK) works */
  106. #define _hdr_string 1 /* #include <string.h> ok */
  107. Index: src/lib/libast/sparc/src/lib/libast/FEATURE/lib
  108. ===================================================================
  109. --- usr/src/lib/libast/sparc/src/lib/libast/FEATURE/lib (revision 888)
  110. +++ usr/src/lib/libast/sparc/src/lib/libast/FEATURE/lib (working copy)
  111. @@ -150,7 +150,7 @@
  112. #define _hdr_unistd 1 /* #include <unistd.h> ok */
  113. #define _lib_vfork 1 /* vfork exists and it works */
  114. #define _real_vfork 1 /* vfork child shares data with parent */
  115. -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
  116. +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
  117. #define _stream_peek 1 /* ioctl(I_PEEK) works */
  118. #define _socket_peek 1 /* recv(MSG_PEEK) works */
  119. #define _hdr_string 1 /* #include <string.h> ok */
  120. Index: src/lib/libast/i386/include/ast/ast_lib.h
  121. ===================================================================
  122. --- usr/src/lib/libast/i386/include/ast/ast_lib.h (revision 888)
  123. +++ usr/src/lib/libast/i386/include/ast/ast_lib.h (working copy)
  124. @@ -171,7 +171,7 @@
  125. #define _hdr_unistd 1 /* #include <unistd.h> ok */
  126. #define _lib_vfork 1 /* vfork exists and it works */
  127. #define _real_vfork 1 /* vfork child shares data with parent */
  128. -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
  129. +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
  130. #define _stream_peek 1 /* ioctl(I_PEEK) works */
  131. #define _socket_peek 1 /* recv(MSG_PEEK) works */
  132. #define _hdr_string 1 /* #include <string.h> ok */
  133. Index: src/lib/libast/i386/src/lib/libast/ast_lib.h
  134. ===================================================================
  135. --- usr/src/lib/libast/i386/src/lib/libast/ast_lib.h (revision 888)
  136. +++ usr/src/lib/libast/i386/src/lib/libast/ast_lib.h (working copy)
  137. @@ -150,7 +150,7 @@
  138. #define _hdr_unistd 1 /* #include <unistd.h> ok */
  139. #define _lib_vfork 1 /* vfork exists and it works */
  140. #define _real_vfork 1 /* vfork child shares data with parent */
  141. -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
  142. +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
  143. #define _stream_peek 1 /* ioctl(I_PEEK) works */
  144. #define _socket_peek 1 /* recv(MSG_PEEK) works */
  145. #define _hdr_string 1 /* #include <string.h> ok */
  146. Index: src/lib/libast/i386/src/lib/libast/FEATURE/lib
  147. ===================================================================
  148. --- usr/src/lib/libast/i386/src/lib/libast/FEATURE/lib (revision 888)
  149. +++ usr/src/lib/libast/i386/src/lib/libast/FEATURE/lib (working copy)
  150. @@ -150,7 +150,7 @@
  151. #define _hdr_unistd 1 /* #include <unistd.h> ok */
  152. #define _lib_vfork 1 /* vfork exists and it works */
  153. #define _real_vfork 1 /* vfork child shares data with parent */
  154. -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
  155. +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
  156. #define _stream_peek 1 /* ioctl(I_PEEK) works */
  157. #define _socket_peek 1 /* recv(MSG_PEEK) works */
  158. #define _hdr_string 1 /* #include <string.h> ok */
  159. Index: src/lib/libast/amd64/include/ast/ast_lib.h
  160. ===================================================================
  161. --- usr/src/lib/libast/amd64/include/ast/ast_lib.h (revision 888)
  162. +++ usr/src/lib/libast/amd64/include/ast/ast_lib.h (working copy)
  163. @@ -160,7 +160,7 @@
  164. #define _hdr_unistd 1 /* #include <unistd.h> ok */
  165. #define _lib_vfork 1 /* vfork exists and it works */
  166. #define _real_vfork 1 /* vfork child shares data with parent */
  167. -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
  168. +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
  169. #define _stream_peek 1 /* ioctl(I_PEEK) works */
  170. #define _socket_peek 1 /* recv(MSG_PEEK) works */
  171. #define _hdr_string 1 /* #include <string.h> ok */
  172. Index: src/lib/libast/amd64/src/lib/libast/ast_lib.h
  173. ===================================================================
  174. --- usr/src/lib/libast/amd64/src/lib/libast/ast_lib.h (revision 888)
  175. +++ usr/src/lib/libast/amd64/src/lib/libast/ast_lib.h (working copy)
  176. @@ -139,7 +139,7 @@
  177. #define _hdr_unistd 1 /* #include <unistd.h> ok */
  178. #define _lib_vfork 1 /* vfork exists and it works */
  179. #define _real_vfork 1 /* vfork child shares data with parent */
  180. -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
  181. +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
  182. #define _stream_peek 1 /* ioctl(I_PEEK) works */
  183. #define _socket_peek 1 /* recv(MSG_PEEK) works */
  184. #define _hdr_string 1 /* #include <string.h> ok */
  185. Index: src/lib/libast/amd64/src/lib/libast/FEATURE/lib
  186. ===================================================================
  187. --- usr/src/lib/libast/amd64/src/lib/libast/FEATURE/lib (revision 888)
  188. +++ usr/src/lib/libast/amd64/src/lib/libast/FEATURE/lib (working copy)
  189. @@ -139,7 +139,7 @@
  190. #define _hdr_unistd 1 /* #include <unistd.h> ok */
  191. #define _lib_vfork 1 /* vfork exists and it works */
  192. #define _real_vfork 1 /* vfork child shares data with parent */
  193. -#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
  194. +#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
  195. #define _stream_peek 1 /* ioctl(I_PEEK) works */
  196. #define _socket_peek 1 /* recv(MSG_PEEK) works */
  197. #define _hdr_string 1 /* #include <string.h> ok */
  198. -- snip --
  199. ######## Errata #002: ########
  200. The usage of |mmap()| has been manually enabled to improve I/O performance.
  201. The following files have been changed:
  202. -- snip --
  203. Index: usr/src/lib/libast/sparcv9/include/ast/ast_mmap.h
  204. ===================================================================
  205. --- usr/src/lib/libast/sparcv9/include/ast/ast_mmap.h (revision 1701)
  206. +++ usr/src/lib/libast/sparcv9/include/ast/ast_mmap.h (working copy)
  207. @@ -28,6 +28,7 @@
  208. #define _lib_mmap64 1 /* mmap64 interface and implementation work */
  209. #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
  210. #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
  211. +#define _mmap_worthy 2 /* mmap is good */
  212. /* some systems get it wrong but escape concise detection */
  213. #ifndef _NO_MMAP
  214. Index: usr/src/lib/libast/sparcv9/src/lib/libast/ast_mmap.h
  215. ===================================================================
  216. --- usr/src/lib/libast/sparcv9/src/lib/libast/ast_mmap.h (revision 1701)
  217. +++ usr/src/lib/libast/sparcv9/src/lib/libast/ast_mmap.h (working copy)
  218. @@ -7,6 +7,7 @@
  219. #define _lib_mmap64 1 /* mmap64 interface and implementation work */
  220. #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
  221. #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
  222. +#define _mmap_worthy 2 /* mmap is good */
  223. /* some systems get it wrong but escape concise detection */
  224. #ifndef _NO_MMAP
  225. Index: usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mmap
  226. ===================================================================
  227. --- usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mmap (revision 1701)
  228. +++ usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mmap (working copy)
  229. @@ -7,6 +7,7 @@
  230. #define _lib_mmap64 1 /* mmap64 interface and implementation work */
  231. #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
  232. #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
  233. +#define _mmap_worthy 2 /* mmap is good */
  234. /* some systems get it wrong but escape concise detection */
  235. #ifndef _NO_MMAP
  236. Index: usr/src/lib/libast/sparc/include/ast/ast_mmap.h
  237. ===================================================================
  238. --- usr/src/lib/libast/sparc/include/ast/ast_mmap.h (revision 1701)
  239. +++ usr/src/lib/libast/sparc/include/ast/ast_mmap.h (working copy)
  240. @@ -28,7 +28,7 @@
  241. #define _lib_mmap64 1 /* mmap64 interface and implementation work */
  242. #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
  243. #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
  244. -#define _mmap_worthy 1 /* mmap is good */
  245. +#define _mmap_worthy 2 /* mmap is good */
  246. /* some systems get it wrong but escape concise detection */
  247. #ifndef _NO_MMAP
  248. Index: usr/src/lib/libast/sparc/src/lib/libast/ast_mmap.h
  249. ===================================================================
  250. --- usr/src/lib/libast/sparc/src/lib/libast/ast_mmap.h (revision 1701)
  251. +++ usr/src/lib/libast/sparc/src/lib/libast/ast_mmap.h (working copy)
  252. @@ -7,7 +7,7 @@
  253. #define _lib_mmap64 1 /* mmap64 interface and implementation work */
  254. #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
  255. #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
  256. -#define _mmap_worthy 1 /* mmap is good */
  257. +#define _mmap_worthy 2 /* mmap is good */
  258. /* some systems get it wrong but escape concise detection */
  259. #ifndef _NO_MMAP
  260. Index: usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mmap
  261. ===================================================================
  262. --- usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mmap (revision 1701)
  263. +++ usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mmap (working copy)
  264. @@ -7,7 +7,7 @@
  265. #define _lib_mmap64 1 /* mmap64 interface and implementation work */
  266. #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
  267. #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
  268. -#define _mmap_worthy 1 /* mmap is good */
  269. +#define _mmap_worthy 2 /* mmap is good */
  270. /* some systems get it wrong but escape concise detection */
  271. #ifndef _NO_MMAP
  272. Index: usr/src/lib/libast/i386/include/ast/ast_mmap.h
  273. ===================================================================
  274. --- usr/src/lib/libast/i386/include/ast/ast_mmap.h (revision 1701)
  275. +++ usr/src/lib/libast/i386/include/ast/ast_mmap.h (working copy)
  276. @@ -28,6 +28,7 @@
  277. #define _lib_mmap64 1 /* mmap64 interface and implementation work */
  278. #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
  279. #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
  280. +#define _mmap_worthy 2 /* mmap is good */
  281. /* some systems get it wrong but escape concise detection */
  282. #ifndef _NO_MMAP
  283. Index: usr/src/lib/libast/i386/src/lib/libast/ast_mmap.h
  284. ===================================================================
  285. --- usr/src/lib/libast/i386/src/lib/libast/ast_mmap.h (revision 1701)
  286. +++ usr/src/lib/libast/i386/src/lib/libast/ast_mmap.h (working copy)
  287. @@ -7,6 +7,7 @@
  288. #define _lib_mmap64 1 /* mmap64 interface and implementation work */
  289. #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
  290. #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
  291. +#define _mmap_worthy 2 /* mmap is good */
  292. /* some systems get it wrong but escape concise detection */
  293. #ifndef _NO_MMAP
  294. Index: usr/src/lib/libast/i386/src/lib/libast/FEATURE/mmap
  295. ===================================================================
  296. --- usr/src/lib/libast/i386/src/lib/libast/FEATURE/mmap (revision 1701)
  297. +++ usr/src/lib/libast/i386/src/lib/libast/FEATURE/mmap (working copy)
  298. @@ -7,6 +7,7 @@
  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 */
  303. /* some systems get it wrong but escape concise detection */
  304. #ifndef _NO_MMAP
  305. Index: usr/src/lib/libast/amd64/include/ast/ast_mmap.h
  306. ===================================================================
  307. --- usr/src/lib/libast/amd64/include/ast/ast_mmap.h (revision 1701)
  308. +++ usr/src/lib/libast/amd64/include/ast/ast_mmap.h (working copy)
  309. @@ -28,6 +28,7 @@
  310. #define _lib_mmap64 1 /* mmap64 interface and implementation work */
  311. #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
  312. #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
  313. +#define _mmap_worthy 2 /* mmap is good */
  314. /* some systems get it wrong but escape concise detection */
  315. #ifndef _NO_MMAP
  316. Index: usr/src/lib/libast/amd64/src/lib/libast/ast_mmap.h
  317. ===================================================================
  318. --- usr/src/lib/libast/amd64/src/lib/libast/ast_mmap.h (revision 1701)
  319. +++ usr/src/lib/libast/amd64/src/lib/libast/ast_mmap.h (working copy)
  320. @@ -7,6 +7,7 @@
  321. #define _lib_mmap64 1 /* mmap64 interface and implementation work */
  322. #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
  323. #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
  324. +#define _mmap_worthy 2 /* mmap is good */
  325. /* some systems get it wrong but escape concise detection */
  326. #ifndef _NO_MMAP
  327. Index: usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mmap
  328. ===================================================================
  329. --- usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mmap (revision 1701)
  330. +++ usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mmap (working copy)
  331. @@ -7,6 +7,7 @@
  332. #define _lib_mmap64 1 /* mmap64 interface and implementation work */
  333. #define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
  334. #define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
  335. +#define _mmap_worthy 2 /* mmap is good */
  336. /* some systems get it wrong but escape concise detection */
  337. #ifndef _NO_MMAP
  338. -- snip --
  339. ######## Errata #003: ########
  340. A workaround was added for a problem with the "multiline" editor mode which
  341. occurs when the edit line becomes longer than the terminal's width and the
  342. terminal cursor is not at position 0 when PS1 is send to the terminal.
  343. For example: The user executes a $ printf "foo"<enter> # the prompt will start
  344. at position 3 instead of 0. If the user enters a command which is longer than
  345. the terminal width and then removes enougth characters that the edit line fits
  346. again into one line the "foo" at the beginning will be overwritten with the
  347. prompt.
  348. The workaround is to add $(printf "%*s\r%s" COLUMNS "") at the beginning of
  349. PS1 set by /etc/ksh.kshrc, this causes the shell to move to the beginning
  350. of the next line if the terminal cursor is not at position 0.
  351. ######## Errata #004: ########
  352. A workaround has been added for a probem with the AST "tail" builtin which
  353. causes "tail" to sleep too long when polling for data in "follow" mode.
  354. The following files have been changed:
  355. -- snip --
  356. Index: src/lib/libcmd/common/tail.c
  357. ===================================================================
  358. --- usr/src/lib/libcmd/common/tail.c (revision 1701)
  359. +++ usr/src/lib/libcmd/common/tail.c (working copy)
  360. @@ -636,7 +636,14 @@
  361. {
  362. if (sfsync(sfstdout))
  363. error(ERROR_system(1), "write error");
  364. +#if 0
  365. sleep(1);
  366. +#else
  367. + {
  368. + struct timespec rqt = { 0L, 1000000000L/4L };
  369. + (void)nanosleep(&rqt, NULL);
  370. + }
  371. +#endif
  372. n = 0;
  373. pp = 0;
  374. while (fp)
  375. -- snip --
  376. ######## Errata #005: ########
  377. The POSIX "cksum"/CRC and AT&T "sum" codepaths in libsum have been reworked
  378. and then backpoprted to address a performance regression on some
  379. machine/architecture combinations.
  380. The following files have been changed:
  381. -- snip --
  382. Index: usr/src/lib/libsum/common/sum-crc.c
  383. ===================================================================
  384. --- usr/src/lib/libsum/common/sum-crc.c (revision 1724)
  385. +++ usr/src/lib/libsum/common/sum-crc.c (working copy)
  386. @@ -48,7 +48,8 @@
  387. Crcnum_t init;
  388. Crcnum_t done;
  389. Crcnum_t xorsize;
  390. - Crcnum_t tab[256];
  391. + const Crcnum_t *tab; /* use |const| to give the compiler a hint that the data won't change */
  392. + Crcnum_t tabdata[256];
  393. unsigned int addsize;
  394. unsigned int rotate;
  395. } Crc_t;
  396. @@ -56,6 +57,62 @@
  397. #define CRC(p,s,c) (s = (s >> 8) ^ (p)->tab[(s ^ (c)) & 0xff])
  398. #define CRCROTATE(p,s,c) (s = (s << 8) ^ (p)->tab[((s >> 24) ^ (c)) & 0xff])
  399. +static const
  400. +Crcnum_t posix_cksum_tab[256] = {
  401. + 0x00000000U,
  402. + 0x04c11db7U, 0x09823b6eU, 0x0d4326d9U, 0x130476dcU, 0x17c56b6bU,
  403. + 0x1a864db2U, 0x1e475005U, 0x2608edb8U, 0x22c9f00fU, 0x2f8ad6d6U,
  404. + 0x2b4bcb61U, 0x350c9b64U, 0x31cd86d3U, 0x3c8ea00aU, 0x384fbdbdU,
  405. + 0x4c11db70U, 0x48d0c6c7U, 0x4593e01eU, 0x4152fda9U, 0x5f15adacU,
  406. + 0x5bd4b01bU, 0x569796c2U, 0x52568b75U, 0x6a1936c8U, 0x6ed82b7fU,
  407. + 0x639b0da6U, 0x675a1011U, 0x791d4014U, 0x7ddc5da3U, 0x709f7b7aU,
  408. + 0x745e66cdU, 0x9823b6e0U, 0x9ce2ab57U, 0x91a18d8eU, 0x95609039U,
  409. + 0x8b27c03cU, 0x8fe6dd8bU, 0x82a5fb52U, 0x8664e6e5U, 0xbe2b5b58U,
  410. + 0xbaea46efU, 0xb7a96036U, 0xb3687d81U, 0xad2f2d84U, 0xa9ee3033U,
  411. + 0xa4ad16eaU, 0xa06c0b5dU, 0xd4326d90U, 0xd0f37027U, 0xddb056feU,
  412. + 0xd9714b49U, 0xc7361b4cU, 0xc3f706fbU, 0xceb42022U, 0xca753d95U,
  413. + 0xf23a8028U, 0xf6fb9d9fU, 0xfbb8bb46U, 0xff79a6f1U, 0xe13ef6f4U,
  414. + 0xe5ffeb43U, 0xe8bccd9aU, 0xec7dd02dU, 0x34867077U, 0x30476dc0U,
  415. + 0x3d044b19U, 0x39c556aeU, 0x278206abU, 0x23431b1cU, 0x2e003dc5U,
  416. + 0x2ac12072U, 0x128e9dcfU, 0x164f8078U, 0x1b0ca6a1U, 0x1fcdbb16U,
  417. + 0x018aeb13U, 0x054bf6a4U, 0x0808d07dU, 0x0cc9cdcaU, 0x7897ab07U,
  418. + 0x7c56b6b0U, 0x71159069U, 0x75d48ddeU, 0x6b93dddbU, 0x6f52c06cU,
  419. + 0x6211e6b5U, 0x66d0fb02U, 0x5e9f46bfU, 0x5a5e5b08U, 0x571d7dd1U,
  420. + 0x53dc6066U, 0x4d9b3063U, 0x495a2dd4U, 0x44190b0dU, 0x40d816baU,
  421. + 0xaca5c697U, 0xa864db20U, 0xa527fdf9U, 0xa1e6e04eU, 0xbfa1b04bU,
  422. + 0xbb60adfcU, 0xb6238b25U, 0xb2e29692U, 0x8aad2b2fU, 0x8e6c3698U,
  423. + 0x832f1041U, 0x87ee0df6U, 0x99a95df3U, 0x9d684044U, 0x902b669dU,
  424. + 0x94ea7b2aU, 0xe0b41de7U, 0xe4750050U, 0xe9362689U, 0xedf73b3eU,
  425. + 0xf3b06b3bU, 0xf771768cU, 0xfa325055U, 0xfef34de2U, 0xc6bcf05fU,
  426. + 0xc27dede8U, 0xcf3ecb31U, 0xcbffd686U, 0xd5b88683U, 0xd1799b34U,
  427. + 0xdc3abdedU, 0xd8fba05aU, 0x690ce0eeU, 0x6dcdfd59U, 0x608edb80U,
  428. + 0x644fc637U, 0x7a089632U, 0x7ec98b85U, 0x738aad5cU, 0x774bb0ebU,
  429. + 0x4f040d56U, 0x4bc510e1U, 0x46863638U, 0x42472b8fU, 0x5c007b8aU,
  430. + 0x58c1663dU, 0x558240e4U, 0x51435d53U, 0x251d3b9eU, 0x21dc2629U,
  431. + 0x2c9f00f0U, 0x285e1d47U, 0x36194d42U, 0x32d850f5U, 0x3f9b762cU,
  432. + 0x3b5a6b9bU, 0x0315d626U, 0x07d4cb91U, 0x0a97ed48U, 0x0e56f0ffU,
  433. + 0x1011a0faU, 0x14d0bd4dU, 0x19939b94U, 0x1d528623U, 0xf12f560eU,
  434. + 0xf5ee4bb9U, 0xf8ad6d60U, 0xfc6c70d7U, 0xe22b20d2U, 0xe6ea3d65U,
  435. + 0xeba91bbcU, 0xef68060bU, 0xd727bbb6U, 0xd3e6a601U, 0xdea580d8U,
  436. + 0xda649d6fU, 0xc423cd6aU, 0xc0e2d0ddU, 0xcda1f604U, 0xc960ebb3U,
  437. + 0xbd3e8d7eU, 0xb9ff90c9U, 0xb4bcb610U, 0xb07daba7U, 0xae3afba2U,
  438. + 0xaafbe615U, 0xa7b8c0ccU, 0xa379dd7bU, 0x9b3660c6U, 0x9ff77d71U,
  439. + 0x92b45ba8U, 0x9675461fU, 0x8832161aU, 0x8cf30badU, 0x81b02d74U,
  440. + 0x857130c3U, 0x5d8a9099U, 0x594b8d2eU, 0x5408abf7U, 0x50c9b640U,
  441. + 0x4e8ee645U, 0x4a4ffbf2U, 0x470cdd2bU, 0x43cdc09cU, 0x7b827d21U,
  442. + 0x7f436096U, 0x7200464fU, 0x76c15bf8U, 0x68860bfdU, 0x6c47164aU,
  443. + 0x61043093U, 0x65c52d24U, 0x119b4be9U, 0x155a565eU, 0x18197087U,
  444. + 0x1cd86d30U, 0x029f3d35U, 0x065e2082U, 0x0b1d065bU, 0x0fdc1becU,
  445. + 0x3793a651U, 0x3352bbe6U, 0x3e119d3fU, 0x3ad08088U, 0x2497d08dU,
  446. + 0x2056cd3aU, 0x2d15ebe3U, 0x29d4f654U, 0xc5a92679U, 0xc1683bceU,
  447. + 0xcc2b1d17U, 0xc8ea00a0U, 0xd6ad50a5U, 0xd26c4d12U, 0xdf2f6bcbU,
  448. + 0xdbee767cU, 0xe3a1cbc1U, 0xe760d676U, 0xea23f0afU, 0xeee2ed18U,
  449. + 0xf0a5bd1dU, 0xf464a0aaU, 0xf9278673U, 0xfde69bc4U, 0x89b8fd09U,
  450. + 0x8d79e0beU, 0x803ac667U, 0x84fbdbd0U, 0x9abc8bd5U, 0x9e7d9662U,
  451. + 0x933eb0bbU, 0x97ffad0cU, 0xafb010b1U, 0xab710d06U, 0xa6322bdfU,
  452. + 0xa2f33668U, 0xbcb4666dU, 0xb8757bdaU, 0xb5365d03U, 0xb1f740b4U
  453. +};
  454. +
  455. static Sum_t*
  456. crc_open(const Method_t* method, const char* name)
  457. {
  458. @@ -73,62 +130,80 @@
  459. sum->method = (Method_t*)method;
  460. sum->name = name;
  461. }
  462. - polynomial = 0xedb88320;
  463. - s = name;
  464. - while (*(t = s))
  465. +
  466. + if(!strcmp(name, "crc-0x04c11db7-rotate-done-size"))
  467. {
  468. - for (t = s, v = 0; *s && *s != '-'; s++)
  469. - if (*s == '=' && !v)
  470. - v = s;
  471. - i = (v ? v : s) - t;
  472. - if (isdigit(*t) || v && i >= 4 && strneq(t, "poly", 4) && (t = v + 1))
  473. - polynomial = strtoul(t, NiL, 0);
  474. - else if (strneq(t, "done", i))
  475. - sum->done = v ? strtoul(v + 1, NiL, 0) : ~sum->done;
  476. - else if (strneq(t, "init", i))
  477. - sum->init = v ? strtoul(v + 1, NiL, 0) : ~sum->init;
  478. - else if (strneq(t, "rotate", i))
  479. - sum->rotate = 1;
  480. - else if (strneq(t, "size", i))
  481. - {
  482. - sum->addsize = 1;
  483. - if (v)
  484. - sum->xorsize = strtoul(v + 1, NiL, 0);
  485. - }
  486. - if (*s == '-')
  487. - s++;
  488. + sum->init=0;
  489. + sum->done=0xffffffff;
  490. + sum->xorsize=0x0;
  491. + sum->addsize=0x1;
  492. + sum->rotate=1;
  493. +
  494. + /* Optimized codepath for POSIX cksum to save startup time */
  495. + sum->tab=posix_cksum_tab;
  496. }
  497. - if (sum->rotate)
  498. + else
  499. {
  500. - Crcnum_t t;
  501. - Crcnum_t p[8];
  502. -
  503. - p[0] = polynomial;
  504. - for (i = 1; i < 8; i++)
  505. - p[i] = (p[i-1] << 1) ^ ((p[i-1] & 0x80000000) ? polynomial : 0);
  506. - for (i = 0; i < elementsof(sum->tab); i++)
  507. + polynomial = 0xedb88320;
  508. + s = name;
  509. + while (*(t = s))
  510. {
  511. - t = 0;
  512. - x = i;
  513. - for (j = 0; j < 8; j++)
  514. + for (t = s, v = 0; *s && *s != '-'; s++)
  515. + if (*s == '=' && !v)
  516. + v = s;
  517. + i = (v ? v : s) - t;
  518. + if (isdigit(*t) || v && i >= 4 && strneq(t, "poly", 4) && (t = v + 1))
  519. + polynomial = strtoul(t, NiL, 0);
  520. + else if (strneq(t, "done", i))
  521. + sum->done = v ? strtoul(v + 1, NiL, 0) : ~sum->done;
  522. + else if (strneq(t, "init", i))
  523. + sum->init = v ? strtoul(v + 1, NiL, 0) : ~sum->init;
  524. + else if (strneq(t, "rotate", i))
  525. + sum->rotate = 1;
  526. + else if (strneq(t, "size", i))
  527. {
  528. - if (x & 1)
  529. - t ^= p[j];
  530. - x >>= 1;
  531. + sum->addsize = 1;
  532. + if (v)
  533. + sum->xorsize = strtoul(v + 1, NiL, 0);
  534. }
  535. - sum->tab[i] = t;
  536. + if (*s == '-')
  537. + s++;
  538. }
  539. - }
  540. - else
  541. - {
  542. - for (i = 0; i < elementsof(sum->tab); i++)
  543. + if (sum->rotate)
  544. {
  545. - x = i;
  546. - for (j = 0; j < 8; j++)
  547. - x = (x>>1) ^ ((x & 1) ? polynomial : 0);
  548. - sum->tab[i] = x;
  549. + Crcnum_t t;
  550. + Crcnum_t p[8];
  551. +
  552. + p[0] = polynomial;
  553. + for (i = 1; i < 8; i++)
  554. + p[i] = (p[i-1] << 1) ^ ((p[i-1] & 0x80000000) ? polynomial : 0);
  555. + for (i = 0; i < elementsof(sum->tabdata); i++)
  556. + {
  557. + t = 0;
  558. + x = i;
  559. + for (j = 0; j < 8; j++)
  560. + {
  561. + if (x & 1)
  562. + t ^= p[j];
  563. + x >>= 1;
  564. + }
  565. + sum->tabdata[i] = t;
  566. + }
  567. }
  568. + else
  569. + {
  570. + for (i = 0; i < elementsof(sum->tabdata); i++)
  571. + {
  572. + x = i;
  573. + for (j = 0; j < 8; j++)
  574. + x = (x>>1) ^ ((x & 1) ? polynomial : 0);
  575. + sum->tabdata[i] = x;
  576. + }
  577. + }
  578. +
  579. + sum->tab=sum->tabdata;
  580. }
  581. +
  582. return (Sum_t*)sum;
  583. }
  584. @@ -141,11 +216,77 @@
  585. return 0;
  586. }
  587. +#if defined(__SUNPRO_C) || defined(__GNUC__)
  588. +
  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)
  594. +#else
  595. +# error Unknown compiler
  596. +#endif
  597. +
  598. +#define CBLOCK_SIZE (64)
  599. +#pragma unroll(16)
  600. +
  601. static int
  602. crc_block(Sum_t* p, const void* s, size_t n)
  603. {
  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;
  608. + unsigned short i;
  609. +
  610. + sum_prefetch(b);
  611. +
  612. + if (sum->rotate)
  613. + {
  614. + while (n > CBLOCK_SIZE)
  615. + {
  616. + sum_prefetch(b+CBLOCK_SIZE);
  617. + for(i=0 ; i < CBLOCK_SIZE ; i++)
  618. + {
  619. + CRCROTATE(sum, c, *b++);
  620. + }
  621. +
  622. + n-=CBLOCK_SIZE;
  623. + }
  624. +
  625. + while (b < e)
  626. + {
  627. + CRCROTATE(sum, c, *b++);
  628. + }
  629. + }
  630. + else
  631. + {
  632. + while (n > CBLOCK_SIZE)
  633. + {
  634. + sum_prefetch(b+CBLOCK_SIZE);
  635. + for(i=0 ; i < CBLOCK_SIZE ; i++)
  636. + {
  637. + CRC(sum, c, *b++);
  638. + }
  639. +
  640. + n-=CBLOCK_SIZE;
  641. + }
  642. +
  643. + while (b < e)
  644. + {
  645. + CRC(sum, c, *b++);
  646. + }
  647. + }
  648. +
  649. + sum->sum = c;
  650. + return 0;
  651. +}
  652. +#else
  653. +static int
  654. +crc_block(Sum_t* p, const void* s, size_t n)
  655. +{
  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;
  660. @@ -158,6 +299,7 @@
  661. sum->sum = c;
  662. return 0;
  663. }
  664. +#endif /* defined(__SUNPRO_C) || defined(__GNUC__) */
  665. static int
  666. crc_done(Sum_t* p)
  667. Index: usr/src/lib/libsum/common/sum-att.c
  668. ===================================================================
  669. --- usr/src/lib/libsum/common/sum-att.c (revision 1724)
  670. +++ usr/src/lib/libsum/common/sum-att.c (working copy)
  671. @@ -35,10 +35,73 @@
  672. #define att_data long_data
  673. #define att_scale 512
  674. +#if defined(__SUNPRO_C) || defined(__GNUC__)
  675. +
  676. +#if defined(__SUNPRO_C)
  677. +# include <sun_prefetch.h>
  678. +# define sum_prefetch(addr) sun_prefetch_read_many((void *)(addr))
  679. +#elif defined(__GNUC__)
  680. +# define sum_prefetch(addr) __builtin_prefetch((addr), 0, 3)
  681. +#else
  682. +# error Unknown compiler
  683. +#endif
  684. +
  685. +#define CBLOCK_SIZE (64)
  686. +#pragma unroll(16)
  687. +
  688. +/* Inmos transputer would love this algorithm */
  689. static int
  690. att_block(register Sum_t* p, const void* s, size_t n)
  691. {
  692. register uint32_t c = ((Integral_t*)p)->sum;
  693. + register const unsigned char* b = (const unsigned char*)s;
  694. + register const unsigned char* e = b + n;
  695. + register uint32_t s0, s1, s2, s3, s4, s5, s6, s7;
  696. + register unsigned int i;
  697. +
  698. + s0=s1=s2=s3=s4=s5=s6=s7=0U;
  699. +
  700. + sum_prefetch((void *)b);
  701. +
  702. + while (n > CBLOCK_SIZE)
  703. + {
  704. + sum_prefetch((b+CBLOCK_SIZE));
  705. +
  706. + /* Compiler will unroll for() loops per #pragma unroll */
  707. + for (i=0 ; i < (CBLOCK_SIZE/8) ; i++)
  708. + {
  709. + /*
  710. + * use s0-s7 to decouple calculations (this improves pipelining)
  711. + * because each operation is completely independent from it's
  712. + * siblings
  713. + */
  714. + s0+=b[0];
  715. + s1+=b[1];
  716. + s2+=b[2];
  717. + s3+=b[3];
  718. + s4+=b[4];
  719. + s5+=b[5];
  720. + s6+=b[6];
  721. + s7+=b[7];
  722. +
  723. + b+=8;
  724. + n-=8;
  725. + }
  726. + }
  727. +
  728. + c+=s0+s1+s2+s3+s4+s5+s6+s7;
  729. +
  730. + while (b < e)
  731. + c += *b++;
  732. + ((Integral_t*)p)->sum = c;
  733. + return 0;
  734. +}
  735. +
  736. +#else
  737. +static int
  738. +att_block(register Sum_t* p, const void* s, size_t n)
  739. +{
  740. + register uint32_t c = ((Integral_t*)p)->sum;
  741. register unsigned char* b = (unsigned char*)s;
  742. register unsigned char* e = b + n;
  743. @@ -47,6 +110,7 @@
  744. ((Integral_t*)p)->sum = c;
  745. return 0;
  746. }
  747. +#endif /* defined(__SUNPRO_C) || defined(__GNUC__) */
  748. static int
  749. att_done(Sum_t* p)
  750. -- snip --
  751. # EOF.