UMASK(2) BSD UMASK(2)
NAME
umask - set file creation mode mask
SYNOPSIS
oumask = umask(numask)
int oumask, numask;
DESCRIPTION
umask sets the process' file mode creation mask to numask and returns the
previous value of the mask. The low-order nine bits of numask are used
whenever a file is created, clearing corresponding bits in the file mode
(see chmod(2)). This clearing allows each user to restrict the default
access to his files.
The value is initially 000 (write access for everyone). The mask is
inherited by child processes.
SEE ALSO
chmod(2), mknod(2), open(2)
DIAGNOSTICS
The previous value of the file mode mask is returned by the call.
NOTES
On some systems, the value is initially 022 (write access for owner
only).