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

  man pages->HP-UX 11i man pages -> umask (2)              


 umask(2)                                                           umask(2)

 NAME    [Toc]    [Back]
      umask - set and get file creation mask

 SYNOPSIS    [Toc]    [Back]
      #include <sys/stat.h>

      mode_t umask(mode_t cmask);

 DESCRIPTION    [Toc]    [Back]
      umask() sets the process's file mode creation mask to umask() and
      returns the previous value of the mask.  Only the file access
      permission bits of the masks are used.

      The bits set in cmask specify which permission bits to turn off in the
      mode of the created file, and should be specified using the symbolic
      values defined in stat(5).

 EXAMPLES    [Toc]    [Back]
      The following creates a file named path in the current directory with
      permissions S_IRWXU|S_IRGRP|S_IXGRP, so that the file can be written
      only by its owner, and can be read or executed only by the owner or
      processes with group permission, even though group write permission
      and all permissions for others are passed in to creat().

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

           int fildes;

           (void) umask(S_IWGRP|S_IRWXO);
           fildes = creat("path", S_IRWXU|S_IRWXG|S_IRWXO);

 RETURN VALUE    [Toc]    [Back]
      The previous value of the file mode creation mask is returned.

 SEE ALSO    [Toc]    [Back]
      mkdir(1), sh(1), mknod(1M), chmod(2), creat(2), mknod(2), open(2).

      umask(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1

 Hewlett-Packard Company            - 1 -   HP-UX 11i Version 2: August 2003
[ Back ]
 Similar pages
Name OS Title
umask Linux set file creation mask
umask IRIX set file-creation mode mask
pxfumask IRIX Sets the file creation mask
umask Tru64 Sets and gets the value of the file creation mask
umask FreeBSD set file creation mode mask
umask NetBSD set file creation mode mask
umask OpenBSD 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
newfile IRIX perform file-creation tasks for printer scripts
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service