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

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



NAME    [Toc]    [Back]

     umask - set file creation mode mask

LIBRARY    [Toc]    [Back]

     Standard C Library (libc, -lc)

SYNOPSIS    [Toc]    [Back]

     #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 open(2),
     mkdir(2), mkfifo(2) and mknod(2) to turn off corresponding bits requested
     in 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 process.

RETURN VALUES    [Toc]    [Back]

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

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 conforms to ISO/IEC 9945-1:1990 (``POSIX.1'').

BSD                              June 4, 1993                              BSD
[ 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