The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 NAME

fchown - change owner and group of a file

 SYNOPSIS



#include <unistd.h>

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

 DESCRIPTION

The fchown() function has the same effect as chown() except that the file whose owner and group are to be changed is specified by the file descriptor fildes.

 RETURN VALUE

Upon successful completion, fchown() returns 0. Otherwise, it returns -1 and sets errno to indicate the error.

 ERRORS

The fchown() function will fail if:
[EBADF]
The fildes argument is not an open file descriptor.
[EPERM]
The effective user ID does not match the owner of the file or the process does not have appropriate privilege.
[EROFS]
The file referred to by fildes resides on a read-only file system.

The fchown() function may fail if:

[EINVAL]
The owner or group ID is not a value supported by the implementation.
[EIO]
A physical I/O error has occurred.
[EINTR]
The fchown() function was interrupted by a signal which was caught.

 EXAMPLES

None.

 APPLICATION USAGE

None.

 FUTURE DIRECTIONS

None.

 SEE ALSO

chown(), <unistd.h>.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]