Annotation of researchv10dc/man/adm/man2/chmod.2, revision 1.1.1.1

1.1       root        1: .TH CHMOD 2
                      2: .CT 2 file_inq_creat dirs secur
                      3: .SH NAME
                      4: chmod, fchmod, chown, fchown, utime \(mi change file mode, owner, group, or times
                      5: .SH SYNOPSIS
                      6: .nf
                      7: .B int chmod(file, mode)
                      8: .B char *name;
                      9: .PP
                     10: .B int fchmod(fildes, mode)
                     11: .PP
                     12: .B int chown(file, uid, gid)
                     13: .B char *name;
                     14: .PP
                     15: .B int fchown(fildes, uid, gid)
                     16: .PP
                     17: .B #include <sys/types.h>
                     18: .PP
                     19: .B int utime(file, timep)
                     20: .B char *file;
                     21: .B time_t timep[2];
                     22: .fi
                     23: .SH DESCRIPTION
                     24: These functions change inode information for the file named by
                     25: a null-terminated string or associated with file descriptor
                     26: .IR fildes .
                     27: .PP
                     28: .I Chmod
                     29: and
                     30: .I fchmod
                     31: change file permissions and other mode bits to
                     32: .IR mode .
                     33: Mode values are defined in
                     34: .IR stat (2).
                     35: Only the
                     36: .B 07777
                     37: bits of 
                     38: .IR mode
                     39: are significant.
                     40: Only the owner of a file (or super-user) may change the mode.
                     41: Only a process in the file's group (or super-user) may set
                     42: the set-group-id bit, 
                     43: .BR S_ISGID .
                     44: .PP
                     45: .I Chown
                     46: and
                     47: .I fchown
                     48: change the owner,
                     49: .I uid,
                     50: and the group,
                     51: .I gid,
                     52: of a file.
                     53: Only the super-user may change a file's owner.
                     54: The owner of a file
                     55: may change its group
                     56: to match the current effective groupid.
                     57: Other changes
                     58: are restricted to the super-user.
                     59: .PP
                     60: .I Utime
                     61: sets the
                     62: .B st_atime
                     63: (access time)
                     64: and
                     65: .B st_mtime
                     66: (modify time)
                     67: fields for
                     68: .I file
                     69: to
                     70: .B timep[0]
                     71: and
                     72: .B timep[1]
                     73: respectively.
                     74: The
                     75: .B st_ctime
                     76: (inode change time)
                     77: field for
                     78: .I file
                     79: is set to the current time.
                     80: .PP
                     81: The caller must be the owner of the file or the super-user.
                     82: .SH "SEE ALSO"
                     83: .IR stat (2),
                     84: .IR time (2)
                     85: .SH DIAGNOSTICS
                     86: all:
                     87: .BR EIO ,
                     88: .BR EPERM
                     89: .br
                     90: .IR "chmod, chown, utime" :
                     91: .BR ELOOP ,
                     92: .BR ENOENT ,
                     93: .BR ENOTDIR ,
                     94: .BR EACCES ,
                     95: .B EFAULT
                     96: .br
                     97: .IR "fchmod, fchown" :
                     98: .B EBADF
                     99: .SH BUGS
                    100: An attempt to change the inode data for
                    101: a file on a read-only file system
                    102: is quietly ignored.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.