Bug #1097
closedglob(3c) needs to support non-POSIX options
100%
Description
The glob(3c) function in illumos (and Solaris) defines only the set of flags defined
by POSIX 1003.2. Other operating systems add a set of non-standard flags,
for example GLOB_LIMIT to instruct the glob function to limit its path search
before resources are exhausted.
This would have to be done in a manner that maintains binary compatibility, so that existing
applications continue to work. In non-POSIX mode, more flags are available, but the flag
defaults change. In addition, the size of the glob_t structure increases in non-POSIX mode.
Files
Updated by Gary Mills almost 11 years ago
- Status changed from New to Feedback
- Assignee set to Gary Mills
- % Done changed from 0 to 50
The best course of action seems to be to replace the glob() function in libc with the Openbsd version, while retaining compatibility with existing callers. This change introduces a well-tested function that contains both POSIX and non-POSIX features.
Updated by Gary Mills almost 11 years ago
- File glob.c-ill.diff glob.c-ill.diff added
- File glob.c-sty.diff glob.c-sty.diff added
- % Done changed from 50 to 80
I'm attaching two diff files. `glob.c-ill.diff' contains the content changes to adapt the Openbsd version of glob.c to illumos. `glob.c-sty.diff' contains the subsequent style changes. A webrev will be posted shortly.
Updated by Gary Mills almost 11 years ago
- File glob.c-ill.diff glob.c-ill.diff added
- File glob.c-sty.diff glob.c-sty.diff added
I've updated the two diff files slightly.
Updated by Gary Mills almost 11 years ago
- File glob.c-mb.diff glob.c-mb.diff added
The BSD-derived glob() had no support for international character sets. It stored 8-bit characters and flag bits within a single word. I've changed this data structure into a struct with separate members for a wide character and for a flag word. It also uses library functions to convert between wide characters and multi-byte characters. The file `glob.c-mb.diff' contains these changes.
Updated by Gary Mills almost 11 years ago
- File glob.c-mb.diff glob.c-mb.diff added
I've made a few more changes to improve the international character handling. I've also fixed a few incorrect return values. The new file `glob.c-mb.diff' contains these changes.
Updated by Gary Mills over 10 years ago
- File glob.c-isw.diff glob.c-isw.diff added
- % Done changed from 80 to 90
I've changed the comparison test for character classes to use the library functions wctype() and iswctype(), simplifying the code in glob.c . The file glob.c-isw.diff contains these changes.
Updated by Gary Mills over 10 years ago
- File glob.c-asc.diff glob.c-asc.diff added
One more small change, this one to replace wctomb() by iswascii() . See the attached file glob.c-asc.diff for details.
Updated by Gary Mills over 10 years ago
- File glob.c-rev.diff glob.c-rev.diff added
Here are some more changes to glob.c, in response to reviewer's comments. The file `glob.c-rev.diff' contains these changes.
Updated by Gary Mills over 10 years ago
- File glob.c-len.diff glob.c-len.diff added
One more change, this one to supply the remaining buffer length to mbtowc() instead of a fixed value. See the file `glob.c-len.diff' for details.
Updated by Gary Mills over 10 years ago
- File glob.c-w9.diff glob.c-w9.diff added
The file /tmp/glob.c-w9.diff contains changes to glob.c to permit the library function to differentiate between legacy and extended callers, along with a number of other small changes suggested by the Advocates.
Updated by Gary Mills over 9 years ago
- Status changed from Feedback to Closed
- % Done changed from 90 to 100
Dan McDonald: Just pushed it.