realpath returns NULL for broken symlinks

Mike Frysinger vapier at gentoo.org
Fri Feb 9 01:06:40 UTC 2007


On Thursday 08 February 2007, Luciano Miguel Ferreira Rocha wrote:
> On Thu, Feb 08, 2007 at 04:41:04PM -0500, Mike Frysinger wrote:
> > On Thursday 08 February 2007, Mike Frysinger wrote:
> > > so the answer is that realpath() on a broken symlink returns NULL when
> > > it should not ... realpath() on symlinks that are not broken work fine
> >
> > my reading of the POSIX spec says this is the correct behavior
> >
> > http://www.opengroup.org/onlinepubs/009695399/functions/realpath.html
> > char *realpath(const char *restrict file_name, char *restrict
> > resolved_name); ERRORS
> > 	[ENOENT] a component of file_name does not name an existing file
>
> <snip>
> Is there any reference on the spec about the definitive meaning of
> "component"?

3.169 Filename
A filename is sometimes referred to as a "pathname component".

but the only real way to find a definite answer is to ask on one of the 
mailing lists that tracks the spec ... if only i could find one ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20070208/f8fedbb2/attachment-0002.pgp 


More information about the uClibc mailing list