> I propose this patch to make realpath(3) conform to SUSv4. It is
> somewhat inspired by FreeBSD.
> When the second argument "resolved" of realpath(3) is set to NULL, the
> behaviour is "implementation-defined" according to IEEE Std 1003.1-2004[1],
> however IEEE Std 1003.1-2008 specifies that realpath(3) should allocate
> memory in that case[2].
> Currently, in OpenBSD, a program segfaults if it calls realpath with
> resolved set to NULL.
> I also tweaked some errno values to comply with SUSv4.
> The standard also says that the C99 "restrict" keyword should be used
> in the prototype of the function but I don't know if this breaks some
> old platforms.

Commited with nicm@'s tweaks and the removal of the explicit NULL check
for the first argument (OpenBSD's stance on these checks is that they
hide real bugs and we'd rather have applications dump core than fail U2
style (that is, in mysterious ways)).

Miod

Reply via email to