Document Number: AUSTIN/120 Title: XSH/ft/2 Aardvark Change Request Report Revision Date: 2002-06-26 Source: Andrew Josey, Chair Action: for review This report contains the draft dispositions of the aardvark comments submitted against the XSH/ft/2 (2nd batch of FT aardvark) text. Aardvark Summary Table ______________________ ERN 1 Accept ERN 2 Accept ERN 3 Accept ERN 4 Accept as marked ERN 5 Accept _____________________________________________________________________________ COMMENT Enhancement Request Number 1 wollman@lcs.mit.edu Defect in XSH 2.9.5.2 (rdvk# 3) {GAW-2002e} Mon, 17 Jun 2002 23:49:01 +0100 (BST) _____________________________________________________________________________ Accept_X___ Accept as marked below_____ Duplicate_____ Reject_____ Rationale for rejected or partial changes: _____________________________________________________________________________ Page: 55 Line: 2270 Section: 2.9.5.2 Problem: Defect code : 2. Omission select() is specified as a cancelation point, but the closely related interface pselect() is not. This seems counterintuitive, and makes the obvious implementation of pselect (as a wrapper around select) impossible. Andrew Josey writes: > This would appear an integration issue regarding pselect(). > Please aardvark. I'd say this was material for a technical corrigendum. > One reason it was not picked up was that 1003.1g was an addition > to 1003.1-1990 and only identified changes to existing sections in 1990, > and thus no threads stuff. Neither XSH5, or XNS5/5.2 had this function. Action: Add pselect() to the list of cancelation points. [Ed recommendation:Accept as a TC1 candidate] _____________________________________________________________________________ EDITORIAL Enhancement Request Number 2 bjh21@netbsd.org Defect in XSH exit (rdvk# 1) {bjh21:exit grammar} Tue, 14 May 2002 14:10:55 +0100 (BST) _____________________________________________________________________________ Accept_X___ Accept as marked below_____ Duplicate_____ Reject_____ Rationale for rejected or partial changes: _____________________________________________________________________________ Page: 305 Line: 9975 Section: exit Problem: This sentence changes from "shall be" to "are" part-way through. Action: Replace "are" with "shall be". [Ed recommendation: Accept for TC1] _____________________________________________________________________________ EDITORIAL Enhancement Request Number 3 bjh21@netbsd.org Defect in XSH putenv (rdvk# 4) {bjh21:putenv quote} Mon, 24 Jun 2002 19:20:22 +0100 (BST) _____________________________________________________________________________ Accept_X___ Accept as marked below_____ Duplicate_____ Reject_____ Rationale for rejected or partial changes: _____________________________________________________________________________ Page: 1148 Line: 35727 Section: putenv Problem: There is an unmatched double quotation mark before "name=value". Action: Insert a double quotation mark between "value" and the succeeding full stop. [Ed recommendation: Accept for TC1] _____________________________________________________________________________ EDITORIAL Enhancement Request Number 4 bjh21@netbsd.org Defect in XSH putenv (rdvk# 5) {bjh21:putenv hyphen} Mon, 24 Jun 2002 19:20:22 +0100 (BST) _____________________________________________________________________________ Accept_____ Accept as marked below_X___ Duplicate_____ Reject_____ Rationale for rejected or partial changes: See Ed recommendation _____________________________________________________________________________ Page: 1148 Line: 35731 Section: putenv Problem: The text currently refers to a "string-defining _name_", which to me means "a _name_ which defines a string". I think what is meant is, "string defining _name_", i.e., "a string which defines _name_". Action: Replace the hyphen between "string" and "defining" with a space. [Ed recommendation:Accept: with the rework The space used by string is no longer once a new string which defines name is passed to putenv()] _____________________________________________________________________________ COMMENT Enhancement Request Number 5 dougs@eng.sun.com Defect in XSH EXAMPLES (rdvk# 2) {dougs1} Fri, 7 Jun 2002 18:54:58 +0100 (BST) _____________________________________________________________________________ Accept_X___ Accept as marked below_____ Duplicate_____ Reject_____ Rationale for rejected or partial changes: _____________________________________________________________________________ Page: 1175 Line: 36568 Section: EXAMPLES Problem: Defect code : 3. Clarification required The readdir(3c) manpage contains the following text: The following sample code will search the current directory for the entry name: dirp = opendir("."); while (dirp) { errno = 0; if ((dp = readdir(dirp)) != NULL) { if (strcmp(dp->d_name, name) == 0) { closedir(dirp); return FOUND; } } else { if (errno == 0) { closedir(dirp); return NOT_FOUND; } closedir(dirp); return READ_ERROR; } } return OPEN_ERROR; There are several problems with this code: - it is needlessly incomplete - it doesn't show the inclusion of header files - it invents a bunch of confusing constants like FOUND and READ_ERROR - it uses 'dirp' and 'dp' and 'name' which are never declared; it is not immediately obvious what type dirp and dp are supposed to be. - The while loop is overly subtle; and if() test against dirp after the opendir is much more appropriate. Action: I suggest the following replacement example; it is somewhat longer but much more complete; a developer can much more easily adapt this to her program and it will compile cleanly and run as a standalone example program. ------------------------------------------------------------------------------- The following sample program will search the current directory for each of the arguments supplied on the command line: #include #include #include #include #include static void lookup(const char *arg) { DIR *dirp; struct dirent *dp; if ((dirp = opendir(".")) == NULL) { perror("couldn't open '.'"); return; } do { errno = 0; if ((dp = readdir(dirp)) != NULL) { if (strcmp(dp->d_name, arg) != 0) continue; (void) printf("found %s\n", arg); (void) closedir(dirp); return; } } while (dp != NULL); if (errno != 0) perror("error reading directory"); else (void) printf("failed to find %s\n", arg); (void) closedir(dirp); return; } int main(int argc, char *argv[]) { int i; for (i = 1; i < argc; i++) lookup(argv[i]); return (0); } [Ed recommendation: Accept for TC1]