[PATCH] realpath stack usage 8k -> 4k

Denys Vlasenko vda.linux at googlemail.com
Wed May 7 22:24:46 UTC 2008


On Wednesday 07 May 2008 22:07, Bernhard Fischer wrote:
> >Tests 14 and 15 say in source:
> >
> >  /* 10 */
> >  {"./doesExist/../doesExist",          "./doesExist"},
> >  {"foobar",                            0, "./foobar", ENOENT},
> >  {".",                                 "."},
> >  {"./foobar",                          0, "./foobar", ENOENT},
> >#ifdef __UCLIBC__
> >  /* we differ from glibc here, but POSIX allows it as it says that if we did
> >   * not successfuly complete, the value of resolved_path is undefined */
> >  {"SYMLINK_LOOP",                      0, "", ELOOP},
> >  /* 15 */
> >  {"./SYMLINK_LOOP",                    0, "", ELOOP},
> >#else
> >
> >I can make it work so that test passes. However, as this comment says,
> >POSIX says nothing about return buffer's contents, so alternative
> 
> I didn't (and will not) look what posix mandates in this regard, but if
> posix sais that it's undefined then it's just that, undefined.
> Obviously, if we can follow bloat-libc in this respect for compatibility
> with minor trade-off, then please follow suite (as always) but if we
> cannot, then please introduce a(nother) config-knob to follow bloat-libc
> in this respect (ISTR that we flags this as glibc-compat in the comment,
> fwiw).

uclibc already did NOT mimic glibc in this regard.
After my patch, it still does not mimic glibc,
but differently - the "undefined" contents of the buffer
is different.

> >fix would be to not check its contents, only return value and errno.
> >
> >Do you want me to make readlink return "" or to stop testing
> >buffer's contents? Your pick.
> 
> cought:
> no-bloat-libc-code-here;

I dont understand.
--
vda



More information about the uClibc mailing list