unlink(3)

DESCRIPTION

Removes a non-directory filesystem entry at path.

SYNOPSIS

#include <unistd.h>

int unlink(const char *path);

RETURN VALUE

  • Returns zero, or -1 and sets errno.

ERRORS

  • -EFAULT
    • Path is null or cannot be read.
  • -EINVAL
    • Path resolution fails.
  • -ENOENT
    • The path does not exist.
  • -EISDIR
    • Path names a directory.
  • -EEXIST
    • Path is the mounted filesystem root.

NOTES

The native VFS has no separate link-count behavior exposed by this API.