Re: [PATCH] Implement AT_SYMLINK_FOLLOW flag for linkat
From: Al Viro
Date: Sun Jun 18 2006 - 15:15:32 EST
On Sat, Jun 17, 2006 at 03:13:22PM -0400, Ulrich Drepper wrote:
> When the linkat() syscall was added the flag parameter was added in the
> last minute but it wasn't used so far. The following patch should
> change that. My tests show that this is all that's needed.
>
> If OLDNAME is a symlink setting the flag causes linkat to follow the
> symlink and create a hardlink with the target. This is actually
> the behavior POSIX demands for link() as well but Linux wisely does
> not do this. With this flag (which will most likely be in the next
> POSIX revision) the programmer can choose the behavior, defaulting
> to the safe variant. As a side effect it is now possible to implement
> a POSIX-compliant link(2) function for those who are interested.
Where does POSIX require that? IIRC, it was along the lines of "application
can't rely on kernel doing the right thing", not "kernel must do the
wrong thing"...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/