Sets the default file-permission mask of the current process to the specified mode.
#include <io.h> #include <sys/stat.h> #include <sys/types.h> mode_t umask (mode_t pmode);
pmode
The file-permission mask is applied to the permission mode specified in calls to creat or sopen. The permission mode determines the file's ownership and access rights; the file-permission mask affects only access rights. If a bit in the mask is 1, the corresponding bit in the file's requested permission mode value is set to 0 (disallowed). If a bit in the mask is 0, the corresponding bit is left unchanged. The permission mode for a new file is not set until the file is closed for the first time.
The argument pmode
is a constant expression containing one or more of the manifest constants defined in SYS/STAT.H. Join more than one constant with the bitwise-OR operator (|).
Value | Description |
---|---|
S_IRGRP | Read permission bit for POSIX file group |
S_IROTH | Read permission bit for POSIX World (other) owner |
S_IRUSR | Read permission for POSIX file owner |
S_IWGRP | Write permission bit for POSIX file group |
S_IWOTH | Write permission bit for POSIX World owner |
S_IWUSR | Write permission for POSIX file owner |
S_IXGRP | Execute or search permission bit for POSIX file group |
S_IXOTH | Execute or search permission bit for POSIX World owner |
S_IXUSR | Execute or search permission for POSIX file owner |
pmode
.
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.0 | intime/rt/include/io.h | io.h sys/stat.h sys/types.h |
clib.lib |