umask(2)
NAME
umask − set file creation mask
SYNTAX
oumask = umask(numask)
int oumask, numask;
DESCRIPTION
The umask system call sets the process’s file mode creation mask to numask and returns the previous value of the mask. The low-order 9 bits of numask are used whenever a file is created, clearing corresponding bits in the file mode. For further information, see chmod(.). This clearing allows each user to restrict the default access to his files.
The value is initially 022 (write access for owner only). The mask is inherited by child processes.
The previous value of the file mode mask is returned by the call.
ENVIRONMENT
POSIX
When your program is compiled in POSIX mode, the numask argument is of type mode_t and the umask function returns a value of type mode_t.
SEE ALSO
System Calls