Commit | Line | Data |
---|---|---|
542d81aa KM |
1 | .\" Copyright (c) 1980 Regents of the University of California. |
2 | .\" All rights reserved. The Berkeley software License Agreement | |
3 | .\" specifies the terms and conditions for redistribution. | |
4 | .\" | |
7d4e3376 | 5 | .\" @(#)umask.2 6.1 (Berkeley) %G% |
542d81aa | 6 | .\" |
7d4e3376 | 7 | .TH UMASK 2 "" |
542d81aa KM |
8 | .UC 4 |
9 | .SH NAME | |
10 | umask \- set file creation mode mask | |
11 | .SH SYNOPSIS | |
5a5f5b5e KM |
12 | .ft B |
13 | oumask = umask(numask) | |
14 | .br | |
15 | int oumask, numask; | |
16 | .ft R | |
542d81aa KM |
17 | .SH DESCRIPTION |
18 | .I Umask | |
5a5f5b5e KM |
19 | sets the process's file mode creation mask to \fInumask\fP |
20 | and returns the previous value of the mask. The low-order | |
21 | 9 bits of \fInumask\fP are used whenever a file is created, | |
22 | clearing corresponding bits in the file mode | |
23 | (see | |
24 | .IR chmod (2)). | |
25 | This clearing allows each user to restrict the default access | |
26 | to his files. | |
542d81aa | 27 | .PP |
542d81aa KM |
28 | The value is initially 022 (write access for owner only). |
29 | The mask is inherited by child processes. | |
5a5f5b5e KM |
30 | .SH "RETURN VALUE |
31 | The previous value of the file mode mask is returned by the call. | |
542d81aa | 32 | .SH SEE ALSO |
5a5f5b5e | 33 | chmod(2), mknod(2), open(2) |