DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

umask(S-osr5)


umask -- set and get file creation mask

Syntax

cc . . . -lc

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

mode_t umask (cmask) mode_t cmask;

Description

The umask routine sets the process's file mode creation mask to the argument cmask and returns the previous value of the mask. Only the file permission mode bits of cmask (see stat.h) and of the process's file mode creation mask are used.

The process's file mode creation mask is used by creat(S-osr5), open(S-osr5), mkdir(S-osr5), and mkfifo(S-osr5) to turn off permission bits in each routine's specified mode argument. Bit positions that are set in cmask are cleared in the mode of the created file.

Return value

The previous value of the file mode creation mask is returned. No errors are defined for the umask routine.

See also

creat(S-osr5), mkdir(C), mknod(S-osr5), open(S-osr5)

Standards conformance

umask conforms with:

X/Open Portability Guide, Issue 3, 1989 ;
IEEE POSIX Std 1003.1-1990 System Application Program Interface (API) [C Language] (ISO/IEC 9945-1) ;
and NIST FIPS 151-1 .


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005