O'Reilly logo
  • Ivan Petrov thinks this is interesting:

Changing File Ownership: chown(), fchown(), and lchown()

File ownership and group are changed with three similar system calls:

#include <sys/types.h>                                     POSIX
#include <unistd.h>

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

From

Cover of Linux® Programming by Example

Note

system calls for changing permissions!