Hi! ----
Forwarding the email to ksh93-integration-discuss at opensolaris.org (seems I forgot to say that the list should be CC:'ed for all emails send to this ARC case... ;-( ) ... ... we've started the ksh93 update1 ARC case, timeout is set to timeout 02/15/2008 (see below). Setting Reply-To: to PSARC-ext at Sun.Com and ksh93-integration-discuss at opensolaris.org -------- Original Message -------- Subject: ksh93 Update 1 [PSARC/2008/094 FastTrack timeout 02/15/2008] Date: Fri, 8 Feb 2008 18:05:51 -0800 (PST) From: Joseph Kowalski <j...@train1.eng.sun.com> To: PSARC-ext at Sun.Com, roland.mainz at nrubsig.org Template Version: @(#)sac_nextcase 1.64 07/13/07 SMI This information is Copyright 2008 Sun Microsystems 1. Introduction 1.1. Project/Component Working Name: ksh93 Update 1 1.2. Name of Document Author/Supplier: Author: Roland Mainz 1.3 Date of This Document: 08 February, 2008 4. Technical Description I'm sponsoring this fast-track request on behalf of XXX. Please note that this is an *open* case. The release binding is the same as with the previous ksh93 project: a patch/micro release of Solaris delivering through OS/Net Stability levels are as described below. Additional materials (man pages and diffs) can be found in the 'materials' subdirectory. This project is an amendment to the Korn Shell 93 Integration project (PSARC/2006/550 and PSARC/2007/035) specifying the following additional interfaces: 1) Update of ksh93 from upstream release ast-ksh.2007-04-18 to ast-ksh-2007-12-01 1.1) Update ksh93 1.2) Update the /usr/bin/bg, /usr/bin/cd, /usr/bin/command, /usr/bin/fc, /usr/bin/fg, /usr/bin/getopts, /usr/bin/hash, /usr/bin/jobs, /usr/bin/kill, /usr/bin/read, /usr/bin/test, /usr/bin/type, /usr/bin/ulimit, /usr/bin/umask, /usr/bin/unalias, /usr/bin/wait from ksh88 to ksh93 1.3) New ksh93 math functions based on C99 1.4) Enable built-ins "sync", "mkfifo", "tty" and "logname" by default 1.5) Status change of /usr/demo/ksh/ directory 1.6) New messaging catalog files for ksh libraries 1.7) Enable "multiline" input mode by default for interactive shells 1.9) Enable default prompt (PS1) for interactive shells 2) Enhancement of /usr/bin/printf 3) Enhancement of /usr/bin/sleep 4) The addition of /usr/bin/rev 5) An enhanced version of the "sum" utility and an identical ksh93 built-in command and related library libsum.so.1 6) Add AT&T "shcomp" (shell script compiler) and "shbinexec" kernel module 6.1) Addition of AT&T "shcomp" (shell script compiler) 6.2) Addition of kernel module to recognize "shbin" executables Bug/RFE Number(s): 6619428 RFE: Update ksh93 in Solaris to ast-ksh.2007-10-15 (or higher) 6561901 RFE: Add "shcomp" (shell script compiler) + kernel module to exec binary sh code 6595183 RFE: Update ksh93-integration demo code 6451262 RFE: /usr/bin/sleep should support floating-point values 6207901 ksh and test ignore sub-second timestamp portion 6599668 RFE: Move consumers of alias.sh over to ksh93 6631969 /usr/bin/printf does not recognize positional arguments like %n$ Interface Stability Description --------- --------- ----------- /usr/bin/bg Commited bg command /usr/bin/cd Commited cd command /usr/bin/command Commited command command /usr/bin/fc Commited fc command /usr/bin/fg Commited fg command /usr/bin/getopts Commited getopts command /usr/bin/hash Commited hash command /usr/bin/jobs Commited jobs command /usr/bin/kill Commited kill command /usr/bin/printf Commited printf command /usr/bin/read Commited read command /usr/bin/rev Commited rev command /usr/bin/sleep Commited sleep command /usr/bin/shcomp Commited AT&T ksh shell script compiler /usr/bin/sum Commited sum command /usr/bin/test Commited test command /usr/bin/type Commited type command /usr/bin/ulimit Commited ulimit command /usr/bin/umask Commited umask command /usr/bin/unalias Commited unalias command /usr/bin/wait Commited wait command /usr/demo/ksh/ Not an Interface demo directory /usr/lib/libsum.so.1 Project Private AT&T hash generation library /usr/lib/amd64/libsum.so.1 Project Private AT&T hash generation library /usr/lib/sparcv9/libsum.so.1 Project Private AT&T hash generation library <shbinexec binary format> Commited Private binary shell script file format <shcomp -D output> Not an Interface output for l10n catalog generation <new C99 math functions> Commited C99 math functions ### Part 1: Update of ksh93 from upstream release ast-ksh.2007-04-18 to ast-ksh.2007-12-01 ## Part 1.1: Update of ksh93 The 1.1 portion of this project is the update of ksh93 from ast-ksh.2007-04-18 to ast-ksh-2007-12-15 which marks the update from ksh93 version 's-' to version 's+' (AST/ksh93 uses the (latin) alphabet for it's version number, e.g. version 'a', version 'b' etc. ; the '+'/'-' means the stabilty status, e.g. '-' means it's "alpha", no suffix means it's "stable" (e.g. ready for production usage) and '+' means it's a bugfixed stable version etc.). ## Part 1.2: Update the /usr/bin/bg, /usr/bin/cd, /usr/bin/command, /usr/bin/fc, /usr/bin/fg, /usr/bin/getopts /usr/bin/hash, /usr/bin/jobs, /usr/bin/kill /usr/bin/read, /usr/bin/test, /usr/bin/type /usr/bin/ulimit, /usr/bin/umask, /usr/bin/unalias /usr/bin/wait from ksh88 to ksh93 The 1.2 portion of this project switches the built-in command wrappers (the commands are plain shell script wrappers which invoke the built-in command of the same name) /usr/bin/bg, /usr/bin/cd is the update of /usr/bin/command, /usr/bin/fc, /usr/bin/fg, /usr/bin/getopts, /usr/bin/hash, /usr/bin/jobs, /usr/bin/kill, /usr/bin/read, /usr/bin/test, /usr/bin/type, /usr/bin/ulimit, /usr/bin/umask, /usr/bin/unalias and /usr/bin/wait from /usr/bin/ksh to /usr/bin/ksh93 Notes: - /usr/bin/test now support high-resolution timestamps of up to nanosecond granularity, for filesystems which support them. Any scripts which rely on a behavior like that creating two files in sequential order within less than a second will result in identical timestamps for both files is considered as a bug in the script. - /usr/bin/test now supports 64bit integers, floating point values and floating point constants (like {+Inf, -Inf, +NaN, -NaN}) (in all representations required by C99/XPG6/SUS) for numeric comparisations. - The output of "/usr/bin/ulimit -a" has changed in incompatible ways, e.g. previously a two-column output was used while now a three-column is printed. However the output of "/usr/bin/ulimit -a" is considered as "not an interface", e.g. it is only thought for informative purposes and not a scripting interface (this interpretation is supported by trhe detail that the output doesn't use things like TAB for formatting, that almost every shell defines it's own "ulimit -a" output format, that even adding new options would break the output anyway and that the ulimit(1) manual page only lists the "-f" option as supported by /usr/bin/ulimit (i.e. the option "-a" was undocumented for /usr/bin/ulimit (which contradicts "Example 1" in the manual page which shows the output of "ulimit -a"))). The output of other /usr/bin/ulimit options is not affected and remains compatible. - These special built-ins are available as standalone files because the POSIX people did make a decision long ago that all "special shell"-builtins defined in the standard must be "exec"-able - sounds weired but there are some border-cases where this is useful (for example you can bind such a built-in to a path like /usr/bin/cd which would execute the "cd" command only if the PATH lookup hits /usr/bin/). - /usr/bin/kill now handles the number of realtime signals at runtime based on the "getconf" value of |_POSIX_RTSIG_MAX|&co. - the old version of /usr/bin/kill used a hardcoded number of realtime signals defined at compile time (the current number of realtime signals supported in /usr/bin/kill will not change between the old and new version - the change will occur when the number of realtime signals supported by the kernel will be changed). - The non-existing signal name "EXIT" has been removed. It's an artifact of /usr/bin/kill being based on ksh88 which mapped trap names to signal names in this case. The new version of /usr/bin/kill will no longer list "EXIT" as signal name in the "-l" output but will continue to recognize this name as input (e.g. $ /usr/bin/kill -EXIT <pid> # will behave like $ /usr/bin/kill -0 <pid> #). - The output of "/usr/bin/kill -l" now uses a newline as delimiter for signal names while the old version used a space. This is not considered an interface change since both the Solaris manual page and the standards explicitly allow either newline or space as delimiter. ## Part 1.3: New ksh93 math functions based on C99 The 1.3 portion of this project is the addition of new functions which can be used within arithmetic expressions like (( expressions )) These functions work identically to those defined for the "C" language in the C99 standard (the ksh93 originally supported only "abs", "acos", "asin", "atan", "cos", "cosh", "exp", "int", "log", "sin", "sinh", "sqrt", "tan" and "tanh" as described in ksh93(1) - we extend this list to those functions required by the C99 standard) (note that this functionality is already present in the ksh93 version we ship, e.g. we only increase the stablity level from "easter egg" (="undocumented") to "commited"): Function name | Prototype | see manual page ---------------+--------------------------------------+----------------- acos | float acos(float) | acos(3m) acosh | float acosh(float) | acosh(3m) asin | float asin(float) | asin(3m) asinh | float asinh(float) | asinh(3m) atan | float atan(float) | atan(3m) atan2 | float atan2(float, float) | atan2(3m) atanh | float atanh(float) | atanh(3m) cbrt | float cbrt(float) | cbrt(3m) copysign | float copysign(float, float) | copysign(3m) cos | float cos(float) | cos(3m) cosh | float cosh(float) | cosh(3m) erf | float erf(float) | erf(3m) erfc | float erfc(float) | erfc(3m) exp | float exp(float) | exp(3m) exp2 | float exp2(float) | exp2(3m) expm1 | float expm1(float) | expm1(3m) fabs | float fabs(float) | fabs(3m) abs | float abs(float) | abs(3c) fdim | float fdim(float, float) | fdim(3m) finite | float finite(float) | finite(3c) floor | float floor(float) | floor(3m) int | float int(float) |<no manual page> fma | float fma(float, float, float)| fma(3m) fmax | float fmax(float, float) | fmax(3m) fmin | float fmin(float, float) | fmin(3m) fmod | float fmod(float, float) | fmod(3m) fpclassify | integer fpclassify(float) | fpclassify(3m) hypot | float hypot(float, float) | hypot(3m) ilogb | integer ilogb(float) | ilogb(3m) isfinite | integer isfinite(float) | isfinite(3m) isgreater | integer isgreater(float, float)| isgreater(3m) isgreaterequal | integer isgreaterequal(float, float)| isgreaterequal(3m) isinf | integer isinf(float) | isinf(3m) isless | integer isless(float, float) | isless(3m) islessequal | integer islessequal(float, float) | islessequal(3m) islessgreater | integer islessgreater(float, float) | islessgreater(3m) isnan | integer isnan(float) | isnan(3m) isnormal | integer isnormal(float) | isnormal(3m) isunordered | integer isunordered(float, float)| isunordered(3m) lgamma | float lgamma(float) | lgamma(3m) log | float log(float) | log(3m) log1p | float log1p(float) | log1p(3m) log2 | float log2(float) | log2(3m) logb | float logb(float) | logb(3m) nearbyint | float nearbyint(float) | nearbyint(3m) nextafter | float nextafter(float, float) | nextafter(3m) nexttoward | float nexttoward(float, float)| nexttoward(3m) pow | float pow(float, float) | pow(3m) remainder | float remainder(float, float) | remainder(3m) rint | float rint(float) | rint(3m) round | float round(float) | round(3m) scalb | float scalb(float, float) | scalb(3m) scalbn | float scalbn(float, float) | scalbn(3m) signbit | integer signbit(float) | signbit(3m) sin | float sin(float) | sin(3m) sinh | float sinh(float) | sinh(3m) sqrt | float sqrt(float) | sqrt(3m) tan | float tan(float) | tan(3m) tanh | float tanh(float) | tanh(3m) tgamma | float tgamma(float) | tgamma(3m) trunc | float trunc(float) | trunc(3m) (note: the datatypes "integer" and "float" refer to the "integer" and "float" datatypes in ksh93 scripts, not those in the "C" language) ## Part 1.4: Enable built-ins "sync", "mkfifo", "tty" and "logname" by default The 1.4 portion of this project specifies to enable a set of already existing built-ins by default: The "sync" built-in which works exactly like /sbin/sync and is bound to /usr/bin/sync, /usr/sbin/sync and /sbin/sync, a "mkfifo" built-in which is bound to /usr/bin/mkfifo, a "tty" built-in which is bound to /usr/bin/tty and a "logname" built-in which is bound to /usr/bin/logname The invocation behavior is like other built-in commands named in PSARC/2006/550, e.g. the built-in "sync" in ksh93 will only be invoked if called with no pathname prefix, and if a /usr/bin/sync, /usr/sbin/sync or /sbin/sync executable is found first on the user's path and the "mkfifo", "tty" and "logname" built-ins work the same way. ## Part 1.5: Status change of /usr/demo/ksh/ directory Part 1.5 changes the status of the /usr/demo/ksh/ directory to "Not an Interface" (mainly demo code+ksh93 test suite) ## Part 1.6: New messaging catalog files for ksh libraries Part 1.6 adds two new message catalogs: usr/lib/locale/C/LC_MESSAGES/libpp usr/lib/locale/C/LC_MESSAGES/libsum ## Part 1.7: Enable "multiline" input mode by default for interactive shells The 1.7 portion of this project specifies to enable the "multiline" input mode in "/etc/ksh.kshrc" (see PSARC/2006/587 for details about "/etc/ksh.kshrc") to improve end-user usabilty. The "multiline" input mode to edit lines longer than the terminal's width in multiple lines (similar to the behaviour of bash version 3 and other libreadline-based applications (the previous default was to edit longer lines in a single, horizontally scrolling line). The change will only be enabled together with the "gmacs" editor mode (see PSARC/2006/587) for interactive shells which source "/etc/ksh.kshrc" as part of the shell startup and when the terminal is capable of supporting this mode. This setting can always be overridden by per-user settings in ${HOME}/.kshrc ## Part 1.8: Enable default prompt (PS1) for interactive shells The 1.8 portion of this project specifies to define a default prompt (PS1) in "/etc/ksh.kshrc" for interactive ksh93 shell sessions to improve end-user usabilty if the user did not specify a value for PS1 using the environment. The prompt should be set to a value which displays the username, hostname and current working directory (limited to 20 characters, if the CWD is longer than 20 characters the shell will display an ellipsis ("...") for the charcters omitted at the left side) and a "$ "-seperator for normal users and "# " with the login name "root" (this follows the default of SuSE Linux, Ubuntu and aims at improving the usalibity for novice unix users), e.g. setting the value of PS1 will result in the following prompt (for user "gisburn" on machine "jupiterb48" with CWD="/home/gisburn/solaris/"): -- snip -- gisburn at jupiterb48:~/solaris$ -- snip -- Notes: - /etc/ksh.kshrc will only set the prompt value if no value for PS1 exists yet - A user can override the value for PS1 in his/her own ${HOME}/.kshrc file (for interactive shells /etc/ksh.kshrc will be sourced first, followed by ${HOME}/.kshrc (see PSARC/2006/587)) - The change cannot be implemented in ksh93 itself because this would violate the standard. #### Part 2: Enhancement of /usr/bin/printf The 2nd part of this project specifies an enhancement to /usr/bin/printf and based on the AT&T AST "printf" command. The AT&T version of the "printf" utility provides better standards conformance including C99/XPG6-conformance, extensions not present in the current Solaris "printf" and is completely open-source. Notes: - The integer limit for printf has been changed from 32bit to 64bit, e.g. the previous version of /usr/bin/printf would return an error for values larger than INT32_MAX or lower than INT32_MIN, for example $ /usr/bin/printf "%d\n" 2147483648 ; echo "exit code=$?" would result in the following error: -- snip -- printf: 2147483648: Result too large 147483647 exit code=1 -- snip -- The new version now correctly prints: -- snip -- 2147483648 exit code=0 -- snip -- - The manual page now explicitly describes the "printf" behavior for unrecognized format specifiers (following '%') as "undefined". - The manual page now explicitly describes the "printf" behavior for unrecognized escape sequences specifiers (the character following a backslash ('\')) as "undefined". - The manual page now lists sign handling explicitly (e.g. support for negative NaN per IEEE 754&co.) - The manual page originally said: -- snip -- For compatibility with previous versions of SunOS 5.x, the $ format specifier is supported for formats containing only %s specifiers. -- snip -- ... however the matching support for this seems to be broken since several releases, we're therefore dropping this part and fully support "%n$"&co. for all formats for standards conformance. - An addition to the ksh93 test suite will gurantee that /usr/bin/printf will work as defined in this ARC case. #### Part 3: Enhancement of /usr/bin/sleep The 3rd part of this project specifies an enhancement to /usr/bin/sleep and based on the AT&T AST "sleep" command. The AT&T version of the "sleep" utility provides support sub-second timeouts and C99/XPG6-based input values (including special values such as "Inf"/"Infinite"). #### Part 4: The addition of /usr/bin/rev The 4th part of this project specifies a new utility called "/usr/bin/rev" which is used to reverse the characters or lines of one or more files. Like other built-in commands named in PSARC/2006/550, the "rev" built-in in ksh93 will be bound to the /usr/bin/ pathname. The built-in "rev" in ksh93 will only be invoked if called with no pathname prefix, and if a /bin/rev or /usr/bin/rev executable is found first on the user's path. The stability of the "/usr/bin/rev" command and built-in command-line interface and the system variables documented in rev(1) is "Committed". #### Part 5: Enhancement of /usr/bin/sum The 5th part of this project specifies an enhancement to /usr/bin/sum and a new ksh93 built-in with the same name based on the AT&T AST "sum" command. The AT&T version of the "sum" utility provides extensions not present in the current Solaris "sum" utility, which are useful for small applications to generate hash sums (for example using the MD5 hash for MIME "Content-MD5:"-headers). Like other built-in commands named in PSARC/2006/550, the "sum" built-in in ksh93 will be bound to the /usr/bin/ pathname. The built-in "sum" in ksh93 will only be invoked if called with no pathname prefix, and if a /bin/sum or /usr/bin/sum executable is found first on the user's path. The stability of the "/usr/bin/sum" command and built-in command-line interface and the system variables documented in sum(1) is "Committed". An addition to the ksh93 test suite will gurantee compatibilty between previous versions of the /usr/bin/sum utillity and the new version. #### Part 6: Add AT&T "shcomp" (shell script compiler) and "shbinexec" kernel module ## Part 6.1: Addition of AT&T "shcomp" (shell script compiler) The 6.1 part of this project is the addition of AT&T's "shcomp" utility as /usr/bin/shcomp which has multiple goals: 1. serve as basis for a future "ksh88 to ksh93"-migration toolkit 2. act as basis for a future "shell lint" tool to provide a way to test shell scripts like Sun Studio's "lint" 3. extract localiseable strings from shell scripts (using option "-D") 4. compile (ksh93) shell scripts into a compact, portable and platform/ISA/endian-independent binary format which can be read by ksh93 (for example this would allow vendors to ship binary code if they cannot release the code as source or "shrink" shell scripts to the absolute minimum for environments like embedded systems or the Solaris miniroot) The stability of the /usr/bin/shcomp command-line interface and the system variables documented in shcomp(1) is "Committed"; the compiled shell code format is "Committed Private" ("shcomp" being the only generator of the format and /usr/bin/ksh93 the only consumer; both share the same code via libshell) and the output of the "-D" option is "Not an Interface". ## Part 6.2: Addition of kernel module to recognize "shbin" executables Part 6.2 requests the addition of a kernel module to recognize compiled ksh93 shell scripts and execute the ksh93 interpreter if this format is recognized. The conditions to recognize compiled ksh93 shell scripts are: (a) The file must have the "x" (=executable) flag set and (b) The file content must match the signature (starting at byte 0) \013\023\010\000 (which are the ASCII charatcers { 'k', 's', 'h', '\0', ... } masked through a binary AND operation using the value 37 as 2nd operand). Notes: - The format includes a version specifer but the kernel module will leave all version/consistency/etc.-checkin to ksh93 itself - /etc/magic will be updated that /usr/bin/file and /usr/xpg4/bin/file will recognize compiled shell code. 6. Resources and Schedule 6.4. Steering Committee requested information 6.4.1. Consolidation C-team Name: ON 6.5. ARC review type: FastTrack 6.6. ARC Exposure: open