Added mkdir(2) to discussion, made term "file mode creation mask" clearer.

Various, mostly small, wording changes
This commit is contained in:
Michael Kerrisk 2005-06-30 08:07:33 +00:00
parent a6a99a4c8c
commit d1fd6d3d74
1 changed files with 16 additions and 7 deletions

View File

@ -29,7 +29,7 @@
.\" <nick@debian.com> with Lars Wirzenius <liw@iki.fi> suggestion
.TH UMASK 2 1998-08-09 "Linux" "Linux Programmer's Manual"
.SH NAME
umask \- set file creation mask
umask \- set file mode creation mask
.SH SYNOPSIS
.B #include <sys/types.h>
.br
@ -37,25 +37,34 @@ umask \- set file creation mask
.sp
.BI "mode_t umask(mode_t " mask );
.SH DESCRIPTION
.B umask
sets the umask to
.BR umask ()
sets the calling process's file mode creation mask (umask) to
.I mask
& 0777.
The umask is used by
.BR open (2)
to set initial file permissions on a newly-created file.
.BR open (2),
.BR mkdir (2),
and other system calls that create files
.\" e.g., mkfifo(), creat(), mknod(), sem_open(), mq_open(), shm_open()
.\" but NOT the System V IPC *get() calls
to modify the permissions placed on newly created files or directories.
Specifically, permissions in the umask are turned off from
the \fBmode\fR argument to
.BR open (2)
and
.BR mkdir (2)
(so, for example, the common umask default value of 022 results in new
files being created with permissions 0666 & ~022 = 0644 = rw-r--r--
in the usual case where the \fBmode\fR is specified as 0666).
in the usual case where the \fBmode\fR is specified to
.BR open (2)
as 0666).
.SH "RETURN VALUE"
This system call always succeeds and the previous value of the mask
is returned.
.SH "CONFORMING TO"
SVr4, SVID, POSIX, X/OPEN, BSD 4.3
.SH "SEE ALSO"
.BR creat (2),
.BR chmod (2),
.BR mkdir (2),
.BR open (2)