table of contents
other versions
- wheezy 3.44-1
- jessie 3.74-1
- jessie-backports 4.10-2~bpo8+1
- testing 4.10-2
- unstable 4.10-2
other sections
UMASK(2) | Linux Programmer's Manual | UMASK(2) |
NAME¶
umask - set file mode creation maskSYNOPSIS¶
#include <sys/types.h>DESCRIPTION¶
umask() sets the calling process's file mode creation mask (umask) to mask & 0777 (i.e., only the file permission bits of mask are used), and returns the previous value of the mask.S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH(octal 0666) when creating a new file, the permissions on the resulting file will be:
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH(because 0666 & ~022 = 0644; i.e., rw-r--r--).
RETURN VALUE¶
This system call always succeeds and the previous value of the mask is returned.CONFORMING TO¶
SVr4, 4.3BSD, POSIX.1-2001.NOTES¶
A child process created via fork(2) inherits its parent's umask. The umask is left unchanged by execve(2).SEE ALSO¶
chmod(2), mkdir(2), open(2), stat(2)COLOPHON¶
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/.2008-01-09 | Linux |