*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->OpenBSD man pages -> umask (2)              



NAME    [Toc]    [Back]

     umask - set file creation mode mask

SYNOPSIS    [Toc]    [Back]

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

     umask(mode_t numask);

DESCRIPTION    [Toc]    [Back]

     The umask() routine sets the process's  file  mode  creation
mask to numask
     and returns the previous value of the mask.  The 9 low-order
access permission
 bits of numask are used by system  calls,  including
     mkdir(2),  mkfifo(2)  and mknod(2) to turn off corresponding
bits requested
     in the file mode.  (See  chmod(2)).   This  clearing  allows
each user to restrict
 the default access to his files.

     The default mask value is S_IWGRP|S_IWOTH (022, write access
for the owner
 only).  Child processes inherit the mask of  the  calling

RETURN VALUES    [Toc]    [Back]

     The  previous value of the file mode mask is returned by the

ERRORS    [Toc]    [Back]

     The umask() function is always successful.

SEE ALSO    [Toc]    [Back]

     chmod(2), mkdir(2), mkfifo(2), mknod(2), open(2)

STANDARDS    [Toc]    [Back]

     The umask() function call is expected to conform to IEEE Std

OpenBSD      3.6                           June      4,      1993
[ Back ]
 Similar pages
Name OS Title
umask IRIX set file-creation mode mask
umask HP-UX set or display the file mode creation mask
umask Tru64 Displays or sets the file mode creation mask
umask IRIX set and get file creation mask
umask HP-UX set and get file creation mask
umask Linux set file creation mask
umask Tru64 Sets and gets the value of the file creation mask
pxfumask IRIX Sets the file creation mask
doublebuffer IRIX sets the display mode to double buffer mode
lchmod FreeBSD change mode of file
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service