lchown(3)

DESCRIPTION

Changes the stored owner UID and group GID of the path's final object without following that final component. Intermediate components are still resolved normally.

SYNOPSIS

#include <sys/stat.h>

int lchown(const char *path, uid_t owner, gid_t group);

RETURN VALUE

  • Returns zero, or -1 and sets errno.

ERRORS

  • -EFAULT
    • Path is null or cannot be read.
  • -EINVAL
    • Path resolution fails.
  • -ENOENT
    • The target does not exist.

NOTES

The native path layer preserves the no-follow request for the final component.