Sets and gets the value of the file creation mask.
#include <sys/stat.h>
mode_t umask ( CreationMask)
mode_t CreationMask;
The umask subroutine sets the file-mode creation mask of the process 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 subroutine), 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.
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. |
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.
This subroutine is part of Base Operating System (BOS) Runtime.
The chmod subroutine, mkdir subroutine, mkfifo subroutine, mknod subroutine, openx, open, or creat subroutine, stat (statx, stat, lstat, fstatx, fstat, fullstat, ffullstat, stat64, lstat64, or fstat64 Subroutine) subroutine.
The sys/mode.h file.
Shells Overview in AIX 5L Version 5.1 System User's Guide: Operating System and Devices.
Files, Directories, and File Systems for Programmers in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.