Skip to content

Commit d7c6dc2

Browse files
committed
mention the umask syscall, readjust wording
1 parent 789161d commit d7c6dc2

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

file-api.tex

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,17 @@
116116
\label{OPEN}
117117

118118
\begin{itemize}
119-
\item The first available file descriptor is always used.
119+
\item The first available file descriptor is always used.
120120
\item When \texttt{O\_CREAT} is used, the \emph{mode} is modified using the
121-
current mask that can be changed via a shell command \texttt{umask} -- those
122-
bits in \emph{mode}, also set in the process umask, are nullified. The
123-
default umask value is typically (and historically) \texttt{022}. We recommend
124-
that you always set it to \texttt{077} in your profile script. Never do that for
125-
root though otherwise you may end up with a system in a non-supported
126-
configuration -- installed software may not be possible to run by
127-
non-privileged users, what worked before may stop working, etc.
121+
current mask that can be changed using the \texttt{umask} system call
122+
(the \texttt{umask} shell command is a wrapper of this system call)
123+
-- those bits in \emph{mode}, that are also set in the process umask,
124+
are nullified.
125+
The default umask value is typically (and historically) \texttt{022}.
126+
We recommend that you always set it to \texttt{077} in your profile script.
127+
Never do that for root though otherwise you may end up with a system in
128+
a non-supported configuration -- installed software may not be possible to run
129+
by non-privileged users, what worked before may stop working, etc.
128130
\item If the \emph{mode} argument is required and not specified, you get
129131
whatever is presently on the stack or in the CPU register used to pass the
130132
argument. Both flags and mode are stored in the system file table, see page

0 commit comments

Comments
 (0)