UMASK(2)UMASK(2)NAMEumask - set file creation mode mask
SYNOPSIS
#include <sys/types.h>
#include <sys/stat.h>
mode_t umask(mode_t cmask);
DESCRIPTION
The umask sets file mode creation mask of the calling process to cmask
and returns the previous value of the mask. The low-order nine bits of
cmask are used whenever a file is created, clearing corresponding bits
in the file mode (see chmod(2)). This clearing allows a user to
restrict the default access to his/her files.
The value is initially 022 (write access for owner only). The mask is
inherited by child processes.
The BSD declaratation of umask accepts and returns type int, not
mode_t.
RETURN VALUE
The previous value of the file mode creation mask is returned by the
call.
ERRORS
The umask function is always successful—no return value indicates an
error.
SEE ALSOchmod(2), creat(2), mkdir(2), mkfifo(2P),
4th Berkeley Distribution August 1, 1992 UMASK(2)