4.3BSD beta release manual page
[unix-history] / usr / src / lib / libc / sys / umask.2
CommitLineData
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
10umask \- set file creation mode mask
11.SH SYNOPSIS
5a5f5b5e
KM
12.ft B
13oumask = umask(numask)
14.br
15int oumask, numask;
16.ft R
542d81aa
KM
17.SH DESCRIPTION
18.I Umask
5a5f5b5e
KM
19sets the process's file mode creation mask to \fInumask\fP
20and returns the previous value of the mask. The low-order
219 bits of \fInumask\fP are used whenever a file is created,
22clearing corresponding bits in the file mode
23(see
24.IR chmod (2)).
25This clearing allows each user to restrict the default access
26to his files.
542d81aa 27.PP
542d81aa
KM
28The value is initially 022 (write access for owner only).
29The mask is inherited by child processes.
5a5f5b5e
KM
30.SH "RETURN VALUE
31The previous value of the file mode mask is returned by the call.
542d81aa 32.SH SEE ALSO
5a5f5b5e 33chmod(2), mknod(2), open(2)