BSD 4_2 development
[unix-history] / usr / man / man2 / umask.2
CommitLineData
3d387ed6
C
1.TH UMASK 2 "12 February 1983"
2.UC 4
3.SH NAME
4umask \- set file creation mode mask
5.SH SYNOPSIS
6.ft B
7oumask = umask(numask)
8.br
9int oumask, numask;
10.ft R
11.SH DESCRIPTION
12.I Umask
13sets the process's file mode creation mask to \fInumask\fP
14and returns the previous value of the mask. The low-order
159 bits of \fInumask\fP are used whenever a file is created,
16clearing corresponding bits in the file mode
17(see
18.IR chmod (2)).
19This clearing allows each user to restrict the default access
20to his files.
21.PP
22The value is initially 022 (write access for owner only).
23The mask is inherited by child processes.
24.SH "RETURN VALUE
25The previous value of the file mode mask is returned by the call.
26.SH SEE ALSO
27chmod(2), mknod(2), open(2)