access("1.txt", W_OK) = 0 unlinkat(AT_FDCWD, "1.txt", 0) = 0
unlink("2.txt") = 0
The unlinkat() system call operates in exactly the same way as either unlink(2) or rmdir(2) (depending on whether or not flags includes the AT_REMOVEDIR flag) except for the differences described in this manual page. AT_REMOVEDIR By default, unlinkat() performs the equivalent of unlink(2) on pathname. If the AT_REMOVEDIR flag is specified, then performs the equivalent of rmdir(2) on pathname.
access("testdir", W_OK) = 0 unlinkat(AT_FDCWD, "testdir", AT_REMOVEDIR) = 0
-bash-3.00$ uname -a SunOS solaris 5.10 Generic_118855-33 i86pc i386 i86pc
System Administration Commands link(1M) NAME link, unlink - link and unlink files and directories SYNOPSIS /usr/sbin/link existing-file new-file /usr/xpg4/bin/link existing-file new-file /usr/sbin/unlink file DESCRIPTION The link and unlink commands link and unlink files and directories. Only super-users can use these commands on directories.
我想詳細部份需要自行測試:p
转http://www.chinaunix.net/jh/4/920666.html