From: | Xin LI <delphij@xxxxxxxxxxxxx> |
Date: | Mon, 15 Aug 2005 18:10:08 +0800 |
在 2005-08-15一的 00:26 -0700,Matthew Dillon写道: > dillon 2005/08/15 00:26:47 PDT > > DragonFly src repository > > Modified files: > sys/kern vfs_syscalls.c > Log: > UFS sometimes reports: 'ufs_rename: fvp == tvp (can't happen)'. The case > is not supposed to be able to happen, and UFS ignores the rename operation > when it sees it. This is true in both FreeBSD and DragonFly. > > But, in fact, the case CAN happen if you rename a file to another that > happens to be a hardlink to the first. The rename operations appears to The FreeBSD behavior was intentional. I think this change violates POSIX, which states: "If the old argument and the new argument resolve to the same existing file, rename() shall return successfully and perform no other action." (See http://www.opengroup.org/onlinepubs/009695399/functions/rename.html for reference. This could be found from the third paragraph of the DESCRIPTION section) I am not sure why POSIX requires this feature, though :-) What do you think about it? Cheers, -- Xin LI <delphij delphij net> http://www.delphij.net/
Attachment:
signature.asc
Description: This is a digitally signed message part