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 Windows NT/2000/XP/2003/Vista, 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 MKS Toolkit UNIX to Windows Porting Guide.


AVAILABILITY

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


SEE ALSO

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

Miscellaneous:
struct stat


MKS Toolkit 9.2 Documentation Build 16.