AT&T UNIX™PC Unix System V Users Manual - tenox
AT&T UNIX™PC Unix System V Users Manual - tenox AT&T UNIX™PC Unix System V Users Manual - tenox
CHMOD (2) CHMOD (2) NAME chmod - change mode of file SYNOPSIS int chmod (path, mode) char *path; int mode; DESCRIPTION Path points to a path name naming a file. Chmod sets the access permission portion of the named file's mode according to the bit pattern contained in mode . Access permission bits are interpreted as follows: 04000 Set user ID on execution. 02000 Set group ID on execution. 01000 Save text image after execution 00400 Read by owner 00200 Write by owner 00100 Execute (or search if a directory) by owner 00070 Read, write, execute (search) by group 00007 Read, write, execute (search) by others The effective user ID of the process must match the owner of the file or be super-user to change the mode of a file. If the effective user ID of the process is not super-user, mode bit 01000 (save text image on execution) is cleared. If the effective user ID of the process is not super-user or the effective group ID of the process does not match the group ID of the file, mode bit 02000 (set group ID on execution) is cleared. If an executable file is prepared for sharing then mode bit 01000 prevents the system from abandoning the swap-space image of the program-text portion of the file when its last user terminates. Thus, when the next user of the file executes it, the text need not be read from the file system but can simply be swapped in, saving time. Chmod will fail and the file mode will be unchanged if one or more of the following are true: A component of the path prefix is not a directory. [ENOTDIR[ The named file does not exist. [ENOENTI Search permission is denied on a component of the path prefix. [EACCESj The effective user ID does not match the owner of the file and the effective user ID is not super-user. [EPERMI The named file resides on a read-only file system. [EROFSI Path points outside the process's allocated address space. [EFAULT[ - 1 -
- Page 615 and 616: VC (l) VC (l) NAME vc - version con
- Page 617: VC (l) VC ( l ) ::text Used for key
- Page 620 and 621: VI ( 1) vi file vi vi + n file vi +
- Page 622 and 623: VI (l) rn OAD Av MODIFYING TEXT Cha
- Page 624 and 625: VI ( 1 ) VI( 1) file to newtext :gf
- Page 626 and 627: VI (l) VI (l) :set x? Show value of
- Page 628 and 629: VI (l) VI ( 1) mapped to I, then if
- Page 630 and 631: VI (l) VI (l) won't be broken. Inse
- Page 632 and 633: � I . .... .,_ J _ . . ·
- Page 634 and 635: .. \ '-�� -·
- Page 637 and 638: WIIO (I) WHO(l) NAME who - who is o
- Page 639: WRITE ( l ) WRITE ( l ) NAME write
- Page 642 and 643: XARGS(l) XARGS (l) -nnumber Execute
- Page 645 and 646: YACC { I ) YACC { l ) NAME yacc - y
- Page 647 and 648: INTRO ( 2) INTR0 ( 2 ) NAME intro -
- Page 649 and 650: INTRO ( 2) INTR0 (2) 21 EISDffi Is
- Page 651 and 652: INTRO (2) INTRO ( 2) ProcO is the s
- Page 653 and 654: INTR0 (2) INTR0 (2) permission requ
- Page 655 and 656: INTR0 (2) time_t shm_dtime; time_t
- Page 657: ACCESS (2} ACCESS (2} NAME access -
- Page 661 and 662: ALARM (2) ALARM (2) NAME alarm - se
- Page 663: BRK(2) BRK ( 2 ) NAME brk, sbrk - c
- Page 668 and 669: CHMOD (2) CHMOD (2) RETURN VALUE Up
- Page 671: CHROOT (2) CHROOT (2) NAME chroot -
- Page 674 and 675: '�
- Page 676 and 677: CREAT (2) CREAT (2) file descriptor
- Page 678 and 679: ·� '·-
- Page 680 and 681: EXEC (2) EXEC (2) Envp is an array
- Page 683 and 684: EXIT ( 2 ) EXIT (2) NAME exit, _exi
- Page 685 and 686: FCNTL (2) FCNTL (2) NAME fcntl - fi
- Page 687: FCNTL (2) FCNTL (2) [ENOLCK] Cmd is
- Page 690 and 691: FORK(2) FORK(2) The system-imposed
- Page 693 and 694: GETUID ( 2 ) GETUID ( 2 ) NAME getu
- Page 695 and 696: IOCTL (2) IOCTL (2) NAME ioctl - co
- Page 697: KILL(2) KILL(2) NAME kill - send a
- Page 701: LSEEK ( 2) LSEEK ( 2 ) NAME )seek -
- Page 704 and 705: MKNOD (2} MKNOD (2} RETURN VALUE Up
- Page 707 and 708: MSGCTL ( 2 ) MSGCTL ( 2 ) NAME msgc
- Page 709 and 710: MSGGET (2) MSGGET (2) NAME msgget -
- Page 711 and 712: MSGOP (2) MSGOP (2) NAME msgop - me
- Page 713 and 714: � I MSGOP {2) MSGOP {2) If (msgft
- Page 715: NICE (2) NICE (2) NAME nice - chang
CHMOD (2) CHMOD (2)<br />
NAME<br />
chmod - change mode of file<br />
SYNOPSIS<br />
int chmod (path, mode)<br />
char *path;<br />
int mode;<br />
DESCRIPTION<br />
Path points to a path name naming a file. Chmod sets the access<br />
permission portion of the named file's mode according to the bit<br />
pattern contained in mode .<br />
Access permission bits are interpreted as follows:<br />
04000 Set user ID on execution.<br />
02000 Set group ID on execution.<br />
01000 Save text image after execution<br />
00400 Read by owner<br />
00200 Write by owner<br />
00100 Execute (or search if a directory) by owner<br />
00070 Read, write, execute (search) by group<br />
00007 Read, write, execute (search) by others<br />
The effective user ID of the process must match the owner of the<br />
file or be super-user to change the mode of a file.<br />
If the effective user ID of the process is not super-user, mode bit<br />
01000 (save text image on execution) is cleared.<br />
If the effective user ID of the process is not super-user or the<br />
effective group ID of the process does not match the group ID of<br />
the file, mode bit 02000 (set group ID on execution) is cleared.<br />
If an executable file is prepared for sharing then mode bit 01000<br />
prevents the system from abandoning the swap-space image of the<br />
program-text portion of the file when its last user terminates.<br />
Thus, when the next user of the file executes it, the text need not<br />
be read from the file system but can simply be swapped in, saving<br />
time.<br />
Chmod will fail and the file mode will be unchanged if one or<br />
more of the following are true:<br />
A component of the path prefix is not a directory.<br />
[ENOTDIR[<br />
The named file does not exist. [ENOENTI<br />
Search permission is denied on a component of the path<br />
prefix. [EACCESj<br />
The effective user ID does not match the owner of the file<br />
and the effective user ID is not super-user. [EPERMI<br />
The named file resides on a read-only file system. [EROFSI<br />
Path points outside the process's allocated address space.<br />
[EFAULT[<br />
- 1 -