BSD 3 development
[unix-history] / usr / man / man2 / umask.2
CommitLineData
e6817382
BJ
1.TH UMASK 2
2.SH NAME
3umask \- set file creation mode mask
4.SH SYNOPSIS
5.B umask(complmode)
6.SH DESCRIPTION
7.I Umask
8sets a mask used whenever a file is created by
9.IR creat (2)
10or
11.IR mknod (2):
12the actual mode (see
13.IR chmod (2))
14of the newly-created file is the logical
15.B and
16of the given mode and the complement of the argument.
17Only the low-order 9 bits of the mask (the protection bits)
18participate.
19In other words, the mask shows the bits to be turned off
20when files are created.
21.PP
22The previous value of the mask is returned by the call.
23The value is initially 0 (no restrictions).
24The mask is inherited by child processes.
25.SH SEE ALSO
26creat(2), mknod(2), chmod(2)
27.SH "ASSEMBLER (PDP-11)"
28(umask = 60.)
29.br
30.B sys umask; complmode