umask Subroutine Purpose Sets and gets the value of the file creation mask. Library Standard C Library (libc.a) Syntax #include mode_t umask (CreationMask) mode_t CreationMask; Description The umask subroutine sets the file-mode creation mask of the pro- cess to the value of the CreationMask parameter and returns the previous value of the mask. Whenever a file is created (by the open, mkdir, or mknod subrou- tine), 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. The mask is inherited by child processes. Parameters CreationMask Specifies the value of the file mode creation mask. The CreationMask parameter is constructed by logically ORing file permission bits defined in the sys/mode.h file. Nine bits of the CreationMask parameter are significant. Return Values If successful, the file permission bits returned by the umask subroutine are the previous value of the file-mode creation mask. The CreationMask parameter can be set to this value in subsequent calls to the umask subroutine, returning the mask to its initial state. Implementation Specifics This subroutine is part of Base Operating System (BOS) Runtime. Suggested Reading Prerequisite Information Files, Directories, and File Systems for Programmers in AIX Ver- sion 3.2 General Programming Concepts. Related Information The openx, open, or creat subroutine, chmod subroutine, mkdir subroutine, mkfifo subroutine, mknod subroutine, stat subrou- tine. The sh command, ksh command. The sys/mode.h file. Shells Overview in AIX Version 3.2 System User's Guide: Base and Devices.