umask()

set file creation mask 

Function


SYNOPSIS

#include <sys/types.h>

#include <sys/stat.h>

mode_t umask(mode_t cmask);


DESCRIPTION

The umask() function sets the file mode creation mask of the process to cmask and returns the previous value of the mask. Only the file permission bits of cmask and the file mode creation mask are used.

The open(), creat(), mkdir(), and mkfifo() calls use the file mode creation mask of the process to turn off permission bits in the mode parameter supplied. Bit positions that are set in cmask are cleared in the mode of the created file.


PARAMETERS

cmask 

Is the file creation permissions mask.


RETURN VALUES

If successful, umask() returns the file permission bits in the previous value of the process file creation mask. The umask() function always executes successfully.


CONFORMANCE

POSIX.1 (1996).


MULTITHREAD SAFETY LEVEL

Async-signal-safe.


PORTING ISSUES

On 10/2016/2019/11/2022/2025, the NuTCRACKER Platform supports additional bits for the access mask. Refer to the struct stat page, and to Security in the API-Specific Porting Issues chapter of the PTC MKS Toolkit UNIX to Windows Porting Guide.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
chmod(), creat(), mkdir(), mkfifo(), open(), stat()

Miscellaneous:
struct stat


PTC MKS Toolkit 10.5 Documentation Build 40.