Next: unlockpt, Previous: unlink, Up: Function Substitutes [Contents][Index]
unlinkat
POSIX specification:
http://www.opengroup.org/onlinepubs/9699919799/functions/unlinkat.html
Gnulib module: unlinkat
Portability problems fixed by Gnulib:
unlinkat(fd, "..", 0)
succeeds
without doing anything.
unlinkat(fd,"file/",flag)
:
GNU/Hurd, Solaris 9.
fcntl.h
instead of
unistd.h
:
Cygwin 1.7.1.
Portability problems not fixed by Gnulib:
unlinkat(fd,name,AT_REMOVEDIR)
fails because the specified
directory is not empty, the errno
value is system dependent.
unlinkdir(fd,"link-to-empty/",AT_REMOVEDIR)
remove empty and leave link-to-empty as a dangling
symlink. This is counter-intuitive, so some systems fail with
ENOTDIR
instead:
glibc
EPERM
. Meanwhile, if a process
has the ability to unlink directories, POSIX requires that
unlinkat(fd,"symlink-to-dir/",0)
remove dir and leave
symlink-to-dir dangling; this behavior is counter-intuitive.
The gnulib module unlinkdir can help determine whether code must be
cautious of unlinking directories.
Next: unlockpt, Previous: unlink, Up: Function Substitutes [Contents][Index]