UMASK(2) SysV UMASK(2)
NAME
umask - set and get file creation mask
SYNOPSIS
#include <sys/types.h>
#include <sys/stat.h>
mode_t umask (cmask)
mode_t cmask;
DESCRIPTION
umask sets the process' file mode creation mask to cmask and returns the
previous value of the mask. Only the low-order 9 bits of cmask and the
file mode creation mask are used.
Whenever a file is created (by the open(2), creat(2), mknod(2), mkdir(2),
or mkfifo(3) function), all file permission bits set in the file mode
creation mask are cleared in the mode of the created file. This clearing
allows users to restrict the default access to their files.
DIAGNOSTICS
The previous value of the file mode creation mask is returned.
SEE ALSO
chmod(2), creat(2), mknod(2), open(2).
mkdir(1), sh(1) in the SysV Command Reference.