UMASK

Section: System Calls (2)
Updated: August 1, 1992
Index Return to Main Contents
 

NAME

umask - set file creation mode mask  

SYNOPSIS

#include <sys/types.h>
#include <sys/stat.h>

mode_t umask(mode_t cmask);
 

DESCRIPTION

The umask sets file mode creation mask of the calling process to cmask and returns the previous value of the mask. The low-order nine bits of cmask are used whenever a file is created, clearing corresponding bits in the file mode (see chmod(2)). This clearing allows a user to restrict the default access to his/her files.

The value is initially 022 (write access for owner only). The mask is inherited by child processes.

The BSD declaratation of umask accepts and returns type int, not mode_t.  

RETURN VALUE

The previous value of the file mode creation mask is returned by the call.  

ERRORS

The umask function is always successful---no return value indicates an error.  

SEE ALSO

chmod(2), creat(2), mkdir(2), mkfifo(2P),


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 00:58:48 GMT, September 26, 2024