Skip to content

Commit 78da2da

Browse files
author
Vladimir Kotal
committed
finish spellchecking of the signals file
1 parent 4c79284 commit 78da2da

File tree

4 files changed

+69
-40
lines changed

4 files changed

+69
-40
lines changed

network.tex

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
transmits datagram
199199
\end{itemize}
200200
\item \emph{protocol}: \texttt{0} (default for a given \emph{type})
201-
or a valid protocol number (eg. \texttt{6}~=~TCP, \texttt{17}~=~UDP)
201+
or a valid protocol number (e.g. \texttt{6}~=~TCP, \texttt{17}~=~UDP)
202202
\end{itemize}
203203
\end{slide}
204204

@@ -207,15 +207,15 @@
207207
\begin{itemize}
208208
\item Function is declared in \texttt{<sys/socket.h>} as well as other network
209209
related functions from the previous slide.
210-
\item Sockets use the same name space as file descriptors, ie. the same
210+
\item Sockets use the same name space as file descriptors, i.e. the same
211211
descriptor table. If you write a simple program that only calls
212212
\funnm{socket}(), it will return 3 as that will be the first available slot in
213213
the descriptor table.
214214
\item Connection-oriented communication is always bidirectional and is similar
215215
to pipes. However, note that pipes may not be bidirectional, see page
216216
\pageref{TWO_WAY_PIPES}.
217217
\item Sometimes you can see constants beginning with \verb#PF_# (meaning
218-
\emph{protocol family}, eg. \texttt{PF\_IN\-ET}, \verb#PF_UNIX#, or
218+
\emph{protocol family}, e.g. \texttt{PF\_IN\-ET}, \verb#PF_UNIX#, or
219219
\texttt{PF\_IN\-ET6}) and used in a \funnm{socket}() call. Constants \verb#AF_#
220220
(\emph{address family}) are then used only for naming the sockets. While it
221221
might make a better sense, the UNIX specification only defines \verb#AF_#
@@ -295,8 +295,8 @@
295295
ports and the primary IP address on the interface through which the destination
296296
can be accessed. In general, as a client, you do not need a specific outgoing
297297
port so \funnm{bind}() is usually not needed and the call is typically used only
298-
by servers as they need a specific port number to be contacted (eg. 443 for
299-
HTTPS). Note that some legacy services though, eg. \texttt{rsh}, require the
298+
by servers as they need a specific port number to be contacted (e.g. 443 for
299+
HTTPS). Note that some legacy services though, e.g. \texttt{rsh}, require the
300300
client to connect from a privileged port (0-1023). Such a client must call
301301
\funnm{bind}() to use such a port and also have enough privileges to do that.
302302
\item \emsl{The address and port must always use network byte ordering.} See
@@ -435,16 +435,16 @@
435435
\item The newly created socket has the same characteristics as \emph{socket}.
436436
For example, if \emph{socket} was non-blocking, the new socket is non-blocking
437437
as well.
438-
\item If more clients running on the same host connect to the same server (ie.
438+
\item If more clients running on the same host connect to the same server (i.e.
439439
using the same IP address and port), individual connections are distinguished
440440
only by the client side port number. Do remember that a TCP connection is
441-
uniquely identified by two sockets, ie. ``((addr1, port1), (addr2, port2)).''
441+
uniquely identified by two sockets, i.e. ``((addr1, port1), (addr2, port2)).''
442442
\item The \emph{address} may be \texttt{NULL} which means the caller is not
443443
interested in the remote end address. In that case, \emph{address\_len} should
444444
be \texttt{NULL} as well.
445445
\item If the code is written to be independent of an address family, it should
446446
use \texttt{struct sockaddr\_storage} for \emph{address}. Any specific address
447-
struct is guaranteed to fit in \texttt{struct sockaddr\_storage}, ie. either
447+
struct is guaranteed to fit in \texttt{struct sockaddr\_storage}, i.e. either
448448
\texttt{struct sockaddr\_in} or \texttt{struct sockaddr\_in6}. Also see page
449449
\pageref{TCPCLNTEXAMPLE}.
450450
\item \label{TCP_SINK_SERVER_C} Example: \example{tcp/tcp-sink-server.c}
@@ -588,7 +588,7 @@
588588
\item \texttt{MSG\_OOB} \dots{} reads urgent (out-of-band)
589589
data
590590
\item \texttt{MSG\_WAITALL} \dots{} waits for the buffer to fill up
591-
ie. \emph{l{}en} bytes
591+
i.e. \emph{l{}en} bytes
592592
\end{itemize}
593593
\end{itemize}
594594
\end{slide}

signals.tex

Lines changed: 48 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
\item signal categories:
1818
\begin{itemize}
1919
\item \emsl{asynchronous events} happening independently of the main program
20-
flow, eg. a signal sent from another process, a timer expiration
20+
flow, e.g. a signal sent from another process, a timer expiration
2121
(\texttt{SIGALRM}), terminal disconnect (\texttt{SIGHUP}), or pressing
2222
\texttt{Ctrl-C} (\texttt{SIGINT})
23-
\item \emsl{exceptions} caused by a running process, eg.
23+
\item \emsl{exceptions} caused by a running process, e.g.
2424
attempt to access a restricted area of memory (\texttt{SIGSEGV})
2525
\end{itemize}
2626
\end{itemize}
@@ -64,7 +64,7 @@
6464
\begin{slide}
6565
\sltitle{Introduction to signals (continued)}
6666
\begin{itemize}
67-
\item it is the simplest interprocess communication -- it only carries
67+
\item it is the simplest inter process communication -- it only carries
6868
information that an event happened
6969
\begin{itemize}
7070
\item there is a real-time POSIX extension that allows for more information,
@@ -92,12 +92,14 @@
9292

9393
\begin{slide}
9494
\sltitle{Sending signals}
95+
ifdef([[[NOSPELLCHECK]]], [[[
9596
\texttt{int \funnm{kill}(pid\_t \emph{pid}, int \emph{sig});}
97+
]]])
9698
\begin{itemize}
97-
\item sends signal \emph{sig} to a process or a process group
98-
based on value of \emph{pid}:
99+
\item sends signal \emph{\texttt{sig}} to a process or a process group
100+
based on value of \emph{\texttt{pid}}:
99101
\begin{itemize}
100-
\item \texttt{> 0} \dots{} to process with \emph{pid}
102+
\item \texttt{> 0} \dots{} to process with \emph{\texttt{pid}}
101103
\item \texttt{== 0} \dots{} to all processes in the same group
102104
\item \texttt{== -1} \dots{} to all aside from system processes
103105
\item \texttt{< -1} \dots{} to processes in a group \texttt{abs(pid)}
@@ -148,13 +150,13 @@
148150
\end{itemize}
149151

150152
Signals \texttt{SIGKILL} and \texttt{SIGSTOP} \emsl{always} trigger an implicit
151-
action, ie. exit or stop, respectively.
153+
action, i.e. exit or stop, respectively.
152154
\end{slide}
153155

154156
\begin{itemize}
155157
\item Creating a core dump means to store the contents of the process virtual
156158
address space to a file. Usually such file has a word \texttt{core} in its
157-
filename. Some systems, eg. macOS, may not generate core dumps by default even
159+
filename. Some systems, e.g. macOS, may not generate core dumps by default even
158160
if its for signals with default core dump action.
159161
\item Most of the signals implicitly terminate the process, some create a core
160162
dump on top of that to enable a post-mortem analysis.
@@ -185,7 +187,7 @@
185187
\emsl{Detected errors:}
186188

187189
\begin{tabular}{ll}
188-
\texttt{SIGBUS} & bus error, eg. wrong alignment (core) \\
190+
\texttt{SIGBUS} & bus error, e.g. wrong alignment (core) \\
189191
\texttt{SIGFPE} & floating point exception (core) \\
190192
\texttt{SIGILL} & illegal instructions (core) \\
191193
\texttt{SIGSEGV} & segmentation violation (core) \\
@@ -231,7 +233,7 @@
231233
\item If such a signal is masked while the signal is being delivered, the
232234
program behavior is undefined.
233235
\end{itemize}
234-
\item Bottom line is that if a hardware generated error is real (ie. the signal
236+
\item Bottom line is that if a hardware generated error is real (i.e. the signal
235237
is not send via \funnm{kill} or similar functions), the process may never get
236238
over that error at all. It is not safe to ignore such errors, continue after
237239
returning from a handler, or mask such signals. You can catch such signals
@@ -275,8 +277,8 @@
275277
know what you are doing. For example, if a running process does not respond to
276278
user input nor any other signal. Many applications, mainly daemons, rely on the
277279
fact that they are sent \texttt{SIGTERM} on termination, which they often handle
278-
and perform pre-exit actions. For example, flushing the database, removing
279-
temporary files and file locks, etc. So, do not use \texttt{SIGKILL} right away
280+
and perform actions before exit. For example, flushing the database, removing
281+
temporary files and file locks, etc. So, do not use \texttt{SIGKILL} right away
280282
only because "it's the simplest way to kill a process" as you might run in
281283
trouble.
282284
\item Example on using \texttt{SIGQUIT} on Solaris:
@@ -356,36 +358,44 @@
356358

357359
%%%%%
358360

361+
ifdef([[[NOSPELLCHECK]]], [[[
359362
\pdfbookmark[1]{sigaction}{sigaction}
363+
]]])
360364

361365
\begin{slide}
362366
\sltitle{Setting actions for signals}
367+
ifdef([[[NOSPELLCHECK]]], [[[
363368
\begin{minipage}{\slidewidth}\vspace{-1\baselineskip}\texttt{\begin{tabbing}
364369
int \funnm{sigaction}(\=int \emph{sig},
365370
const struct sigaction *\emph{act},\\\> struct sigaction *\emph{oact});
371+
]]])
366372
\end{tabbing}}
367373
\end{minipage}
368374
\begin{itemize}
369-
\item assigns an action \emph{act} for a signal \emph{sig},
370-
previous setting is returned in \emph{oact}, if non-zero
375+
\item assigns an action \emph{\texttt{act}} for a signal \emph{\texttt{sig}},
376+
previous setting is returned in \emph{\texttt{oact}}, if non-zero
371377
\item structure \texttt{sigaction} contains:
372378
\begin{itemize}
379+
ifdef([[[NOSPELLCHECK]]], [[[
373380
\item \texttt{void (*\emph{sa\_handler})(int)} \dots{} \texttt{SIG\_DFL},
374-
\texttt{SIG\_IGN}, or a handler address (ie. a handler function name)
375-
\item \texttt{sigset\_t \emph{sa\_mask}} \dots{} signals blocked while in
376-
handler; plus \emph{sig} is blocked by default
377-
\item \texttt{int \emph{sa\_flags}} \dots{} \texttt{SA\_RESETHAND} (handler
381+
]]])
382+
\texttt{SIG\_IGN}, or a handler address (i.e. a handler function name)
383+
\item ifdef([[[NOSPELLCHECK]]], [[[\texttt{sigset\_t \emph{sa\_mask}}]]])
384+
\dots{} signals blocked while in
385+
handler; plus \emph{\texttt{sig}} is blocked by default
386+
\item ifdef([[[NOSPELLCHECK]]], [[[\texttt{int \emph{sa\_flags}}]]])
387+
\dots{} \texttt{SA\_RESETHAND} (handler
378388
is reset to \texttt{SIG\_DFL} at the moment the signal is delivered),
379389
\texttt{SA\_RESTART} (restart pending calls), \texttt{SA\_NODEFER}
380-
(do not block \emph{sig} while in handler)
390+
(do not block \emph{\texttt{sig}} while in handler)
381391
\end{itemize}
382392
\end{itemize}
383393
\end{slide}
384394

385395
\begin{itemize}
386396
\item If \texttt{act == NULL} you only get the present setting and nothing is
387397
changed. If not interested in previous setting, use \texttt{NULL} for
388-
\emph{oact}.
398+
\emph{\texttt{oact}}.
389399
\item If \texttt{SA\_RESTART} is not set, the system call interrupted by the
390400
signal will return an error with \texttt{errno} set to \texttt{EINTR} (some
391401
calls actually return directly the \texttt{errno} value but that is not relevant
@@ -400,7 +410,8 @@
400410
to make sure the signal is not delivered in the wrong time (for example, the
401411
signal is delivered within a function and the same function is called from the
402412
handler, and the function is not ready for that). Minimal set of functions
403-
that must be \emsl{\emph{async-signal-safe}} is listed in SUSv4 in section
413+
that must be ifdef([[[NOSPELLCHECK]]], [[[\emsl{\emph{async-signal-safe}}]]])
414+
is listed in SUSv4 in section
404415
\emph{System Interfaces: General Information $\Rightarrow$ Signal Concepts
405416
$\Rightarrow$ Signal Actions (2.4.3)}. Systems can extend the list, of course.
406417
Whether a function is safe to use in a signal handler or not should be
@@ -485,16 +496,20 @@
485496

486497
%%%%%
487498

499+
ifdef([[[NOSPELLCHECK]]], [[[
488500
\pdfbookmark[1]{sigprocmask, sigpending}{sigblock}
501+
]]])
489502

490503
\begin{slide}
491504
\sltitle{Signal blocking}
492505
\begin{itemize}
493506
\item blocked signals are delivered to the process after getting unblocked again
494507
\end{itemize}
495508
\begin{minipage}{\slidewidth}\texttt{\begin{tabbing}
509+
ifdef([[[NOSPELLCHECK]]], [[[
496510
int \funnm{sigprocmask}(\=int \emph{how}, const sigset\_t *\emph{set},\\
497511
\>sigset\_t *\emph{oset});
512+
]]])
498513
\end{tabbing}}
499514
\end{minipage}
500515
\begin{itemize}
@@ -506,7 +521,9 @@
506521
\funnm{sigdelset}(), \funnm{sigemptyset}(), \funnm{sigfillset}(),
507522
\funnm{sigismember}()
508523
\end{itemize}
524+
ifdef([[[NOSPELLCHECK]]], [[[
509525
\texttt{int \funnm{sigpending}(sigset\_t *\emph{set});}
526+
]]])
510527
\begin{itemize}
511528
\item returns a mask for the signals pending for delivery
512529
\end{itemize}
@@ -526,8 +543,9 @@
526543
\pageref{REALTIMEEXTENSIONS} and the use of \texttt{SA\_SIGINFO}), signals are
527544
delivered through a queue and multiple signals are never squeezed into one
528545
delivery.
529-
\item Both arguments \emph{oset} and \emph{set} may be \texttt{NULL}. If both
530-
are \texttt{NULL} in the same invocation of the function, nothing happens.
546+
\item Both arguments \emph{\texttt{oset}} and \emph{set} may be \texttt{NULL}.
547+
If both are \texttt{NULL} in the same invocation of the function, nothing
548+
happens.
531549
\end{itemize}
532550

533551
%%%%%
@@ -570,7 +588,9 @@
570588
%%%%%
571589

572590
\label{SIGWAIT}
591+
ifdef([[[NOSPELLCHECK]]], [[[
573592
\pdfbookmark[1]{pause, sigsuspend, sigwait}{sigwait}
593+
]]])
574594

575595
\begin{slide}
576596
\sltitle{Waiting for a signal}
@@ -579,14 +599,18 @@
579599
\item suspends the caller until delivery of a signal that is not blocked or
580600
ignored
581601
\end{itemize}
602+
ifdef([[[NOSPELLCHECK]]], [[[
582603
\texttt{int \funnm{sigsuspend}(const sigset\_t *\emph{sigmask});}
604+
]]])
583605
\begin{itemize}
584606
\item like \funnm{pause}(), also temporarily changes the blocked signal mask
585607
\end{itemize}
608+
ifdef([[[NOSPELLCHECK]]], [[[
586609
\texttt{int \funnm{sigwait}(const sigset\_t *\emph{set}, int *\emph{sig});}
610+
]]])
587611
\begin{itemize}
588612
\item waits for a signal from \emph{set} (must be blocked) and puts the signal
589-
number to \emph{sig}.
613+
number to \emph{\texttt{sig}}.
590614
\item the signal handler is not called
591615
\end{itemize}
592616
\end{slide}

threads.tex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@
114114
\item so you cannot use functions \funnm{perror}() or \funnm{err}()
115115
\end{itemize}
116116
\item the standard also defines other functions, for example those that could
117-
not be possible to adjust for the use with threads without changing its API (eg.
117+
not be possible to adjust for the use with threads without changing its API (e.g.
118118
\texttt{readdir\_r}, \texttt{strtok\_r}, etc.)
119119
\begin{itemize}
120-
\item \texttt{\_r} means \emph{reentrant}, ie. the function can be called by
120+
\item \texttt{\_r} means \emph{reentrant}, i.e. the function can be called by
121121
multiple threads without any side effects
122122
\end{itemize}
123123
\end{itemize}
@@ -209,7 +209,7 @@
209209
\\\>void *(*\emph{start\_fn})(void*), void *\emph{arg});}
210210
\begin{itemize}
211211
\item creates a new thread, puts its ID to \emph{thread}
212-
\item with attributes from \texttt{attr}, eg. its stack size,
212+
\item with attributes from \texttt{attr}, e.g. its stack size,
213213
\texttt{NULL} means default attributes
214214
\item function \emph{start\_fn}() will be started in the thread using argument
215215
\emph{arg}. After the function returns, the thread ceases to exist.
@@ -257,7 +257,7 @@
257257
to map to the native threads provided by the system. If you create several
258258
threads, you need to pass a different address for a \texttt{pthread\_t} variable
259259
otherwise you will not be able to further manipulate with the threads from the
260-
main thread, eg. waiting for them to finish.
260+
main thread, e.g. waiting for them to finish.
261261
\end{itemize}
262262

263263
%%%%%
@@ -350,7 +350,7 @@
350350
\item In contrast to waiting for processes to finish, \emsl{one cannot wait for
351351
any thread to finish}. The rationale is that since there is not parent--child
352352
relation, it was not deemed necessary. However, some system provide that
353-
functionality, eg. on Solaris you can use \texttt{0} for a thread ID in
353+
functionality, e.g. on Solaris you can use \texttt{0} for a thread ID in
354354
\funnm{thr\_join}(). If you needed this functionality with POSIX thread API, it
355355
is easy to set threads as \emph{detached} and use a condition variable together
356356
with a global variable. More on that on page \pageref{CONDITION_VARIABLES}.
@@ -546,7 +546,7 @@
546546
\item No cleanup routines or thread specific data destructors are called for
547547
threads not propagated to the new process.
548548
\item \label{FORKALL} Note that the way how \funnm{fork}() works also depends on
549-
the system used. For example, in Solaris before version 10 (ie. before 2005),
549+
the system used. For example, in Solaris before version 10 (i.e. before 2005),
550550
\funnm{fork}() in the \texttt{libthread} library (different from
551551
\texttt{libpthread}) was the same as \funnm{forkall}().
552552
\item Examples: \example{pthreads/fork.c},

unix_dict.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
personal_ws-1.1 en 333
1+
personal_ws-1.1 en 338
22
Illumos
33
Prog
44
Ctrl
@@ -31,6 +31,7 @@ Kernighan
3131
reentrant
3232
userland
3333
TLI
34+
RTS
3435
args
3536
FIFO
3637
argv
@@ -53,6 +54,7 @@ SunOS
5354
Gdb
5455
gdb
5556
FFS
57+
interruptible
5658
verlagen
5759
EOB
5860
programmatically
@@ -204,6 +206,7 @@ Pechanec
204206
ld
205207
jp
206208
LF
209+
mortem
207210
http
208211
li
209212
HURD
@@ -315,11 +318,13 @@ CSRG
315318
symlink's
316319
symlinks
317320
OpenBSD
321+
signalling
318322
SCO
319323
Xcurses
320324
microkernel
321325
GETFD
322326
virtualized
327+
multithreaded
323328
changequote
324329
decrement
325330
PWB

0 commit comments

Comments
 (0)