Skip to content

Commit 9f24014

Browse files
rsjordanVladimir Kotal
authored andcommitted
Typos, nits through page 94 (#45)
1 parent 8896976 commit 9f24014

File tree

2 files changed

+86
-86
lines changed

2 files changed

+86
-86
lines changed

file-api.tex

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -434,29 +434,29 @@
434434
\item All the information here applies to a unnamed pipes as well, see page
435435
\pageref{PIPE}.
436436

437-
%%%\item pro zápis platí toto (pøevzato z [Rochkind]):
437+
%%%\item pro zápis platí toto (pøevzato z [Rochkind]):
438438
%%%
439439
%%%\renewcommand{\arraystretch}{1.3}
440440
%%%
441441
%%%\begin{tabularx}{1.0\textwidth}{|l|l|l|l|l|}
442442
%%%\hline
443-
%%%\texttt{O\_NONBLOCK} ? & bajtù k zápisu & nic nelze zapsat & èásteèný zápis
444-
%%%mo¾ný & kompletní zápis mo¾ný \\
443+
%%%\texttt{O\_NONBLOCK} ? & bajtù k zápisu & nic nelze zapsat & èásteèný zápis
444+
%%%mo¾ný & kompletní zápis mo¾ný \\
445445
%%%\hline
446-
%%%není & \texttt{<= PIPE\_BUF} & zablokuje se; kompletní zápis; atomické &
447-
%%%zablokuje se; kompletní zápis; atomické & nezablokuje se; kompletní zápis;
448-
%%%atomické \\
446+
%%%není & \texttt{<= PIPE\_BUF} & zablokuje se; kompletní zápis; atomické &
447+
%%%zablokuje se; kompletní zápis; atomické & nezablokuje se; kompletní zápis;
448+
%%%atomické \\
449449
%%%\hline
450-
%%%není & \texttt{> PIPE\_BUF} & zablokuje se; kompletní zápis; není atomické &
451-
%%%zablokuje se; kompletní zápis; není atomické & mù¾e se zablokovat; kompletní
452-
%%%zápis; není atomické \\
450+
%%%není & \texttt{> PIPE\_BUF} & zablokuje se; kompletní zápis; není atomické &
451+
%%%zablokuje se; kompletní zápis; není atomické & mù¾e se zablokovat; kompletní
452+
%%%zápis; není atomické \\
453453
%%%\hline
454454
%%%nastaven & \texttt{<= PIPE\_BUF} & \texttt{EAGAIN} & \texttt{EAGAIN} &
455-
%%%nezablokuje se; kompletní zápis; atomické \\
455+
%%%nezablokuje se; kompletní zápis; atomické \\
456456
%%%\hline
457-
%%%nastaven & \texttt{> PIPE\_BUF} & \texttt{EAGAIN} & nezablokuje se; èásteèný
458-
%%%zápis nebo \texttt{EAGAIN}; není atomické & nezablokuje se; kompletní,
459-
%%%èásteèný zápis nebo \texttt{EAGAIN}; není atomické \\
457+
%%%nastaven & \texttt{> PIPE\_BUF} & \texttt{EAGAIN} & nezablokuje se; èásteèný
458+
%%%zápis nebo \texttt{EAGAIN}; není atomické & nezablokuje se; kompletní,
459+
%%%èásteèný zápis nebo \texttt{EAGAIN}; není atomické \\
460460
%%%\hline
461461
%%%\end{tabularx}
462462
\end{itemize}
@@ -775,7 +775,7 @@
775775
\item The UNIX norm does not specify the ordering of the \texttt{struct stat}
776776
members, nor does it prohibit adding new ones.
777777
\item \label{STAT} Example: \example{stat/stat.c}
778-
\item You can call \texttt{fstat} on file descriptors 0,1,2 as well. Unless
778+
\item You can call \texttt{fstat} on file descriptors 0, 1, and 2 as well. Unless
779779
redirected before, you will get information on the underlying terminal device
780780
(e.g. \texttt{/dev/ttys011} on macOS). Example: \example{stat/stat012.c}.
781781
\end{itemize}
@@ -791,7 +791,7 @@
791791
\item for a file type, in \texttt{<sys/stat.h>} there are
792792
constants \verb#S_IFMT# (bit mask for the file type bit field), \verb#S_IFBLK#
793793
(block device), \verb#S_IFCHR# (character device), \verb#S_IFIFO#
794-
(FIFO), \verb#S_IFREG# (regular), \verb#S_IFDIR# (directory),
794+
(FIFO), \verb#S_IFREG# (regular), \verb#S_IFDIR# (directory), and
795795
\verb#S_IFLNK# (symlink).
796796
\item macros for file type checking: \verb#S_ISBLK(m)#,
797797
\verb#S_ISCHR(m)#, \verb#S_ISFIFO(m)#, \verb#S_ISREG(m)#,
@@ -804,8 +804,8 @@
804804
*\emph{buf});}
805805
]]])
806806
\begin{itemize}
807-
\item if \emph{path} is a symlink, \texttt{stat()} returns information of the
808-
file the symlink refers to. This function returns information about the link
807+
\item if \emph{path} is a symlink, \texttt{stat()} returns information about the
808+
file the symlink refers to. \texttt{lstat()} function returns information about the link
809809
itself.
810810
\end{itemize}
811811
\end{slide}
@@ -865,11 +865,11 @@
865865
\texttt{ int \funnm{unlink}(const char *\emph{path});}
866866
\begin{itemize}
867867
\item deletes a name (i.e. a directory entry) and after deleting the last link to
868-
the file and after closing the file by all processes, delete the file data.
868+
the file and after closing the file by all processes, deletes the file data.
869869
\end{itemize}
870870
\texttt{int \funnm{rename}(const char *\emph{old}, const char *\emph{new});}
871871
\begin{itemize}
872-
\item change the file name (i.e. one specific link) from \emph{old} to
872+
\item changes the file name (i.e. one specific link) from \emph{old} to
873873
\emph{new}. Works within the same filesystem only.
874874
\end{itemize}
875875
\end{slide}
@@ -882,13 +882,13 @@
882882
links between filesystems, symlinks are needed. A number of hardlinks to a
883883
specific file is only limited by the size of the \texttt{st\_nlink} member of
884884
\texttt{struct stat}, and the specification does not specify the size, it only
885-
says its type \texttt{nlink\_t} is of an integer value.
885+
says its type \texttt{nlink\_t} is an integer value.
886886
\item The parameter \emph{path2} must not exist. So, you cannot rename using
887887
the \texttt{link} call.
888888
\item \texttt{unlink} does not work on directories.
889889
\item The shell command \texttt{mv} uses \texttt{rename} to move objects within
890-
the same filesystems. To move files between filesystems, a file needs to be
891-
copied first, then \texttt{unlink} it from the originating filesystem (the whole
890+
the same filesystem. To move files between filesystems, a file needs to be
891+
copied first, then \texttt{unlink}ed from the originating filesystem (the whole
892892
operation is not atomic).
893893
\item \texttt{rename} renames symlinks, not the files those symlinks point to.
894894
\item There is also a more generic call \texttt{remove}, see page
@@ -927,7 +927,7 @@
927927
\item Calling \texttt{unlink} on a hardlink will not release the file data if
928928
other hardlinks exists. You can delete the symlink's target in which case you
929929
end up with a \emph{broken link}.
930-
\item \texttt{readlink} is useful in situation when you want to \texttt{unlink}
930+
\item \texttt{readlink} is useful in the situation where you want to \texttt{unlink}
931931
the symlink's target.
932932
\item \emph{\texttt{bufsize}} is typically set as 1 byte less than the buffer
933933
size to accommodate the terminating \texttt{NULL} character.
@@ -944,7 +944,7 @@
944944
\texttt{int \funnm{mkdir}(const char *\emph{path}, mode\_t \emph{mode});}
945945
\begin{itemize}
946946
\item attempts to create an empty directory \emph{path} with entries
947-
'\texttt{.}' a '\texttt{..}'
947+
'\texttt{.}' and '\texttt{..}'
948948
\end{itemize}
949949
\texttt{int \funnm{rmdir}(const char *\emph{path});}
950950
\begin{itemize}
@@ -970,7 +970,7 @@
970970
\texttt{readdir} is allowed to return them in arbitrary order depending on the
971971
filesystem implementation. \texttt{NULL} is returned on failure
972972
and \texttt{errno} is set. \texttt{NULL} is also returned upon reaching the end
973-
of a directory but in that case \texttt{errno} is not changed.
973+
of a directory but in that case, \texttt{errno} is not changed.
974974
\item \texttt{readdir} is a stateful function. To read the directory from the
975975
beginning again, \texttt{rewinddir} can be used. If you want to read the
976976
directory from multiple threads, use the reentrant version, \texttt{readdir\_r}.
@@ -1041,7 +1041,7 @@
10411041
\texttt{int \funnm{chdir}(const char *\emph{path});}\\
10421042
\texttt{int \funnm{fchdir}(int \emph{fildes});}
10431043
\begin{itemize}
1044-
\item changes working directory for the process
1044+
\item changes the working directory for the process
10451045
\end{itemize}
10461046
\texttt{char *\funnm{getcwd}(char *\emph{buf}, size\_t \emph{size});}
10471047
\begin{itemize}
@@ -1053,7 +1053,7 @@
10531053
\begin{itemize}
10541054
\item The descriptor for \texttt{fchdir} is from \texttt{open} called on the
10551055
directory (i.e. not from \texttt{opendir}).
1056-
\item There is also a function \texttt{chroot} which allows to change the root
1056+
\item There is also a function \texttt{chroot} which changes the root
10571057
directory of a calling process to a new one. It is often used in various server
10581058
implementations to limit access to the specific subtree. For example, for an
10591059
FTP server. You have to be careful though and make sure it is not possible to
@@ -1103,7 +1103,7 @@
11031103
different file to what it actually had no rights to manipulate with. If the
11041104
timing is right, the SUID process will operate on that other file. The correct
11051105
solution is not to use the \texttt{access} call but return to the real UID/GID
1106-
and try the operation. For example, if we succeed to open the file under the
1106+
and try the operation. For example, if we succeed in opening the file under the
11071107
real UID/GID and continue working with the file descriptor, the file
11081108
manipulation mentioned above would not gain the attacker anything.
11091109
\end{itemize}
@@ -1130,7 +1130,7 @@
11301130
\begin{itemize}
11311131
\item changes file owner and group for \emph{path}. Value of
11321132
\texttt{-1} means do not change that ID.
1133-
\item only root change change owners so that users could not work around quotas
1133+
\item only root can change owners so that users could not work around quotas
11341134
to disown their files
11351135
\item a regular user can change a group of files he/she owns, and must belong to
11361136
the target group
@@ -1143,7 +1143,7 @@
11431143
masks.
11441144
\item Only the owner of a file can change its mode. Mode like
11451145
\texttt{rw-rw-rw-} has nothing to do with that.
1146-
\item In some implementations it was possible to pass the file ownership to
1146+
\item In some implementations, it was possible to pass the file ownership to
11471147
someone else. Today this is usually not allowed. Just think about how you
11481148
could work around a per-user filesystem quota with this.
11491149
\end{itemize}

0 commit comments

Comments
 (0)