fchown(3)

DESCRIPTION

Changes the stored owner UID and group GID of the object referred to by fd.

SYNOPSIS

#include <sys/stat.h>

int fchown(int fd, uid_t owner, gid_t group);

RETURN VALUE

  • Returns zero, or -1 and sets errno.

ERRORS

  • -EBADF
    • Fd is negative or does not refer to an open descriptor.
  • -EINVAL
    • The descriptor does not refer to a chownable object.

NOTES

The descriptor identifies the already opened object, so no pathname or final-component traversal occurs.