umask(S) 6 January 1993 umask(S) Name umask - set and get file creation mask Syntax cc . . . -lc #include <sys/types.h> #include <sys/stat.h> mode_t umask (cmask) mode_t cmask; Description The umask routine sets the process's file mode creation mask to the argu- ment cmask and returns the previous value of the mask. Only the file permission mode bits of cmask (see stat.h) and of the process's file mode creation mask are used. The process's file mode creation mask is used by creat(S), open(S), mkdir(S), and mkfifo(S) to turn off permission bits in each routine's specified mode argument. Bit positions that are set in cmask are cleared in the mode of the created file. Return value The previous value of the file mode creation mask is returned. No errors are defined for the umask routine. See also creat(S), mkdir(C), mknod(S), open(S) Standards conformance umask conforms with: AT&T SVID Issue 2; X/Open Portability Guide, Issue 3, 1989; IEEE POSIX Std 1003.1-1990 System Application Program Interface (API) [C Language] (ISO/IEC 9945-1); and NIST FIPS 151-1.