+.SS unlinkat()
+The
+.BR unlinkat ()
+system call operates in exactly the same way as either
+.BR unlink ()
+or
+.BR rmdir (2)
+(depending on whether or not
+.I flags
+includes the
+.B AT_REMOVEDIR
+flag)
+except for the differences described here.
+
+If the pathname given in
+.I pathname
+is relative, then it is interpreted relative to the directory
+referred to by the file descriptor
+.I dirfd
+(rather than relative to the current working directory of
+the calling process, as is done by
+.BR unlink ()
+and
+.BR rmdir (2)
+for a relative pathname).
+
+If the pathname given in
+.I pathname
+is relative and
+.I dirfd
+is the special value
+.BR AT_FDCWD ,
+then
+.I pathname
+is interpreted relative to the current working
+directory of the calling process (like
+.BR unlink ()
+and
+.BR rmdir (2)).
+
+If the pathname given in
+.I pathname
+is absolute, then
+.I dirfd
+is ignored.
+
+.I flags
+is a bit mask that can either be specified as 0, or by ORing
+together flag values that control the operation of
+.BR unlinkat ().
+Currently only one such flag is defined:
+.TP
+.B AT_REMOVEDIR
+By default,
+.BR unlinkat ()
+performs the equivalent of
+.BR unlink ()
+on
+.IR pathname .
+If the
+.B AT_REMOVEDIR
+flag is specified, then
+performs the equivalent of
+.BR rmdir (2)
+on
+.IR pathname .
+.PP
+See
+.BR openat (2)
+for an explanation of the need for
+.BR unlinkat ().
+.SH RETURN VALUE