28 lines
693 B
C
28 lines
693 B
C
#ifdef HAVE_CONFIG_H
|
|
#include <config.h>
|
|
#endif
|
|
|
|
#include <fcntl.h>
|
|
#include <unistd.h>
|
|
|
|
#include "../internal/syscall.h"
|
|
|
|
/*
|
|
* unlink/unlinkat: remove a directory entry. unlink(path) names the
|
|
* entry directly; unlinkat resolves a relative path against the
|
|
* directory fd and, when flag is AT_REMOVEDIR, removes the empty
|
|
* directory fd/path instead of a non-directory name. Symbolic links are
|
|
* themselves removed, never followed. Return 0, or -1 with errno set.
|
|
*/
|
|
int
|
|
unlink(const char *path)
|
|
{
|
|
return syscall_ret(__syscall1(SYS_unlink, (long)path));
|
|
}
|
|
|
|
int
|
|
unlinkat(int fd, const char *path, int flag)
|
|
{
|
|
return syscall_ret(__syscall3(SYS_unlinkat, fd, (long)path, flag));
|
|
}
|