DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

umask(S)


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), open(S), mkdir(S), and mkfifo(S) 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), mkdir(C), mknod(S), open(S)

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 .


© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003