Minutes of the 11 Nov 2010 Teleconference Austin-504 Page 1 of 1 Submitted by Andrew Josey, The Open Group. November 12 , 2010 Attendees Andrew Josey, The Open Group Don Cragun, PASC OR Mark Brown, IBM, TOG OR Geoff Clare, The Open Group Eric Blake, Red Hat Apologies Nick Stoughton, USENIX, ISO/IEC OR Andrew reported on mail from Lowell Johnson, that he is stepping down as PASC Chair. He is looking for advice on how to solicit a new chair. We agreed that this ought to be raised with the SEC. Andrew will send a note back to Lowell and also copy in Roger Martin for advice. Action: Andrew to respond to Lowell. (Closed) * We picked up on regular Bug processing Bug 0000249: Add standard support for $'...' in shell Accept as Marked http://austingroupbugs.net/view.php?id=249 Don has updated the proposal. This was reviewed and further changes identified and made. This is an enhancement request and needs an Issue 8 tag. The following is a complete replacement for the Desired Action to be taken to resolve this issue. It is based on other notes in this bug report, numerous e-mail messages on the austin-group-l alias, and discussions held during Austin Group conference calls: In XCU section 2.2 (Quoting) change: "The various quoting mechanisms are the escape character, single-quotes, and double-quotes." on P2298, L72359 to: "The various quoting mechanisms are the escape character, single-quotes, double-quotes, and dollar-single-quotes." Add the following new paragraph to XCU section 2.2.3 (Double-Quotes) after P2298, L72385 (indented to the same level as the paragraph on L72382-72385): "The shall not retain its special meaning introducing the dollar-single-quotes form of quoting (see [xref to 2.2.4])." In XCU 2.2.3 (Double-Quotes) change: "A single-quoted or double-quoted string that begins, but does not end, within the "‘...‘" sequence" on P2299, L72392-72393 to: "A quoted (single-quoted, double-quoted, or dollar-single-quoted) string that begins, but does not end, within the "‘...‘" sequence" At the end of XCU section 2.2 after P2299, L72401 add a new subsection, with this text: 2.2.4 Dollar-Single-Quotes A sequence of characters starting with a immediately followed by a single-quote ($') shall preserve the literal value of all characters up to an unescaped terminating single-quote ('), with the exception of certain backslash escape sequences, as follows: \" yields a (double-quote) character. \' yields an (single-quote) character. \\ yields a character. \a yields an character. \b yields a character. \e yields an character. \f yields a > character. \n yields a character. \r yields a character. \t yields a character. \v yields a character. \cX yields the control character listed in the Value column of Table 4.21 on page 3203 (xref to XCU Table 4.21) in the Operands section of the stty utility when X is one of the characters listed in the ^c column of the same table, except that \c\\ yields the control character since the character must be escaped. \uXXXX yields the character specified by ISO/IEC 10646 whose four-digit short universal character name is XXXX (and whose eight-digit short universal character name is 0000XXXX). \UXXXXXXXX yields the character specified by ISO/IEC 10646 whose eight-digit short universal character name is XXXXXXXX. \xXX yields the byte whose value is the hexadecimal value XX (one or two hex digits) \XXX yields the byte whose value is the octal value XXX (one to three octal digits) If a \xXX or \XXX escape sequence yields a byte whose value is 0, that byte and any following regular characters and escape sequences up to the terminating unescaped single-quote shall be evaluated and discarded. If a universal character name specified by \uXXXX or \UXXXXXXXX is less than 00A0 other than 0024 ($), 0040 (@), or 0060('), the results are undefined. If a universal character name specified by \uXXXX or \UXXXXXXXX is in the range D800 through DFFF inclusive, the results are undefined. If more than two hexadecimal digits immediately follow \x, the results are unspecified. If a backslash is followed by any sequence not listed above or if \e, \cX, \uXXXX, or \UXXXXXXXX yields a character that is not present in the current locale, the result is implementation-defined. If a backslash escape sequence represents a single-quote character (for example \u0060, \U00000060, or \'), that sequence shall not terminate the dollar-single-quote sequence. In XCU section 2.3 (Token Recognition) point 4, change: "If the current character is , single-quote, or double-quote and it is not quoted, it shall affect quoting for subsequent characters up to the end of the quoted text. The rules for quoting are as described in Section 2.2 (on page 2298). During token recognition no substitutions shall be actually performed, and the result token shall contain exactly the characters that appear in the input (except for joining), unmodified, including any embedded or enclosing quotes or substitution operators, between the and the end of the quoted text. The token shall not be delimited by the end of the quoted field." on P2299-2300, L72425-72432 to: "If the current character is an unquoted , single-quote, or double-quote or is the first character of an unquoted single-quote sequence, it shall affect quoting for subsequent characters up to the end of the quoted text. The rules for quoting are as described in Section 2.2 (on page 2298). During token recognition no substitutions shall be actually performed, and the result token shall contain exactly the characters that appear in the input (except for joining), unmodified, including any embedded or enclosing quotes or substitution operators, between the start and the end of the quoted text. The token shall not be delimited by the end of the quoted field." In XCU section 2.6, add: * a to the end of the list created by the changes identified in Mantis BugID 49. (BugID 49 modifies text on P2305, L72669-72671 in XCU7.) In XCU 2.6.3 (Command Substitution) change: "A single-quoted or double-quoted string that begins, but does not end, within the "‘...‘" sequence produces undefined results." on P2309, L72827-72829 to: "A quoted string that begins, but does not end, within the "‘...‘" sequence produces undefined results." In XCU section 2.6.7 (Quote Removal), change: "The quote characters (, single-quote, and double-quote) that were present in the original word shall be removed unless they have themselves been quoted." on P2311, L72904-72905 to: "The quote character sequence single-quote and the characters (, single-quote, and double-quote) that were present in the original word shall be removed unless they have themselves been quoted." In the Note in XCU section 2.10.2 (Shell Grammar Rules) rule 1, change: "Because at this point characters are retained in the token, quoted strings cannot be recognized as reserved words." on P2325, L73436-73437 to: "Because at this point quoting characters (, single-quote, , and the single-quote sequence) are retained in the token, quoted strings cannot be recognized as reserved words." Add a new section in XRAT following P3649, L124068: C.2.2.4 Dollar-Single-Quotes The $'...' quoting construct has been implemented in several recent shells. It is similar to character string literals ("...") in the C Standard with the following exceptions: 1. The \x escape sequence in C can be followed by an arbitrary number of hexadecimal digits. The ksh93 implementation of $'...' also consumes an arbitrary number of hexadecimal digits; bash consumes at most two hexadecimal digits in this case. This standard leaves the result unspecified if more than two hexadecimal digits follow \x. (Note that a hexadecimal escape followed by a literal hexadecimal character can always be represented as $'\xXX'X) 2. The \c escape sequence is not included in the C standard. There was also some disagreement in shells that historically supported \c escape sequences in $'...'. These include: A. whether \cA through \cZ produced the byte values 1 through 26, respectively or supported the codeset independent control character as specified by the stty utility. This standard requires codeset independence. B. whether \c[, \c\\, \c], \c^, \c_, and \? could be used to yield the , , , , , and control characters, respectively. This standard requires support for all of the control characters except NULL (matching what is done in the stty utility). C. whether \c\\ or \c\ was used to represent . This standard requires \c\\ to make backslash escape processing consistent. The implementors of the most common shells that implement $'\cX' agreed to convert to the behavior specified in this standard. Some shells also allow \c to act as an inverse function to \cX (i.e., \cm and \cM yield and \c yields m or M. This standard leaves this behavior implementation-defined. 3. The \e escape sequence is not included in the C Standard, but was provided by all historical shells that supported $'...'. Some also supported \E as a synonym. One member of the group objected to adding \e because the control character is not required to be in the portable character set. The \e sequence is included because many historical users of $'...' expect it to be there. The \E sequence is not included in this standard because escape sequences that start with followed by an uppercase letter (except \U) are reserved by the C Standard for implementation use. 4. The \XXX octal escape sequence and the \xXX hexadecimal escape sequence can be used to insert a null byte into a C Standard character string literal and into a $'...' quoted word in this standard. In C, any characters specified after that null byte (including escape sequences) continue to be processed and added to the expansion of the character string literal. In $'...' in the shell, however, this standard requires the null byte and all remaining characters up to the terminating unescaped single-quote be evaluated and discarded. (This was historic practice in bash, but not in ksh93.) This allows an escape sequence producing a null byte to terminate the dollar-single-quoted expansion, but not terminate the token in which it appears if there are characters remaining in the token. For example: printf a$'b\0c\''d is required by this standard to produce: abd while historic versions of ksh93 produced: ab 5. The double-quote (") character can be used literally, while the single-quote (') character must be represented as an escape sequence. In C, single-quote can be used literally, while double-quote requires an escape sequence. In C, if a character specified by \uXXXX or \UXXXXXXXX in "..." does not exist in the execution character set, the results are implementation-defined. Similarly, this standard makes the results implementation-defined if \e, \cX, \uXXXX, or \UXXXXXXXX specifies a character that is not present in the current locale. Note that the escape sequences recognized by $'...', file format notation (see Table 5-1 on page 121), XSI-conforming implementations of the echo utility (see the echo utility's operands section on page 2615), and the printf utility's format operand (see the printf utility's extended description section on page 3050) are not the same. Some escape sequences are not recognized by all of the above, the \c escape sequence in echo is not at all like the \c escape sequence in $'...', octal escape sequences in some of the above accept one to four octal digits and require a leading zero while others accept one to three octal digits and do not require a leading zero. 0000339: Add _SC_NPROCESSORS_CONF / _SC_NPROCESSORS_ONLN to sysconf(3) / unistd.h OPEN http://austingroupbugs.net/view.php?id=339 Andrew had contacted the reporter to try and make the pdf available to him. We will leave this item open pending a further response. Bug 343 ftok cleanups OPEN http://austingroupbugs.net/view.php?id=343 Action on Eric to develop a test program and run on several platforms. Eric reported that this item is progressing but still open Bug 0000345: semop must update sem_otime Accept as Marked http://austingroupbugs.net/view.php?id=345 An Interpretation is required. Interpretation response The standard clearly states that timestamps shall be updated, and conforming implementations must conform to this. Rationale: The description of IPC_STAT says: Place the current value of each member of the semid_ds data structure associated with semid into the structure pointed to by arg.buf, where arg is the fourth argument to semctl(). The contents of this structure are defined in . and the definition of semid_ds in includes these members: time_t sem_otime Last semop() time. time_t sem_ctime Last time changed by semctl(). Together these constitute a clear requirement for semctl() IPC_STAT to set the sem_otime member of arg.buf to the last time a semop() operation was performed on the semaphore, and to set the sem_ctime member of arg.buf to the last time the semaphore was changed by a semctl() call. However, the following edits will make it clear to the reader, as well as clarify that timestamps are truncated rather than rounded if the current time has more precision than time_t. Notes to the Editor (not part of this interpretation) At line 17067 (XSH 2.7.1 IPC General Description), add a new paragraph: In addition to the ipc_perm structure, each associated data structure includes several time_t fields for recording timestamps of particular operations. When an operation is described as setting a timestamp to the current time, that particular timestamp member of the associated data structure shall be set to the largest time_t value which is not greater than the current time. At line 44077 [XSH msgctl IPC_SET], add: Also, the msg_ctime timestamp shall be set to the current time, as described in . At line 44145 [XSH msgget], change "set equal to the current time" to "set to the current time, as described in ". At line 44230 [XSH msgrcv], change "set equal to the current time" to "set to the current time, as described in ". At line 44329 [XSH msgsnd], change "set equal to the current time" to "set to the current time, as described in ". At both line 58514 [XSH semctl SETVAL] and line 58526 [SETALL], add a sentence before "Requires alter permission": Also, the sem_ctime timestamp shall be set to the current time, as described in . After line 58541 [semctl IPC_SET], add a sentence: The sem_ctime timestamp shall be set to the current time, as described in . At line 58796 [semop DESCRIPTION], add a sentence: Also, the sem_otime timestamp shall be set to the current time, as described in . At line 60590 [shmat RETURN VALUE], add a sentence: Also, the shm_atime timestamp shall be set to the current time, as described in . At line 60648 [shmctl IPC_SET], add: Also, the shm_ctime timestamp shall be set to the current time, as described in . At line 60710 [shmdt RETURN VALUE], add a sentence: Also, the shm_dtime timestamp shall be set to the current time, as described in . At line 60760 [shmget], change "set equal to the current time" to "set to the current time, as described in ". There are a number of Interpretations that have completed their 30 day review and need closing: 255 , 301, 308, 317 Action: Andrew to close (Now completed) Next Steps ---------- The next call will be on Nov 18th at 08:00 Pacific and will continue processing defect reports. http://austingroupbugs.net See the calendar for the list of dialup numbers. An IRC channel will be available for the meeting irc://irc.freestandards.org #austin ICAL: http://www.google.com/calendar/ical/nvctqtstkuni3fab9k3jqtrt4g@group.calendar.google.com/public/basic XML: http://www.google.com/calendar/feeds/nvctqtstkuni3fab9k3jqtrt4g@group.calendar.google.com/public/basic