Mail Archives: djgpp-workers/2000/06/14/12:08:32
On Wed, 14 Jun 2000, Laurynas Biveinis wrote:
> > @item 17
> >
> > +ELOOP -- Too many levels of symbolic links. Usually it means
> > +encountered link loop (link1 -> link2; link2 -> link1).
> > +
> > +@item 18
> > +
> > EMFILE -- Too many open files in system (no more handles available).
> > This usually means that the number specified by the @samp{FILES=}
> > directive in @file{CONFIG.SYS} is too small.
> >
> > This is wrong: those numbers in "@item 17" etc. are not ordinal
> > numbers, they are numerical values of the errno variable. So ELOOP
> > should go under "@item 39" and you should leave the existing numbers
> > intact.
>
> As I understand texinfo, @item specifies just a label in a table layout
> and the real EWHATEVER value does not matter there, does it?
No. This is what @item in a @table produces:
`18'
EMFILE -- Too many open files in system (no more handles available).
So it shows both the numerical value and the text.
> > About `lstat': since `_is_executable' always resolves links, doesn't
> > it mean that the execute bit returned by `lstat' would be incorrect,
> > because it is taken from the target of a link?
>
> I was 110% sure that I've included missing S_ISLNK *this time*.
> Guess if it is really so. But the real code sets all bits correctly, it
> looks like this:
>
> if (readlink(......
> {
> statbuf->st_mode |= S_ISLNK;
> ...
> }
> else
> {
> ... _is_executable and so on.
> }
I don't see this code inside `lstat' in your patches. In fact, I don't
see a call to `readlink' inside `lstat' at all (and I didn't expect to).
> Note that I'm already asking for FILENAME_MAX filename length.
> I think I will do something like
>
> char fn_buf[FILENAME_MAX + 1];
> ...
> do
> {
> bytes_copied = readlink(real_path, fn_buf, FILENAME_MAX + 1);
> if (bytes_copied == FILENAME_MAX + 1)
> {
> errno = ENAMETOOLONG;
> return -1;
> }
> ...
I agree, but this probably should be mentioned in the docs as another way
of checking `readlink's results.
- Raw text -