Stephane CHAZELAS <[email protected]> wrote, on 21 Jul 2019:
>
> 2019-07-18 12:08:54 +0000, Austin Group Bug Tracker:
> [...]
> > If we add GLOB_NOCHECK as suggested to reduce the difference between using
> > glob()+execvp() and executing "ls -ld -- *.c" in the shell, then we should
> > add GLOB_ERR as well.
> [...]
> 
> Why GLOB_ERR? The shell does silently ignore directory open and
> read errors when expanding globs. In
> 
>    ls -ld -- *.c
> 
> The shell would run ls with a literal *.c as argument without
> giving any warning when the current directory is not readable.

The shell should ignore EACCES errors from opendir() (and probably
ELOOP, ENAMETOOLONG, ENOENT and ENOTDIR, none of which apply for "*.c")
but if opendir() fails with EMFILE or ENFILE the shell should report
an error.

-- 
Geoff Clare <[email protected]>
The Open Group, Apex Plaza, Forbury Road, Reading, RG1 1AX, England

Reply via email to