Commit | Line | Data |
---|---|---|
8bb980a3 C |
1 | SETMODE(3) BSD Programmer's Manual SETMODE(3) |
2 | ||
3 | N\bNA\bAM\bME\bE | |
4 | g\bge\bet\btm\bmo\bod\bde\be, s\bse\bet\btm\bmo\bod\bde\be - modify mode bits | |
5 | ||
6 | S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS | |
7 | _\bm_\bo_\bd_\be_\b__\bt | |
8 | g\bge\bet\btm\bmo\bod\bde\be(_\bc_\bo_\bn_\bs_\bt _\bv_\bo_\bi_\bd _\b*_\bs_\be_\bt, _\bm_\bo_\bd_\be_\b__\bt _\bm_\bo_\bd_\be); | |
9 | ||
10 | _\bv_\bo_\bi_\bd | |
11 | s\bse\bet\btm\bmo\bod\bde\be(_\bc_\bo_\bn_\bs_\bt _\bc_\bh_\ba_\br _\b*_\bm_\bo_\bd_\be_\b__\bs_\bt_\br); | |
12 | ||
13 | D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN | |
14 | The g\bge\bet\btm\bmo\bod\bde\be() function returns a copy of the file permission bits _\bm_\bo_\bd_\be as | |
15 | altered by the values pointed to by _\bs_\be_\bt. While only the mode bits are al- | |
16 | tered, other parts of the file mode may be examined. | |
17 | ||
18 | The s\bse\bet\btm\bmo\bod\bde\be() function takes an absolute (octal) or symbolic value, as | |
19 | described in chmod(1), as an argument and returns a pointer to mode val- | |
20 | ues to be supplied to g\bge\bet\btm\bmo\bod\bde\be(). Because some of the symbolic values are | |
21 | relative to the file creation mask, s\bse\bet\btm\bmo\bod\bde\be() may call umask(2). If this | |
22 | occurs, the file creation mask will be restored before s\bse\bet\btm\bmo\bod\bde\be() returns. | |
23 | If the calling program changes the value of its file creation mask after | |
24 | calling s\bse\bet\btm\bmo\bod\bde\be(), s\bse\bet\btm\bmo\bod\bde\be() must be called again if g\bge\bet\btm\bmo\bod\bde\be() is to mod- | |
25 | ify future file modes correctly. | |
26 | ||
27 | If the mode passed to s\bse\bet\btm\bmo\bod\bde\be() is invalid, s\bse\bet\btm\bmo\bod\bde\be() returns NULL. | |
28 | ||
29 | E\bER\bRR\bRO\bOR\bRS\bS | |
30 | The s\bse\bet\btm\bmo\bod\bde\be() function may fail and set errno for any of the errors spec- | |
31 | ified for the library routine malloc(3). | |
32 | ||
33 | S\bSE\bEE\bE A\bAL\bLS\bSO\bO | |
34 | chmod(1), stat(2), umask(2), malloc(3) | |
35 | ||
36 | H\bHI\bIS\bST\bTO\bOR\bRY\bY | |
37 | The g\bge\bet\btm\bmo\bod\bde\be() and s\bse\bet\btm\bmo\bod\bde\be() functions first appeared in 4.4BSD. | |
38 | ||
39 | 4.4BSD June 9, 1993 1 |