Commit | Line | Data |
---|---|---|
15715acc KB |
1 | .\" Copyright (c) 1980, 1991, 1993 |
2 | .\" The Regents of the University of California. All rights reserved. | |
542d81aa | 3 | .\" |
931b8415 | 4 | .\" %sccs.include.redist.man% |
542d81aa | 5 | .\" |
15715acc | 6 | .\" @(#)umask.2 8.1 (Berkeley) %G% |
931b8415 CL |
7 | .\" |
8 | .Dd | |
9 | .Dt UMASK 2 | |
10 | .Os BSD 4 | |
11 | .Sh NAME | |
12 | .Nm umask | |
13 | .Nd set file creation mode mask | |
14 | .Sh SYNOPSIS | |
15 | .Fd #include <sys/stat.h> | |
16 | .Ft mode_t | |
17 | .Fn umask "mode_t numask" | |
18 | .Sh DESCRIPTION | |
19 | The | |
20 | .Fn umask | |
21 | routine sets the process's file mode creation mask to | |
22 | .Fa numask | |
23 | and returns the previous value of the mask. The 9 low-order | |
24 | access permission | |
25 | bits of | |
26 | .Fa numask | |
27 | are used by system calls, including | |
28 | .Xr open 2 , | |
29 | .Xr mkdir 2 , | |
30 | and | |
31 | .Xr mkfifo 2 , | |
32 | to turn off corresponding bits | |
33 | requested in file mode. | |
ead8edf9 | 34 | (See |
931b8415 | 35 | .Xr chmod 2 ) . |
5a5f5b5e KM |
36 | This clearing allows each user to restrict the default access |
37 | to his files. | |
931b8415 | 38 | .Pp |
ead8edf9 KB |
39 | The default mask value is S_IWGRP|S_IWOTH (022, write access for the |
40 | owner only). | |
931b8415 CL |
41 | Child processes inherit the mask of the calling process. |
42 | .Sh RETURN VALUES | |
5a5f5b5e | 43 | The previous value of the file mode mask is returned by the call. |
931b8415 CL |
44 | .Sh ERRORS |
45 | The | |
46 | .Fn umask | |
47 | function is always successful. | |
48 | .Sh SEE ALSO | |
49 | .Xr chmod 2 , | |
50 | .Xr mknod 2 , | |
51 | .Xr open 2 | |
52 | .Sh STANDARDS | |
53 | The | |
54 | .Fn umask | |
ead8edf9 | 55 | function call is expected to conform to IEEE Std 1003.1-1988 |
931b8415 | 56 | .Pq Dq Tn POSIX . |