Changes arising from SD/5 for D2R Austin-325 Page 1 of 1 Submitted by Andrew Josey, The Open Group. October 24, 2006 This is document with editors instructions for D2R, based on interpretations and SD5 (ongoing rdvk). This EXCLUDES D1-rdvk which are at http://www.opengroup.org/austin/aardvark/d1r/ Interpretations to be implemented for D2R =========================================== (not including those raised in d1 rdvk) AI-111 AI-112 AI-113 AI-114 AI-115 SD5 Changes for D2R (XSH) ======================== No reference for this change. ----------------------------- The following changes should be made to XSH Section 2.12 2.12 -> Data Types Insert a new header level 3 entitled 2.12 -> 2.12.1 Defined Types with the existing text as is Insert a new header level 3 as follows: 2.12.2 The char type A type char is defined as a single byte, see XBD 3.84 and XBD 3.87 (byte and character definitions) Inset a new header level 3 as follows: 2.12.3 Pointer Types Conforming implementations shall support conversion of pointers of any type to void * and back without loss of information. Note: The ISO C standard does not require this, but it is required for POSIX conformance CROSS VOL CHANGE: We also need to insert equivalent Sections into XRAT B.2.12 Data Types B.2.12.1 Defined Types existing B.2.12 text here B.2.12.2 The char type This standard explicitly requires that a char type is exactly one byte (8-bits). B.2.12.3 Pointer Types This standard explicitly requires implementations can convert pointers to void * and back with no loss of information. This is an extension over the ISO C Standard. -------- SD5-XSH-ERN-68 In the fstatvfs() man page, in the EXAMPLE there are two occurrences of #include that should be #include Add to CH, SD5-XSH-ERN-68 is applied correcting the EXAMPLE. ---------------- SD5-XSH-ERN-135 pthread_mutexattr_getprotocol DESCRIPTION (After the following text from D1R XSH page 1122) 35736 PTHREAD_PRIO_NONE 35737 TPI PTHREAD_PRIO_INHERIT 35738 TPP PTHREAD_PRIO_PROTECT 35739 35740 which are defined in the header. Append to line 35470 (d1r) "The default value of the attribute shall be PTHREAD_PRIO_NONE." Add to CH SD5-XSH-ERN-135 is applied. The DESCRIPTION section is updated defining a default value for the protocol attribute. ------------------- SD5-XSH-ERN-154 posix_trace_create DESCRIPTION Remove posix_trace_trygetnext_event( ) from the list of functions: (the text is below for reference) The posix_trace_create_withlog( ) function shall return in the parameter pointed to by trid the trace stream identifier, which uniquely identifies the newly created trace stream, and shall be used in subsequent calls to control tracing. The trid argument may only be used by the following functions: posix_trace_clear( ) posix_trace_getnext_event( ) posix_trace_eventid_equal( ) posix_trace_shutdown( ) posix_trace_eventid_get_name( ) posix_trace_start( ) posix_trace_eventtypelist_getnext_id( ) posix_trace_stop( ) posix_trace_eventtypelist_rewind( ) posix_trace_timedgetnext_event( ) posix_trace_flush( ) posix_trace_trid_eventid_open( ) posix_trace_get_attr( ) posix_trace_trygetnext_event( ) Add to CH SD5-XSH-ERN-154 is applied. The DESCRIPTION section is updated removing the posix_trace_trygetnext_event( ) function from the list of functions that use the trid argument. --------------- SD5-XSH-ERN-156 pipe Insert "The pipe's user ID shall be set to the effective user id of the calling process." "The pipe's group ID shall be set to the effective group id of the calling process." before the last para of DESCRIPTION which currently states : "Upon successful completion, pipe( ) shall mark for update the st_atime, st_ctime, and st_mtime fields of the pipe." Add to CH SD5-XSH-ERN-156 is applied. The DESCRIPTION is updated to state the setting of the pipe's user ID and group ID. ------------------ SD5-XSH-ERN-157 pthread_attr_getstack Add the following to the end of APP USAGE The specification of the stackaddr attribute presents several ambiguities that make portable use of these interfaces impossible. Add to CH SD5-XSH-ERN-157 is applied updating the APPLICATION USAGE section. --------------------- SD5-XSH-ERN-158 pthread_mutex_getprioceiling: Insert a new shall fail error: These functions shall fail if: [EINVAL] The protocol attribute of /mutex/ is PTHREAD_PRIO_NONE. Add to CH SD5-XSH-ERN-158 is applied. The ERRORS section is updated to include a shall fail error case for when the protocol attribute of mutex is PTHREAD_PRIO_NONE. ------------- SD5-XSH-ERN-159 pthread_mutex_getprioceiling: in CHANGE HISTORY: Change from : The [ENOSYS] error condition has been removed as stubs need not be provided if an implementation does not support the Thread Priority Protection option. The [ENOSYS] error denoting non-support of the priority ceiling protocol for mutexes has been removed. This is because if the implementation provides the functions (regardless of whether _POSIX_PTHREAD_PRIO_PROTECT is defined), they must function as in the DESCRIPTION and therefore the priority ceiling protocol for mutexes is supported. to: The [ENOSYS] error conditions have been removed. (note, that no CH is required for this change!) --------------- SD5-XSH-ERN-160 At line 52035 (2004 ed) (half way thru third para in DESCRIPTION) change: "On a regular file, if this incremented file offset is greater than the length of the file, the length of the file shall be set to this file offset. to: "On a regular file, if the position of the last byte written is is greater than or equal to the length of the file, the length of the file shall be set to this position plus one." Change the paragraph at lines 52126-52128 (2004 ed) (last para of DESCRIPTION)from: "The pwrite() function shall be equivalent to write(), except that it writes into a given position without changing the file pointer. The first three arguments to pwrite() are the same as write() with the addition of a fourth argument offset for the desired position inside the file." to: "The pwrite() function shall be equivalent to write(), except that it writes into a given position and does not change the file offset (regardless of whether O_APPEND is set). The first three arguments to pwrite() are the same as write() with the addition of a fourth argument offset for the desired position inside the file." Add to CH SD5-XSH-ERN-160 is applied. The DESCRIPTION section is updated to clarify the requirements for the pwrite() function, and to change the use of the phrase "file pointer" to "file offset". -------- SD5-XSH-ERN-161 fstat In the 2nd and 3rd paragraphs of DESCRIPTION (2004 ed 15046 and 15050) change "only the st_uid" to "the st_uid". Change the 5th paragraph of the DESCRIPTION (2004 ed line 15055) "The structure members st_mode, st_ino, st_dev, st_uid, st_gid, st_atime, st_ctime, and st_mtime shall have meaningful values for all other file types defined in this volume of IEEE Std 1003.1-2001. The value of the member st_nlink shall be set to the number of links to the file." to: "For all other file types defined in this volume of IEEE Std 1003.1-2001, the structure members st_mode, st_ino, st_dev, st_uid, st_gid, st_atime, st_ctime, and st_mtime shall have meaningful values and the value of the member st_nlink shall be set to the number of links to the file." stat Change the last paragraph of the DESCRIPTION from: "Unless otherwise specified, the structure members st_mode, st_ino, st_dev, st_uid, st_gid, st_atime, st_ctime, and st_mtime shall have meaningful values for all file types defined in this volume of IEEE Std 1003.1-2001. The value of the member st_nlink shall be set to the number of links to the file." to: "[SHM] If the named file is a shared memory object, the implementation shall update in the stat structure pointed to by the buf argument the st_uid, st_gid, st_size, and st_mode fields, and only the S_IRUSR, S_IWUSR, S_IRGRP, S_IWGRP, S_IROTH, and S_IWOTH file permission bits need be valid. The implementation may update other fields and flags. [/SHM] [TYM] If the named file is a typed memory object, the implementation shall update in the stat structure pointed to by the buf argument the st_uid, st_gid, st_size, and st_mode fields, and only the S_IRUSR, S_IWUSR, S_IRGRP, S_IWGRP, S_IROTH, and S_IWOTH file permission bits need be valid. The implementation may update other fields and flags. [/TYM] For all other file types defined in this volume of IEEE Std 1003.1-2001, the structure members st_mode, st_ino, st_dev, st_uid, st_gid, st_atime, st_ctime, and st_mtime shall have meaningful values and the value of the member st_nlink shall be set to the number of links to the file." Add to the CH for both stat and fstat pages XSH-SD5-ERN-161 is applied. The DESCRIPTION is updated to clarify which file types st_nlink applies to. *CROSS VOL CHANGE* In XBD sys/stat.h IN the DESCRIPTION Cross-volume change to XBD: At 2004 ed page 360 line 12725 section sys/stat.h change: "Unless otherwise specified, the structure members st_mode, st_ino, st_dev, st_uid, st_gid, st_atime, st_ctime, and st_mtime shall have meaningful values for all file types defined in IEEE Std 1003.1-2001. For symbolic links, the st_mode member shall contain meaningful information, which can be used with the file type macros described below, that take a mode argument. The st_size member shall contain the length, in bytes, of the pathname contained in the symbolic link. File mode bits and the contents of the remaining members of the stat structure are unspecified. The value returned in the st_size field shall be the length of the contents of the symbolic link, and shall not count a trailing null if one is present." to: "Which structure members have meaningful values depends on the type of file. For further information, see the descriptions of fstat(), lstat() and stat() in the System Interfaces volume of IEEE Std 1003.1-200x." Add to CH SD5-XSH-ERN-161 is applied. The DESCRIPTION section is updated to clarify that the descriptions of the interfaces should be consulted in order to determine which structure members have meaningful values. -------- SD5-XSH-ERN-168 mkstemp Add between 1st and 2nd sentence in the DESCRIPTION The mkstemp() function shall create the file, and obtain a file descriptor for it, as if by a call to open(filename, O_RDWR|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR). Replace the exusting ERRORS section with: refer to open(). Add to CH, SD5-XSH-ERN-168 is applied clarifying file permissions upon creation. SD5-XSH-ERN-169 is applied updating the ERRORS section. ----- XSH-SD5-ERN-164 list of atomic functions in XSH 2.9.7 Change from: All of the functions chmod( ), close( ), fchmod( ), fcntl( ), fstat( ), ftruncate( ), lseek( ), open( ), read( ), readlink( ), stat( ), symlink( ), and write( ) shall be atomic with respect to each other in the effects specified in IEEE Std 1003.1-2001 when they operate on regular files. If two threads each call one of these functions, each call shall either see all of the specified effects of the other call, or none of them. To All of the following functins shall be atomic with respect to each other in the effects specified in IEEE Std 1003.1-2001 when they operate on regular files or symbolic links: Then list the functions in a table, and add chown, creat, dup2, fchown, lchown, link, lstat, pread, pwrite, readv, rename, truncate, unlink, utime, utimes writev fchmodat, fchownat, fstatat, futimesat, linkat, openat, renameat unlinkat If two threads each call one of these functions, each call shall either see all of the specified effects of the other call, or none of them. (no place for CH here) --- SD5-XSH-ERN-165 In 2.10.16 Use of Options delete two occurrences of At lines 2710 and 2734 delete: "The maximum value for the option for a socket may be obtained by the use of the fpathconf() function, using the value _PC_SOCK_MAXBUF." (no place for CH here) ---- SD5 Changes for D2R (XCU) ======================== SD5-XCU-ERN-84 XCU 2.6.3 Command Subsitution Change in the 3rd main para from: "The search for the matching backquote shall be satisfied by the first backquote found without a preceding backslash". To: "The search for the matching backquote shall be satisfied by the first unquoted non-escaped backquote". Add at the end of XRAT C.2.6.3 SD5-XCU-ERN-84 is applied clarifying how the search for the matching backquote is satisfied. --- SD5-XCU-ERN-87 awk Insert this text before (2004 ed)XCU page 176 line 6881: (insert before para starting "One convention that might not be obvious..") Each expression in an 'awk' program shall conform to the precedence and associativity rules, even when this is not needed to resolve an ambiguity. For example, because '$' has higher precedence than '++', the string '$x++--' is not a valid 'awk' expression even though it is unambiguously parsed by the grammar as '$(x++)--'. Add to CH SD5-XCU-ERN-87 is applied updating the descriptive text of the Grammar. --- SD5-XCU-ERN-89 find In OPERANDS change the 3 para from "The first argument that starts with a '-',..." to "The first operand that starts with a '-',..." Add to CH SD5-XCU-ERN-89 is applied updating the OPERANDS section. --- SD5-XCU-ERN-90 fuser Add to the end of the EXAMPLES section: fuser -c writes to standard output the process IDs of processes that are using any file in the filesystem which is mounted on and writes to standard error an indication of how those processes are using the files. fuser writes to standard output the process IDs of processes that are using the file which is named by and writes to standard error an indication of how those processes are using the file. fuser writes to standard output the process IDs of processes that are using any file which is on the device named by and writes to standard error an indication of how those processes are using the file. fuser -f writes to standard output the process IDs of processes that are using the file itself and writes to standard error an indication of how those processes are using the file. Add to CH SD5-XCU-ERN-90 is applied updating the EXAMPLES section. ---- SD5-XCU-ERN-93 XCU 2.11 Signals and Error Handling Replace the first paragraph of section 2.11 with the following: "When a command is in an asynchronous list, it shall inherit from the shell a signal action of ignored (SIG_IGN) for the SIGQUIT and SIGINT signals and may inherit a signal mask in which SIGQUIT and SIGINT are blocked. Otherwise, the signal actions and signal mask inherited by the command shall be the same as those inherited by the shell from its parent unless a signal action is modified by the trap special built-in." add to the end of XRAT C.2.11 SD5-XCU-ERN-93 is applied updating the first paragraph of 2.11. ----- SD5-XCU-ERN-94 ed 2004 edition references Replace the text on XCU page 340, lines 13108-13114 with the following: " If accompanied by a SIGHUP signal, the ed utility shall operate as described in the ASYNCHRONOUS EVENTS section for a SIGHUP signal. If not accompanied by a SIGHUP signal, the ed utility shall act as if an end-of-file had been detected on standard input." Change the text on XCU page 337 line 12986 to read: "shall exit without writing the file to the currently remembered pathname and without returning to command mode." Add to ed SEE ALSO, (see XBD 11.1.11 Modem Disconnect and 11.1.10 Closing a Device Terminal) and a cross reference on Page 340 where terminal disconnect is mentioned. Add to CH SD5-XCU-ERN-94 is applied updating text in EXTENDED DESCRIPTION where a terminal disconnect is detected (in Commands in Ed). --- SD5-XCU-ERN-95 at 2004 edition references Change in the XSI shaded text in DESCRIPTION (at utility page 144 line 5501) (batch utility page 190 line 7433) "the file /usr/lib/cron/at.allow" to "the file at.allow which is located in an implementation-defined directory". Change in the XSI shaded text in DESCRIPTION (crontab utility page 275 line 10741) "the file /usr/lib/cron/cron.allow" to "the file cron.allow which is located in an implementation-defined directory". Change (at utility page 144 line 5502) (batch utility page 190 line 7433) "the file /usr/lib/cron/at.deny shall be checked" to "the file at.deny, which is located in an implementation-defined directory, shall be checked" Change ( crontab utility page 275 line 10742) "the file /usr/lib/cron/cron.deny shall be checked" to "the file cron.deny, which is located in an implementation-defined directory, shall be checked" In INPUT FILES (at utility page 144 line 5697) (batch utility page 190 line 7446) Change "The text files /usr/lib/cron/at.allow and /usr/lib/cron/at.deny shall" to "The text files at.allow and at.deny, which are located in an implementation-defined directory, shall..." In INPUT FILES (crontab utility page 276, line 10787) Change "The text files /usr/lib/cron/cron.allow and /usr/lib/cron/cron.deny shall" to "The text files cron.allow and cron.deny, which are located in an implementation-defined directory, shall..." Add to CH for at SD5-XCU-ERN-95 is applied removing the references to fixed locations for the files referenced by the at utility Add to CH for batch SD5-XCU-ERN-95 is applied removing the references to fixed locations for the files referenced by the batch utility Add to CH for crontab SD5-XCU-ERN-95 is applied removing the references to fixed locations for the files referenced by the crontab utility ---- SD5-XCU-ERN-96 cmp STDERR section In (2004 ed) XCU page 254, change lines 9919-9920 from: If file1 and file2 are identical for the entire length of the shorter file, in the POSIX locale the following diagnostic message shall be written, unless the -s option is specified: to: If the -l option is used and file1 and file2 differ in length, or if the -s option is not used and file1 and file2 are identical for the entire length of the shorter file, in the POSIX locale the following diagnostic message shall be written: Add to CH SD5-XCU-ERN-96 is applied updating the STDERR section. --- SD5-XCU-ERN-97 This is a global change to the XCU Utilities SYNOPSES Rules: 1.Mutually exclusive options should have no space before or after pipe symbol. stty [ -a| -g] -> stty [-a|-g] 2. For bracketed groups of options, the bracketed groups should be separated by a space It also applies to operand(s) as in cat [-u][file ...] -> cat [-u] [file...] and after a mandatory option id -g[-n] [user] -> id -g [-n] [user] Within the brackets there should be no spaces [ -v specification ] -> [-v specification] [ -cfu ] -> [-cfu] In general apart from the pr utility ][ -> ] [ 3.Where a required option can be followed by additional instances of it the option is repeated in []'s -f pattern_file... -> -f pattern_file [-f pattern_file]... The ellipsis should be outside the brackets for options, inside for operands. (It is right for awk in rule 4, and for grep below.) 4. An operand followed by ellipses has no space between it and the ellipses cksum [file ...] -> cksum [file...] unset [-fv] name ... -> unset [-fv] name... admin -h file... awk [-F ERE] [-v assignment]... program [argument...] +++++++ colon rule 4 eval rule 4 exec rule 4 set (special builtins) rule 2 (not ellipses on second synopses appear in bold?) trap rule 4 unset rule 4 unset [-fv] name ... -> unset [-fv] name... admin rule 2, rule 4 Note that -i[name] is not one of the cases that rule 2 adds a space to. (Likewise -t[name] and -y[comment].) This also applies to some other SCCS commands (delta, prs) alias rule 4 ar rule 2 , rule 4 asa [ file ... ] -> asa [file...] (no spaces) rule 4 at rule 2 , rule 4 awk rule 2, rule 4 Also rule 3 for -f progfile bc rule 4 bg rule 4 c99 rule 2, rule 4 cal [[month] year ] -> cal [[month] year] (no space after year) cat rule 2, rule 4 cd rule 1 cflow rule 2, rule 4 chgrp rule 1, rule 4 chmod rule 4 chown rule 1, rule 4 cksum rule 4 cmp rule 1 command rule 1, rule 4 compress rule 2, rule 4 cp rule 1, rule 2, rule 4 crontab rule 1 csplit rule 2 (should it be arg1 ...argn or arg1...argn ?) Go with the special case: arg1 ... argn ties in with file in OPERANDS ctags rule 2, rule 4 cut rule 2, rule 4 cxref rule 2 rule 3, rule 4 cxref [-cs] [-o file] [-w num] [-D name[=def]]... [-I dir]... [-U name]... file... dd rule 4 delta rule 2, rule 4 df rule 1, rule 2 diff rule 1, rule 2 du rule 1, rule 2, rule 4 echo rule 4 ed rule 2 env rule 2 ex rule 1, rule 2, rule 4 expand rule 2, rule 4 fc rule 2 file rule 2, rule 4 find rule 1, rule 4 fold rule 2 fort77 rule 2 fuser rule 2, rule 4 -> fuser [-cfu] file... get rule 2 getconf rule 2 grep rule 1, rule2, rule3 grep should be: 19118 grep [-E|-F] [-c|-l|-q] [-insvx] -e pattern_list [-e pattern_list]... 19119 [-f pattern_file]... [file...] 19120 grep [-E|-F] [-c|-l|-q] [-insvx] [-e pattern_list]... 19121 -f pattern_file [-f pattern_file]... [file...] 19122 grep [-E|-F] [-c|-l|-q] [-insvx] pattern_list [file...] head rule 2 iconv rule 4 id rule 2 ipcrm rule 1, rule 4 ipcs rule 1, rule 2 jobs rule 1, rule 2 join rule 1, rule 2 kill rule 4 lex rule 1, rule 2, rule 4 ln rule 4 locale rule 1 localedef rule 2 logger rule 4 lp rule 2 ls rule 1, rule 2 m4 rule 2 mailx rule 2 make rule 1, rule 2 mkdir rule 2 more rule 2, rule 4 newgrp rule 2 nl rule 2 nm rule 1, rule 2 od rule 2 paste rule 2 patch rule 1, rule 2 pax rule 1, rule 2 pr rule 2 apart from appearances of "gap" as in pr -e[char][gap] x3 printf rule 2 prs rule 1, rule 2 ps rule 2 pwd rule 1 qalter rule 2, rule 4 qdel rule 4 qhold rule 4 qmove rule 4 qmsg rule 2 rule 4 qrerun rule 4 qrls rule 4 qselect rule 2 qsig rule 4 qstat rule 4 qsub rule 2 renice rule 1 rule 4 sccs rule 2 sed rule 2 (although there is an aardvark out on sed synopsis, so we could leave) sh rule 2 plus as follows sh page 861 (d1) line 33327 Change from: sh [-abCefhimnuvx][-o option][+abCefhimnuvx][+o option] [command_file [argument...]] sh -c[-abCefhimnuvx][-o option][+abCefhimnuvx][+o option]command_string [command_name [argument...]] sh -s[-abCefhimnuvx][-o option][+abCefhimnuvx][+o option][argument] to: sh [-abCefhimnuvx] [-o option]... [+abCefhimnuvx] [+o option]... [command_file [argument...]] sh -c [-abCefhimnuvx] [-o option]... [+abCefhimnuvx] [+o option]... command_string [command_name [argument...]] sh -s [-abCefhimnuvx] [-o option]... [+abCefhimnuvx] [+o option]... [argument...] sort rule 2 split rule 2 strings rule 2 stty rule 1 tabs rule 1 , rule 2 tail rule 1, rule 2 tee rule 2 touch rule 1, rule 2 tr rule 1, rule 2 ulimit rule 2 umask rule 2 uncompress rule 2 unexpand rule 1, rule 2 unget rule 2 uniq rule 2 uucp rule 2 uudecode rule 2 uuencode rule 2 uustat rule 1, rule 2 val rule 2 vi rule 2, rule 4 wc rule 2 who rule 2 xargs rule 2 yacc rule 2 For all effected utilities add to CH SD5-XCU-ERN-97 is applied updating the SYNOPSIS. CROSS VOL CHANGE XBD Chapter 12 Page 201 section 12.1 Change from: 9. Ellipses ("...") are used to denote that one or more occurrences of an option or operand are allowed. When an option or an operand followed by ellipses is enclosed in brackets, zero or more options or operands can be specified. The forms: utility_name -f option_argument...[operand...] utility_name [-g option_argument]...[operand...] indicate that multiple occurrences of the option and its option-argument preceding the ellipses are valid, with semantics as indicated in the OPTIONS section of the utility. (See also Guideline 11 in Section 12.2.) In the first example, each option-argument requires a preceding -f and at least one -f option_argument must be given. To: 9. Ellipses ("...") are used to denote that one or more occurrences of an operand are allowed. When an option or an operand followed by ellipses is enclosed in brackets, zero or more options or operands can be specified. The form: utility_name [-g option_argument]... [operand...] indicate that multiple occurrences of the option and its option-argument preceding the ellipses are valid, with semantics as indicated in the OPTIONS section of the utility. (See also Guideline 11 in Section 12.2.) The form: utility_name -f option_argument [-f option_argument]... [operand...] indicates that the -f option is required to appear at least once and may appear multiple times. Note that there is an exception in pr -e[char][gap] x3 ==== SD5-XCU-ERN-98 ls -l STDOUT (first para) in XCU (2004 ed) page 497, change line 19218 from: If the -l option is in effect, and the -q option is not, the following shall be written for each file to: If the -l option is in effect, the following shall be written for each file Add to CH SD5-XCU-ERN-98 is applied updating the STDOUT section. ---- SD5-XCU-ERN-99/100 m4 EXTENDED DESCRIPTION (divert macro) (2004 ed page 580 line 22420) Add to the Extended Description at line 22420 (after sentence ending "... current left and right quoting strings.": "The string "${" produces unspecified behavior." (2004 ed , page 581, line 22462) Change the text at line 22462 from: Output diverted to a stream other than 0 to 9 shall be discarded. to the following: Output diverted to a stream with a negative number shall be discarded. Behavior is implementation-defined if a stream number larger than 9 is specified. Add to end of 'define' macro on page 581 22455 It is unspecified whether the 'define' macro deletes all prior definitions of the macro named by its first argument or preserves all but the current definition of the macro. page 583, line 22538 (syscmd macro) Add to existing text for the syscmd macro after the 2nd sentence "The defining text shall be the string result of that command.": -> "The string result shall not be rescanned for macros while setting the defining text." page 583 line 22551 (translit macro) Add a sentence to the paragraph at line 22551: The behavior is unspecified if the character '-' appears within the second or third argument anywhere besides the first or last character. page 583, line 22557 (undivert macro) Change the text at line 22557 from: It shall be an error to specify an argument containing any non-numeric characters. to: The behavior is unspecified if an argument contains any non-numeric characters. Add a new paragraph to the end of Application Usage When a macro has been multiply defined via the pushdef macro, it is unspecified whether the define macro will alter only the most recent definition (as though by popdef and pushdef), or replace the entire stack of definitions with a single definition (as though by undefine and pushdef). An application desiring particular behavior for the define macro in this case can redefine it accordingly. Insert into RATIONALE section: "Historic System V based behavior treated "${" in a macro definition as two literal characters. However, this sequence is left unspecified so that implementations may offer extensions such as ${11} meaning the eleventh positional parameter. Macros can still be defined with appropriate uses of nested quoting to result in a literal ${ in the output after rescanning removes the nested quotes. Historic System V based behavior treated "-" as a literal, GNU behavior treats it as a range. This revision of the standard allows either behavior" Add to CH SD5-XCU-ERN-99 is applied clarifying the definition of the divert macro in the EXTENDED DESCRIPTION section. SD5-XCU-ERN-100 is applied clarifying the definition of the syscmd macro in the EXTENDED DESCRIPTION section. SD5-XCU-ERN-101 is applied clarifying the definition of the undivert macro in the EXTENDED DESCRIPTION section. SD5-XCU-ERN-111 is applied to the EXTENDED DESCRIPTION section. This clarifies that the string "${" produces unspecified behavior. SD5-XCU-ERN-118 is applied clarifying the definition of the define macro in the EXTENDED DESCRIPTION section. SD5-XCU-ERN-118 is applied clarifying the definition of the translit macro in the EXTENDED DESCRIPTION section. --- SD5-XCU-ERN-102 cp -i (OPTIONS section) 2004 ed Page: 269 Line: 10526 Section: cp -i (OPTIONS) change from "Write a prompt to standard error before copying to any existing destination file" to: "Write a prompt to standard error before copying to any existing non-directory destination file" Add to CH SD5-XCU-ERN-102 is applied clarifying the -i option within the OPTIONS section. --- SD5-XCU-ERN-103/120 2004 edition Page: 319 Line: 12296 Section: diff (add -u format) (Note: in the text of the following action, the ASCII character "^" denotes a Greek Delta character, which POSIX uses in formats to denote an unpaddable space.) Change XCU page 319 line 12296 (SYNOPSIS) from: diff [-c | -e | -f | -C n] [-br] file1 file2 to: diff [-c|-e|-f|-u|-C n|-U n] [-br] file1 file2 Change lines 12309-12311 from: -c Produce output in a form that provides three lines of context. -C n Produce output in a form that provides n lines of context (where n shall be interpreted as a positive decimal integer). to: -c Produce output in a form that provides three lines of copied context. -C n Produce output in a form that provides n lines of copied context (where n shall be interpreted as a positive decimal integer). After line 12317 add: -u Produce output in a form that provides three lines of unified context. -U n Produce output in a form that provides n lines of unified context (where n shall be interpreted as a nonnegative decimal integer). Change lines 12352-12353 from: TZ Determine the time zone used for calculating file timestamps written with the -C and -c options. to: TZ Determine the time zone used for calculating file timestamps written with a context format. Change page 321 line 12386 from: The default (without -e, -f, -c, or -C options) to: The default (without -e, -f, -c, -C, -u, or -U options) After page 323 line 12463 add: Diff -u or -U Output Format The -u or -U option behaves like the -c or -C option, except that the context lines are not repeated; instead, the context, deleted and added lines are shown together, interleaved. The exact format follows. The name and last modification time of each file shall be output in the following format: "---^%s\t%s%s^%s\n", file1, , , "+++^%s\t%s%s^%s\n", file2, , , Each field shall be the pathname of the corresponding file being compared, or the single character "-" if standard input is being compared. However, if the pathname contains a tab or a newline, or if it does not consist entirely of characters taken from the portable character set, the behavior is implementation-defined. Each field shall be equivalent to the output from the following command: date '+%Y-%m-%d^%H:%M:%S' without the trailing , executed at the time of last modification of the corresponding file (or the current time, if the file is standard input). Each field shall be either empty, or a decimal point followed by at least one decimal digit, indicating the fractional-seconds part (if any) of the file time stamp. The number of fractional digits shall be at least the number needed to represent the file's timestamp without loss of information. Each field shall be of the form 'shhmm', where 'shh' is a signed two-digit decimal number in the range -24 through +25, and 'mm' is an unsigned two-digit decimal number in the range 00 through 59. It represents the time zone of the timestamp as the number of hours (hh) and minutes (mm) east (+) or west (-) of UTC for the timestamp. If the hours and minutes are both zero, the sign shall be '+'. However, if the time zone is not an integral number of minutes away from UTC, the field is implementation-defined. Then, the following output formats shall be applied for every set of changes. First the range of lines in each file shall be written in the following format: "@@^-%s^+%s^@@", , Each field shall be of the form: "%1d", if the range contains exactly one line, and: "%1d,%1d", , otherwise. If a range is empty, its beginning line number shall be the number of the line just before the range, or 0 if the empty range starts the file. Next, the affected lines along with lines of context shall be written. Each nonempty unaffected line shall be written in the following format: "^%s", where the contents of the unaffected line shall be taken from file1. It is implementation-defined whether an empty unaffected line is written as an empty line or a line containing a single space character This line also represents the same line of file2, even though file2's line may contain different contents due to the -b option. Deleted lines shall be written as: "-%s", Added lines shall be written as: "+%s", The order of lines written shall be the same as that of the corresponding file. A deleted line shall never be written immediately after an added line. If -U n is specified, the output shall contain no more than n consecutive unaffected lines; and if the output contains an affected line and this line is adjacent to up to n consecutive unaffected lines in the corresponding file, the output shall contain these unaffected lines. -u shall act like -U 3. Change page 324 line 13519 from: difference listings using the context format. to: difference listings using a context format. After line 12531, add: The -u and -U options of GNU diff have been included. Their output format, designed by Wayne Davison, takes up less space than -c and -C format, and in many cases is easier to read. The format's timestamps do not vary by locale, so LC_TIME does not affect it. The format's line numbers are rendered with the %1d format, not %d, because the file format notation rules would allow extra blanks to appear around the numbers. In page 690 line 26714 (patch SYNOPSIS), change: [-c | -e | -n] to: [-c | -e | -n | -u] In line 26718-26719 change: The patch utility shall read a source (patch) file containing any of the three forms of difference (diff) listings produced by the diff utility (normal, context, or in the style of ed) to the following (note that this uses "four", and not "the four"; this corrects an editorial error in the original): The patch utility shall read a source (patch) file containing any of four forms of difference (diff) listings produced by the diff utility (normal, copied context, unified context, or in the style of ed) In line 26721-26722, change: unless overruled by a -c, -e, or -n option. to: unless overruled by a -c, -e, -n, or -u option. In line 26736 (-c option), change "context" to "copied context". After page 691 line 26782, add: -u Interpret the patch file as a unified context difference (the output of the utility _diff_ when the -u or -U options are specified). In page 692 line 26828, change "diff -c" to "the -c, -C, -u, or -U options of the _diff_ utility". In line 26834 change "context" to "common context". After line 26838 insert the following text: If the type of difference is unified context, the _patch_ utility shall recognize the following expressions: --- filename timestamp The patches arose from 'filename'. +++ filename timestamp The patches should be applied to 'filename'. On page 693 line 26845 change: "***" to: "***" (if copied context) or "---" (if unified context) On line 26849 change: "---" to: "---" (if copied context) or "+++" (if unified context) One line 26862-26863 change: If the -c, -e, or -n option is present, the patch utility shall interpret information within each hunk as a context difference, an ed difference, or a normal difference, respectively. to: If the -c, -e, -n, or -u option is present, the patch utility shall interpret information within each hunk as a copied context difference, an ed difference, a normal difference, or a unified context difference, respectively. On page 693 line 26874-26875 change: The rejected hunk shall be written in context-difference format regardless of the format of the patch file. to: A rejected hunk that is a copied context difference, an ed difference, or a normal difference, shall be written in copied-context-difference format regardless of the format of the patch file. It is implementation-defined whether a rejected hunk that is a unified context difference is written in copied-context-difference format or in unified-context-difference format. After page 695 line 26947 add: The -u option of GNU patch has been added, along with support for unified context formats. Add to CH SD5-XCU-ERN-103 and SD5-XCU-ERN-120 are applied adding the -u option. ---- SD5-XCU-ERN-110 touch (OPTIONS section) (2004 ed) in XCU page 921 lines 35696-35698, change: If the resulting time value precedes the Epoch, 'touch' shall exit immediately with an error status. to: If the resulting time precedes the Epoch, the behavior is implementation-defined. If the time is out of range for the file's timestamp, 'touch' shall exit immediately with an error status. Add to CH SD5-XCU-ERN-110 is applied updating the OPTIONS section. --- SD5-XCU-ERN-114 (2004 ed) Page: 898 Line: 34861 Section: tail On line 34861 change: (OPTIONS -f) "If no file operand is specified and standard input is a pipe" to: "If no file operand is specified and standard input is a pipe or FIFO" On page 900 line 34947 change: (RATIONALE) "... if standard input is a FIFO or a FIFO is named, the -f option shall not be ignored." to: "... if a FIFO is named, the -f option shall not be ignored. Earlier versions of the standard did not state any requirement for the case where no file operand is specified and standard input is a FIFO. The standard has been updated to reflect current practice which is to treat this case the same as a pipe on standard input. Add to CH SD5-XCU-ERN-114 is applied updating the OPTIONS section (-f option). ---- SD5-XCU-ERN-115 time DESCRIPTION page 916 (2004 ed) Change the example on line 35526 from { time a } | b | c to { time a; } | b | c Add to CH SD5-XCU-ERN-115 is applied updating the example in the DESCRIPTION section. ---- SD5-XCU-ERN-117 find OPERANDS section Change XCU page 453 lines 17567-17573 from: -perm [-]onum If the hyphen is omitted, the primary shall evaluate as true when the file permission bits exactly match the value of the octal number onum and only the bits corresponding to the octal mask 07777 shall be compared. (See the description of the octal mode in chmod.) Otherwise, if onum is prefixed by a hyphen, the primary shall evaluate as true if at least all of the bits specified in onum that are also set in the octal mask 07777 are set. to: -perm [-]onum If the hyphen is omitted, the primary shall evaluate as true when the file mode bits exactly match the value of the octal number onum (see the description of the octal mode in chmod). Otherwise, if onum is prefixed by a hyphen, the primary shall evaluate as true if at least all of the bits specified in onum are set. In both cases, the behavior is unspecified when onum exceeds 07777. Add to CH SD5-XCU-ERN-117 is applied to the OPERANDS section clarifying the "-perm" OPERAND. --- SD5-XCU-ERN-121 pathchk EXAMPLES 2004 ed Page: 697 Line: 27045 Section: pathchk Change pax -f archive | sed -e '/ == .*/s///' | xargs pathchk to # This example assumes that no pathnames in the archive # contain newline characters. pax -f archive | sed -e 's/[^[:alnum:]]/\\&/g' | xargs pathchk -- Add to CH SD5-XCU-ERN-121 is applied updating the EXAMPLES section. --------------------- SD5-XCU-ERN-112 m4 (changequote) Replace this sentence at line 22446: With a single argument, that argument shall become the begin-quote string and the shall become the end-quote string. with this sentence: The behavior is unspecified if there is a single argument or either argument is null. and Change line 22448 With two arguments, the first argument shall become To With two non-null arguments, the first argument shall become Add to CH, SD5-XCU-ERN-112 is applied updating the changequote macro ----- SD5-XCU-ERN-122 find EXAMPLES Add a new example 8. The following command: find . ! -name . -prune -name '*.old' -exec \ sh -c 'mv "$@" ../old/' sh {} + performs the same task as: mv ./*.old ./.*.old ../old/ while avoiding an "Argument list too long" error if there are a large number of files ending with ".old" (and avoiding "No such file or directory" errors if no files match ./*.old or ./.*.old). The alternative: find . ! -name . -prune -name '*.old' -exec mv {} ../old/ \; is less efficient if there are many files to move because it executes one mv command per file. Add to CH, SD5-XCU-ERN-122 is applied adding a new EXAMPLE. ----- SD5-XCU-ERN-123 sed synopsis Replace the sed synopsis with: sed [-n] script [file...] sed -e script [-e script]... [-f script_file]... [-n] [file...] sed [-e script]... -f script_file [-f script_file]... [-n] [file...] Add to CH, SD5-XCU-ERN-122 is applied updating the SYNOPIS. ----- SD5-XCU-ERN-124 cksum RATIONALE Delete this sentence: "Octets are used instead of bytes because bytes can differ in size between systems." (no CH needed) ----- SD5-XCU-ERN-126 read In DESCRIPTION Change first bullet from "The shell reads and input line ending with a backslash, ...." to "The shell reads an input line ending with backslash ,...". In ENVIRONMENT VARIABLES PS2 change "line ending with a backslash is read" to "line ending with backslash is read" On line 31776, 5th para in DESCRIPTION change "The line shall be split into fields as in the shell" to "The terminating (if any) shall be removed from the input and the results shall be split into fields as in the shell for the results of parameter expansion" Delete the second paragraph of APPLICATION USAGE (lines 31840-31841). (The results are undefined if an end-of-file is detected...) Append to the end of the RATIONALE (after line 31859): "Although the standard input is required to be a text file, and therefore will always end with a (unless it is an empty file), the processing of continuation lines when the -r option is not used can result in the input not ending with a . This occurs if the last line of the input file ends with backslash . It is for this reason that "if any" is used in "The terminating (if any) shall be removed from the input" in the description. It is not a relaxation of the requirement for standard input to be a text file." Add to CH SD5-XCU-ERN-126 is applied clarifying that input lines end with a . --- XCU-SD5-ERN-128 xargs In the 2nd bullet in DESCRIPTION At line 40771 change "The logical end-of-file string (see the -E eofstr option) is found on standard input" to "An argument consisting of just the logical end-of-file string (see the -E eofstr option) is found on standard input" Then append to the same bullet Append the following to line 40773 "All arguments up to but not including the argument consisting of just the logical end-of-file string shall be used as arguments in constructed command lines." Add to CH SD5-XCU-ERN-128 is applied clarifying the DESCRIPTION of the logical end-of-file string. === ============================ SD5-XRAT-ERN-2 A.12.2 Utility Syntax Guidelines Insert the following before XRAT page 75 line 3057 (after para starting "Guideline 8...."): Unless explicitly stated otherwise in the utility description guideline 9 requires applications to put options before operands, and requires utilities to accept any such usage without misinterpreting operands as options. For example, if an implementation of the "printf" utility supports an "-e" option as an extension, the command "printf %s -e" must output the string "-e" without interpreting the "-e" as an option. -- SD5-XRAT-ERN-7 In XRAT section B.2.11.10 the following is found. Overrun in Dumping Trace Streams into Trace Logs The user lets the trace mechanism dump the trace stream initialized with POSIX_TRACE_FLUSH policy automatically into a trace log. If the dump operation is slower than the recording of trace events, the trace stream can overrun. This condition is detected by getting the status of the active trace stream (function posix_trace_get_status( )) and looking at the member posix_log_overrun_status of the read posix_stream_status structure. This overrun indicates that the trace mechanism is not able to operate in this mode at this speed. It is the responsibility of the user to modify one of the trace parameters (the stream size or the trace event type filter, for instance) to avoid such overrun conditions, if overruns are to be prevented. The same already predefined trace event types (see Overrun in Trace Streams Initialized with POSIX_TRACE_LOOP Policy) are used to detect and to know the duration of an overflow. the wording states that posix_log_overrun_status is checked for trace stream overruns. But according to XSH 2.11.1.1 Structures, second table, posix_log_overrun_status is only required if POSIX TRACE LOG is supported. The first table states that posix_stream_overrun_status is defined as "Indicates whether trace events were lost in the trace stream." Seems to be a simple substitution error. Action: replace posix_log_overrun_status with posix_stream_overrun_status in above text. -------- SD5-XRAT-ERN-6 CROSS VOLUME CHANGE to XCU Summary:For utilities in the CD and SD options and the m4 utility guideline 9 may not apply. applies to lex, yacc, ar, make , related changes to c99 and m4 lex OPTIONS Change from: The lex utility shall conform to the Base Definitions volume of IEEE Std 1003.1-200x, Section 12.2, Utility Syntax Guidelines. To: The lex utility shall conform to the Base Definitions volume of IEEE Std 1003.1-200x, Section 12.2, Utility Syntax Guidelines, except for guideline 9. Add to CH SD5-XRAT-ERN-6 is applied clarifying that guideline 9 of the Utility Syntax Guidelines does not apply. Apply the same changes to yacc, ar, and make (the wording is exactly the same in D1) c99 Add "Options can be interspersed with operands." to list of exceptions as follows: Change from: The c99 utility shall conform to the Base Definitions volume of IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines, except that: * The -l library operands have the format of options, but their position within a list of operands affects the order in which libraries are searched. * The order of specifying the -I and -L options is significant. * Conforming applications shall specify each option separately; that is, grouping option letters (for example, -cO) need not be recognized by all implementations. to The c99 utility shall conform to the Base Definitions volume of IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines, except that: * The -l library operands have the format of options, but their position within a list of operands affects the order in which libraries are searched. * The order of specifying the -I and -L options is significant. * Options can be interspersed with operands. <=== new insert * Conforming applications shall specify each option separately; that is, grouping option letters (for example, -cO) need not be recognized by all implementations. Add to CH SD5-XRAT-ERN-6 is applied clarifying that guideline 9 of the Utility Syntax Guidelines does not apply (options can be interspersed with operands). m4 OPTIONS Change from: The m4 utility shall conform to the Base Definitions volume of IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines, except that the order of the -D and -U options shall be significant. to: The m4 utility shall conform to the Base Definitions volume of IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines, except that the order of the -D and -U options shall be significant, and options can be interspersed with operands. Add to CH SD5-XRAT-ERN-6 is applied clarifying that guideline 9 of the Utility Syntax Guidelines does not apply (options can be interspersed with operands).