Skip to content

Commit fb18987

Browse files
author
Vladimir Kotal
committed
more spellchecking
1 parent 176729f commit fb18987

File tree

3 files changed

+383
-365
lines changed

3 files changed

+383
-365
lines changed

file-api.tex

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
\item A process inherits file descriptors from its parent so it does not have to
3232
open already open files. Usually at least file descriptors 0, 1, and 2 are
3333
provided.
34-
\item Functions from a header file \texttt{stdio.h} (eg. \funnm{fopen}(),
34+
\item Functions from a header file \texttt{stdio.h} (e.g. \funnm{fopen}(),
3535
\funnm{fprintf}(), and \funnm{fscanf}()), and their file handle \texttt{FILE}
3636
are defined in the standard libc library and use standard system calls like
3737
\funnm{open}(), \funnm{write}(), and \funnm{read}(). From those functions, we
@@ -181,7 +181,7 @@
181181
\item The test of a file existence using the flag \texttt{O\_EXCL} and its
182182
subsequent creation if it did not exist, is an atomic operation. You can use
183183
that for lock files but only with the \texttt{open} call, not \texttt{creat}.
184-
\item You need extra privileges to create device special files (eg. to be a
184+
\item You need extra privileges to create device special files (e.g. to be a
185185
root).
186186
\end{itemize}
187187

@@ -232,7 +232,7 @@
232232
\texttt{read} will block unless some data gets available, a non-blocking
233233
\texttt{read} returns -1 and sets \texttt{errno} to \texttt{EAGAIN}.
234234
\item \texttt{write} returns a non-zero number of bytes less than \emph{nbyte}
235-
if less then \emph{nbyte} bytes can fit the file (eg. disk full), if the call
235+
if less then \emph{nbyte} bytes can fit the file (e.g. disk full), if the call
236236
was interrupted by a signal, or if \verb#O_NONBLOCK# was set and only part of
237237
the data fits into a pipe, socket, or a device; without \verb#O_NONBLOCK#
238238
the call will block until all the data can be written. If nothing can be
@@ -250,7 +250,7 @@
250250
manages to read or write, respectively, at least one byte -- see the paragraphs
251251
above.
252252
\item \texttt{O\_APPEND} guarantees an atomic write to the end of a file on a
253-
local filesystem, ie. \emsl{every} write will add data to the file end (so
253+
local filesystem, i.e. \emsl{every} write will add data to the file end (so
254254
called \emph{append-only} file).
255255
\end{itemize}
256256

@@ -347,7 +347,7 @@
347347
\sltitle{Working with a named pipe (FIFO)}
348348

349349
\begin{itemize}
350-
\item it may not be possible to create a FIFO on a distributed filesystem (eg.
350+
\item it may not be possible to create a FIFO on a distributed filesystem (e.g.
351351
NFS or AFS)
352352
\item you need to know the semantics of opening a FIFO
353353
\begin{itemize}
@@ -384,7 +384,7 @@
384384
results in a return value of 0, indicating the end of file -- the process will
385385
not block waiting for a producer. It is irrelevant whether the pipe was opened
386386
in a blocking or non-blocking mode.
387-
\item When writing to a pipe without a consumer (ie. the producer opened the
387+
\item When writing to a pipe without a consumer (i.e. the producer opened the
388388
pipe when there was at least one existing consumer), the kernel will send the
389389
producer a signal \texttt{SIGPIPE} (``broken pipe''). See the following
390390
example. For simplicity, we are using an unnamed pipe but that does not matter
@@ -419,7 +419,7 @@
419419
disappear, which could be solved by busy waiting. A much better solution would
420420
be to use the \texttt{select} call, see page \pageref{SELECT}.
421421
\item Writing data of length \texttt{PIPE\_BUF} bytes or less
422-
(\texttt{limits.h}) is guaranteed as atomic, ie. data will not be intermingled
422+
(\texttt{limits.h}) is guaranteed as atomic, i.e. data will not be intermingled
423423
with data written by other writers. For example, on Linux kernel 4.x it is 4096
424424
bytes, on Solaris 11 it is 5120 bytes, and on FreeBSD 8.2 it is only 512 bytes.
425425
It is obvious from the above that if you write less or equal than
@@ -474,7 +474,7 @@
474474
\item \texttt{SEEK\_CUR} \dots{} current position plus \emph{offset}
475475
\item \texttt{SEEK\_END} \dots{} size of the file plus \emph{offset}
476476
\end{itemize}
477-
\item returns the resulting offset (ie. from the file beginning)
477+
\item returns the resulting offset (i.e. from the file beginning)
478478
\item \texttt{lseek(fildes, 0, SEEK\_CUR)} only returns the current file
479479
position
480480
\end{itemize}
@@ -561,7 +561,7 @@
561561
\item We already know that the first available file descriptor is used when
562562
opening and creating file, see page \pageref{OPEN}.
563563
\item The original and duplicated file descriptors share the same slot in the
564-
system file table (see page \pageref{OPENFILETABLES}), ie. they share the file
564+
system file table (see page \pageref{OPENFILETABLES}), i.e. they share the file
565565
position and read/write mode.
566566
\item The equivalent for \texttt{dup2} is not fully equivalent. If
567567
\emph{fildes} is equal to \emph{fildes2}, \texttt{close(fildes2)} does not
@@ -695,10 +695,10 @@
695695
descriptor, having \texttt{FD} in the macro names (only one such exists --
696696
\texttt{FD\_CLOEXEC}), and flags associated with the slot in the system file
697697
table of opened files, having \texttt{FL} in the \texttt{fcntl} command macros
698-
(ie. \texttt{F\_GETFL}). See also the picture on page \pageref{OPENFILETABLES}.
698+
(i.e. \texttt{F\_GETFL}). See also the picture on page \pageref{OPENFILETABLES}.
699699
\item Devices may support reading and writing using \texttt{read} and
700700
\texttt{write}, and mapping files to memory (\texttt{mmap}, see page
701-
\pageref{MMAP}), all other operations on devices (eg. setting parameters,
701+
\pageref{MMAP}), all other operations on devices (e.g. setting parameters,
702702
locking, or eject) are performed using the \texttt{ioctl} system call.
703703
\item When setting flags, always get the present flags first. Even when you
704704
know the flags are zero, you never know how the code is modified in the future,
@@ -767,7 +767,7 @@
767767
\item \label{STAT} Example: \example{stat/stat.c}
768768
\item You can call \texttt{fstat} on file descriptors 0,1,2 as well. Unless
769769
redirected before, you will get information on the underlying terminal device
770-
(eg. \texttt{/dev/ttys011} on macOS). Example: \example{stat/stat012.c}.
770+
(e.g. \texttt{/dev/ttys011} on macOS). Example: \example{stat/stat012.c}.
771771
\end{itemize}
772772

773773

@@ -828,7 +828,7 @@
828828

829829
\begin{itemize}
830830
\item This call is mostly used by copy/move and also archive utilities to make
831-
sure the times are the same for the originals and copies. (eg. \texttt{tar} or
831+
sure the times are the same for the originals and copies. (e.g. \texttt{tar} or
832832
\texttt{rsync}).
833833
\item The shell interface for \texttt{utime} is the command \texttt{touch}. As
834834
mentioned in the slide, you cannot change the time of the i-node modification.
@@ -842,26 +842,26 @@
842842
\sltitle{File name manipulations}
843843
\texttt{int \funnm{link}(const char *\emph{path1}, const char *\emph{path2});}
844844
\begin{itemize}
845-
\item creates a new link (aka hard link), ie. a directory entry, named
845+
\item creates a new link (aka hard link), i.e. a directory entry, named
846846
\emph{path2} to file \emph{path1}. Hard links cannot span filesystems (use
847847
\funnm{symlink} for that).
848848
\end{itemize}
849849
\texttt{ int \funnm{unlink}(const char *\emph{path});}
850850
\begin{itemize}
851-
\item deletes a name (ie. a directory entry) and after deleting the last link to
851+
\item deletes a name (i.e. a directory entry) and after deleting the last link to
852852
the file and after closing the file by all processes, delete the file data.
853853
\end{itemize}
854854
\texttt{int \funnm{rename}(const char *\emph{old}, const char *\emph{new});}
855855
\begin{itemize}
856-
\item change the file name (ie. one specific link) from \emph{old} to
856+
\item change the file name (i.e. one specific link) from \emph{old} to
857857
\emph{new}. Works within the same filesystem only.
858858
\end{itemize}
859859
\end{slide}
860860

861861
\begin{itemize}
862862
\item It is better said again -- \emsl{Unix does not have a delete call for
863863
files}. Details are on page \pageref{FILEDELETE}.
864-
\item The call \texttt{link} creates hardlinks, ie. a relation between a file
864+
\item The call \texttt{link} creates hardlinks, i.e. a relation between a file
865865
name and an i-node number. I-node numbers are unique within a filesystem so for
866866
links between filesystems, symlinks are needed. A number of hardlinks to a
867867
specific file is only limited by the size of the \texttt{st\_nlink} member of
@@ -1030,7 +1030,7 @@
10301030

10311031
\begin{itemize}
10321032
\item The descriptor for \texttt{fchdir} is from \texttt{open} called on the
1033-
directory (ie. not from \texttt{opendir}).
1033+
directory (i.e. not from \texttt{opendir}).
10341034
\item There is also a function \texttt{chroot} which allows to change the root
10351035
directory of a calling process to a new one. It is often used in various server
10361036
implementations to limit access to the specific subtree. For example, for an

0 commit comments

Comments
 (0)