Slightly clarify explanation of WITH-ERRNO-HANDLER*.
This commit is contained in:
parent
a40ff4b314
commit
baa65dee1d
|
@ -49,7 +49,7 @@ Programs can use \ex{with-errno-handler*} to establish
|
||||||
handlers for these exceptions.
|
handlers for these exceptions.
|
||||||
|
|
||||||
If a {\Unix} error arises while \var{thunk} is executing,
|
If a {\Unix} error arises while \var{thunk} is executing,
|
||||||
\var{handler} is called on two arguments:
|
\var{handler} is called on two arguments like this:
|
||||||
\codex{(\var{handler} \var{errno} \var{packet})}
|
\codex{(\var{handler} \var{errno} \var{packet})}
|
||||||
\var{packet} is a list of the form
|
\var{packet} is a list of the form
|
||||||
$$\var{packet} = \ex{(\var{errno-msg} \var{syscall} . \var{data})},$$
|
$$\var{packet} = \ex{(\var{errno-msg} \var{syscall} . \var{data})},$$
|
||||||
|
@ -646,8 +646,8 @@ These procedures allow reading and writing of an open file's status flags
|
||||||
%
|
%
|
||||||
\begin{tabular}[t]{@{}>{\ttfamily}l@{}}
|
\begin{tabular}[t]{@{}>{\ttfamily}l@{}}
|
||||||
%% These are gettable and settable
|
%% These are gettable and settable
|
||||||
open/append \\
|
open/append \\
|
||||||
open/non-blocking \\
|
open/non-blocking \\
|
||||||
open/async \textrm{(Non-\Posix)} \\
|
open/async \textrm{(Non-\Posix)} \\
|
||||||
open/fsync \textrm{(Non-\Posix)}
|
open/fsync \textrm{(Non-\Posix)}
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
|
@ -659,9 +659,9 @@ These procedures allow reading and writing of an open file's status flags
|
||||||
%
|
%
|
||||||
\begin{tabular}[t]{@{}>{\ttfamily}l@{}}
|
\begin{tabular}[t]{@{}>{\ttfamily}l@{}}
|
||||||
%% These are gettable, not settable
|
%% These are gettable, not settable
|
||||||
open/read \\
|
open/read \\
|
||||||
open/write \\
|
open/write \\
|
||||||
open/read+write \\
|
open/read+write \\
|
||||||
open/access-mask
|
open/access-mask
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
\\\cline{2-3}
|
\\\cline{2-3}
|
||||||
|
@ -673,21 +673,21 @@ These procedures allow reading and writing of an open file's status flags
|
||||||
%
|
%
|
||||||
\begin{tabular}[t]{@{}>{\ttfamily}l@{}}
|
\begin{tabular}[t]{@{}>{\ttfamily}l@{}}
|
||||||
%% These are neither gettable nor settable.
|
%% These are neither gettable nor settable.
|
||||||
open/create \\
|
open/create \\
|
||||||
open/exclusive \\
|
open/exclusive \\
|
||||||
open/no-control-tty \\
|
open/no-control-tty \\
|
||||||
open/truncate
|
open/truncate
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{center}
|
\end{center}
|
||||||
\caption{Status flags for \texttt{open-file},
|
\caption{Status flags for \texttt{open-file},
|
||||||
\texttt{fdes-status} and \texttt{set-fdes-status}.
|
\texttt{fdes-status} and \texttt{set-fdes-status}.
|
||||||
Only {\Posix} flags are guaranteed to be present;
|
Only {\Posix} flags are guaranteed to be present;
|
||||||
your operating system may define others.
|
your operating system may define others.
|
||||||
The \texttt{open/access-mask} value is not an actual flag,
|
The \texttt{open/access-mask} value is not an actual flag,
|
||||||
but a bit mask used to select the field for the \texttt{open/read},
|
but a bit mask used to select the field for the \texttt{open/read},
|
||||||
\texttt{open/write} and \texttt{open/read+write} bits.
|
\texttt{open/write} and \texttt{open/read+write} bits.
|
||||||
}
|
}
|
||||||
\label{table:fdes-status-flags}
|
\label{table:fdes-status-flags}
|
||||||
\end{table}
|
\end{table}
|
||||||
|
|
||||||
|
@ -703,7 +703,7 @@ Returns two ports, the read and write end-points of a {\Unix} pipe.
|
||||||
|
|
||||||
\defun{read-string}{nbytes [fd/port]} {{\str} or \sharpf}
|
\defun{read-string}{nbytes [fd/port]} {{\str} or \sharpf}
|
||||||
\dfnix{read-string!} {str [fd/port start end]} {nread or \sharpf}{procedure}
|
\dfnix{read-string!} {str [fd/port start end]} {nread or \sharpf}{procedure}
|
||||||
{read-string"!@\texttt{read-string"!}}
|
{read-string"!@\texttt{read-string"!}}
|
||||||
\begin{desc}
|
\begin{desc}
|
||||||
These calls read exactly as much data as you requested, unless
|
These calls read exactly as much data as you requested, unless
|
||||||
there is not enough data (eof).
|
there is not enough data (eof).
|
||||||
|
@ -731,7 +731,7 @@ Returns two ports, the read and write end-points of a {\Unix} pipe.
|
||||||
|
|
||||||
\defun {read-string/partial} {nbytes [fd/port]} {{\str} or \sharpf}
|
\defun {read-string/partial} {nbytes [fd/port]} {{\str} or \sharpf}
|
||||||
\dfnix{read-string!/partial} {str [fd/port start end]} {nread or \sharpf}
|
\dfnix{read-string!/partial} {str [fd/port start end]} {nread or \sharpf}
|
||||||
{procedure}{read-string"!/partial@\texttt{read-string"!/partial}}
|
{procedure}{read-string"!/partial@\texttt{read-string"!/partial}}
|
||||||
\begin{desc}
|
\begin{desc}
|
||||||
%
|
%
|
||||||
These are atomic best-effort/forward-progress calls.
|
These are atomic best-effort/forward-progress calls.
|
||||||
|
@ -816,7 +816,7 @@ allowed to contain {\sharpf} values as well as integers and ports.
|
||||||
|
|
||||||
\remark{I have found the \ex{select!} interface to be the more
|
\remark{I have found the \ex{select!} interface to be the more
|
||||||
useful of the two. After the system call, it allows you
|
useful of the two. After the system call, it allows you
|
||||||
to check a specific I/O channel in constant time.}
|
to check a specific I/O channel in constant time.}
|
||||||
\end{desc}
|
\end{desc}
|
||||||
|
|
||||||
|
|
||||||
|
@ -901,13 +901,13 @@ This procedure allows the programmer to assign a particular I/O buffering
|
||||||
policy to a port, and to choose the size of the associated buffer.
|
policy to a port, and to choose the size of the associated buffer.
|
||||||
It may only be used on new ports, \ie, before I/O is performed on the port.
|
It may only be used on new ports, \ie, before I/O is performed on the port.
|
||||||
There are three buffering policies that may be chosen:
|
There are three buffering policies that may be chosen:
|
||||||
\begin{inset}
|
\begin{inset}
|
||||||
\begin{tabular}{l@{\qquad}l}
|
\begin{tabular}{l@{\qquad}l}
|
||||||
\ex{bufpol/block} & General block buffering (general default) \\
|
\ex{bufpol/block} & General block buffering (general default) \\
|
||||||
\ex{bufpol/line} & Line buffering (tty default) \\
|
\ex{bufpol/line} & Line buffering (tty default) \\
|
||||||
\ex{bufpol/none} & Direct I/O---no buffering
|
\ex{bufpol/none} & Direct I/O---no buffering
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{inset}
|
\end{inset}
|
||||||
The line buffering policy flushes output whenever a newline is output;
|
The line buffering policy flushes output whenever a newline is output;
|
||||||
whenever the buffer is full; or whenever an input is read from stdin.
|
whenever the buffer is full; or whenever an input is read from stdin.
|
||||||
Line buffering is the default for ports open on terminal devices.
|
Line buffering is the default for ports open on terminal devices.
|
||||||
|
@ -1237,12 +1237,12 @@ Example:
|
||||||
|
|
||||||
\remark{\ex{file-info} was named \ex{file-attributes} in releases of scsh
|
\remark{\ex{file-info} was named \ex{file-attributes} in releases of scsh
|
||||||
prior to release 0.4. We changed the name to \ex{file-info} for
|
prior to release 0.4. We changed the name to \ex{file-info} for
|
||||||
consistency with the other information-retrieval procedures in
|
consistency with the other information-retrieval procedures in
|
||||||
scsh: \ex{user-info}, \ex{group-info}, \ex{host-info},
|
scsh: \ex{user-info}, \ex{group-info}, \ex{host-info},
|
||||||
\ex{network-info }, \ex{service-info}, and \ex{protocol-info}.
|
\ex{network-info }, \ex{service-info}, and \ex{protocol-info}.
|
||||||
|
|
||||||
The \ex{file-attributes} binding is still supported in the current
|
The \ex{file-attributes} binding is still supported in the current
|
||||||
release of scsh, but is deprecated, and may go away in a future
|
release of scsh, but is deprecated, and may go away in a future
|
||||||
release.}
|
release.}
|
||||||
\end{defundesc}
|
\end{defundesc}
|
||||||
|
|
||||||
|
@ -1460,10 +1460,10 @@ All wild-card characters in \var{str} are quoted with a backslash.
|
||||||
|
|
||||||
\begin{defundesc}{file-match}{root dot-files? \vari{pat}1 \vari{pat}2 {\ldots} \vari{pat}n}{string list}
|
\begin{defundesc}{file-match}{root dot-files? \vari{pat}1 \vari{pat}2 {\ldots} \vari{pat}n}{string list}
|
||||||
\note{This procedure is deprecated, and will probably either go away or
|
\note{This procedure is deprecated, and will probably either go away or
|
||||||
be substantially altered in a future release. New code should not
|
be substantially altered in a future release. New code should not
|
||||||
call this procedure. The problem is that it relies upon
|
call this procedure. The problem is that it relies upon
|
||||||
Posix-notation regular expressions; the rest of scsh has been
|
Posix-notation regular expressions; the rest of scsh has been
|
||||||
converted over to the new SRE notation.}
|
converted over to the new SRE notation.}
|
||||||
|
|
||||||
\ex{file-match} provides a more powerful file-matching service, at the
|
\ex{file-match} provides a more powerful file-matching service, at the
|
||||||
expense of a less convenient notation. It is intermediate in
|
expense of a less convenient notation. It is intermediate in
|
||||||
|
@ -1869,7 +1869,7 @@ Suspend the current process with a SIGSTOP signal.
|
||||||
(display "Hello, world.\\n"))))
|
(display "Hello, world.\\n"))))
|
||||||
|
|
||||||
(set-current-input-port! (fdes->inport 0)
|
(set-current-input-port! (fdes->inport 0)
|
||||||
(read-line) ; Read the string output by the child.\end{code}
|
(read-line) ; Read the string output by the child.\end{code}
|
||||||
None of this is necessary when the I/O is performed by an exec'd
|
None of this is necessary when the I/O is performed by an exec'd
|
||||||
program in the child or parent process, only when the pipe will
|
program in the child or parent process, only when the pipe will
|
||||||
be referenced by Scheme code through one of the default current I/O
|
be referenced by Scheme code through one of the default current I/O
|
||||||
|
@ -1893,7 +1893,7 @@ They are created by the \ex{fork} procedure, and have the following
|
||||||
exposed structure:
|
exposed structure:
|
||||||
\begin{code}
|
\begin{code}
|
||||||
(define-record proc
|
(define-record proc
|
||||||
pid)\end{code}
|
pid)\end{code}
|
||||||
\index{proc}\index{proc?}\index{proc:pid}
|
\index{proc}\index{proc?}\index{proc:pid}
|
||||||
The only exposed slot in a proc record is the process' pid,
|
The only exposed slot in a proc record is the process' pid,
|
||||||
the integer id assigned by Unix to the process.
|
the integer id assigned by Unix to the process.
|
||||||
|
@ -1911,10 +1911,10 @@ If there is no process object in the system indexed by the given pid,
|
||||||
\begin{center}
|
\begin{center}
|
||||||
\begin{tabular}{|l|l|}
|
\begin{tabular}{|l|l|}
|
||||||
\hline
|
\hline
|
||||||
\var{probe?} & Return \\ \hline\hline
|
\var{probe?} & Return \\ \hline\hline
|
||||||
\sharpf & \emph{signal error condition.} \\ \hline
|
\sharpf & \emph{signal error condition.} \\ \hline
|
||||||
\ex{'create} & Create new proc object. \\ \hline
|
\ex{'create} & Create new proc object. \\ \hline
|
||||||
True value & \sharpf \\ \hline
|
True value & \sharpf \\ \hline
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{center}
|
\end{center}
|
||||||
\end{defundesc}
|
\end{defundesc}
|
||||||
|
@ -1970,29 +1970,29 @@ The policy is determined by applying this procedure to one of the
|
||||||
values \ex{'early}, \ex{'late}, or {\sharpf} (\ie, no autoreap).
|
values \ex{'early}, \ex{'late}, or {\sharpf} (\ie, no autoreap).
|
||||||
\begin{description}
|
\begin{description}
|
||||||
\item [early]
|
\item [early]
|
||||||
The child is reaped from the {\Unix} kernel's process table
|
The child is reaped from the {\Unix} kernel's process table
|
||||||
into scsh as soon as it dies. This is done by having a
|
into scsh as soon as it dies. This is done by having a
|
||||||
signal handler for the \ex{SIGCHLD} signal reap the process.
|
signal handler for the \ex{SIGCHLD} signal reap the process.
|
||||||
\emph{
|
\emph{
|
||||||
If a scsh program sets its own handler for the \ex{SIGCHLD}
|
If a scsh program sets its own handler for the \ex{SIGCHLD}
|
||||||
signal, the handler must reap dead children
|
signal, the handler must reap dead children
|
||||||
by calling \ex{wait}, \ex{wait-any}, or \ex{reap-zombies}.}
|
by calling \ex{wait}, \ex{wait-any}, or \ex{reap-zombies}.}
|
||||||
We deprecate interrupt-driven code, and hope to provide
|
We deprecate interrupt-driven code, and hope to provide
|
||||||
alternative tools in a future, multi-threaded release of scsh.
|
alternative tools in a future, multi-threaded release of scsh.
|
||||||
|
|
||||||
\item [late]
|
\item [late]
|
||||||
The child is not autoreaped until it dies \emph{and} the scsh program
|
The child is not autoreaped until it dies \emph{and} the scsh program
|
||||||
drops all pointers to its process object. That is, the process
|
drops all pointers to its process object. That is, the process
|
||||||
table is cleaned out during garbage collection.
|
table is cleaned out during garbage collection.
|
||||||
\oops{The \ex{late} policy is not supported under the current
|
\oops{The \ex{late} policy is not supported under the current
|
||||||
release of scsh. It requires more sophisticated gc hooks than
|
release of scsh. It requires more sophisticated gc hooks than
|
||||||
we can get from the release of {\scm} that we use.}
|
we can get from the release of {\scm} that we use.}
|
||||||
|
|
||||||
\item [\sharpf]
|
\item [\sharpf]
|
||||||
If autoreaping is turned off, process reaping is completely under
|
If autoreaping is turned off, process reaping is completely under
|
||||||
control of the programmer, who can force outstanding zombies to
|
control of the programmer, who can force outstanding zombies to
|
||||||
be reaped by manually calling the \ex{reap-zombies} procedure
|
be reaped by manually calling the \ex{reap-zombies} procedure
|
||||||
(see below).
|
(see below).
|
||||||
\end{description}
|
\end{description}
|
||||||
Note that under any of the autoreap policies, a particular process $p$ can
|
Note that under any of the autoreap policies, a particular process $p$ can
|
||||||
be manually reaped into scsh by simply calling \ex{(wait $p$)}.
|
be manually reaped into scsh by simply calling \ex{(wait $p$)}.
|
||||||
|
@ -2072,34 +2072,34 @@ forms, or use \ex{wait-any} to wait for the children to exit.
|
||||||
The \var{flags} argument is an integer whose bits specify
|
The \var{flags} argument is an integer whose bits specify
|
||||||
additional options. It is composed by or'ing together the following
|
additional options. It is composed by or'ing together the following
|
||||||
flags:
|
flags:
|
||||||
\begin{center}
|
\begin{center}
|
||||||
\begin{tabular}{|l|l|}
|
\begin{tabular}{|l|l|}
|
||||||
\hline
|
\hline
|
||||||
Flag & Meaning \\ \hline \hline
|
Flag & Meaning \\ \hline \hline
|
||||||
\ex{wait/poll} & Return {\sharpf} immediately if
|
\ex{wait/poll} & Return {\sharpf} immediately if
|
||||||
child still active. \\ \hline
|
child still active. \\ \hline
|
||||||
\ex{wait/stopped-children} & Wait for suspend as well as exit. \\ \hline
|
\ex{wait/stopped-children} & Wait for suspend as well as exit. \\ \hline
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{center}
|
\end{center}
|
||||||
\end{desc}
|
\end{desc}
|
||||||
|
|
||||||
\begin{defundesc} {wait-any} {[flags]} {[proc status]}
|
\begin{defundesc} {wait-any} {[flags]} {[proc status]}
|
||||||
The optional \var{flags} argument is as for \ex{wait}.
|
The optional \var{flags} argument is as for \ex{wait}.
|
||||||
This procedure waits for any child process to exit (or stop, if the
|
This procedure waits for any child process to exit (or stop, if the
|
||||||
\ex{wait/stopped-children} flag is used)
|
\ex{wait/stopped-children} flag is used)
|
||||||
It returns the process' process object and status code.
|
It returns the process' process object and status code.
|
||||||
If there are no children left for which to wait, the two values
|
If there are no children left for which to wait, the two values
|
||||||
\ex{[{\sharpf} {\sharpt}]} are returned.
|
\ex{[{\sharpf} {\sharpt}]} are returned.
|
||||||
If the \ex{wait/poll} flag is used, and none of the children
|
If the \ex{wait/poll} flag is used, and none of the children
|
||||||
are immediately eligble for waiting,
|
are immediately eligble for waiting,
|
||||||
then the values \ex{[{\sharpf} {\sharpf}]} are returned:
|
then the values \ex{[{\sharpf} {\sharpf}]} are returned:
|
||||||
\begin{center}
|
\begin{center}
|
||||||
\begin{tabular}{|l|l|}
|
\begin{tabular}{|l|l|}
|
||||||
\hline
|
\hline
|
||||||
[{\sharpf} {\sharpf}] & Poll, none ready \\ \hline
|
[{\sharpf} {\sharpf}] & Poll, none ready \\ \hline
|
||||||
[{\sharpf} {\sharpt}] & No children \\ \hline
|
[{\sharpf} {\sharpt}] & No children \\ \hline
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{center}
|
\end{center}
|
||||||
|
|
||||||
\ex{Wait-any} will not return a process that has been previously waited
|
\ex{Wait-any} will not return a process that has been previously waited
|
||||||
by any other process-wait procedure (\ex{wait}, \ex{wait-any},
|
by any other process-wait procedure (\ex{wait}, \ex{wait-any},
|
||||||
|
@ -2167,7 +2167,7 @@ Otherwise, this function returns false.
|
||||||
%This procedure, ported from early T implementations,
|
%This procedure, ported from early T implementations,
|
||||||
%returns true iff \ex{(\var{proc})} returns at all.
|
%returns true iff \ex{(\var{proc})} returns at all.
|
||||||
%\remark{The current implementation is a constant function returning {\sharpt},
|
%\remark{The current implementation is a constant function returning {\sharpt},
|
||||||
% which suffices for all {\Unix} implementations of which we are aware.}
|
% which suffices for all {\Unix} implementations of which we are aware.}
|
||||||
%\end{desc}
|
%\end{desc}
|
||||||
|
|
||||||
\section{Process state}
|
\section{Process state}
|
||||||
|
@ -2453,39 +2453,39 @@ asynchronous {\Unix} signals (table~\ref{table:signals-and-interrupts}).
|
||||||
\begin{tabular}{lll}\hline
|
\begin{tabular}{lll}\hline
|
||||||
Interrupt & Unix signal & OS Variant \\ \hline\hline
|
Interrupt & Unix signal & OS Variant \\ \hline\hline
|
||||||
\kwd{interrupt/alrm}\footnote{Also bound to {\scm} interrupt
|
\kwd{interrupt/alrm}\footnote{Also bound to {\scm} interrupt
|
||||||
\kwd{interrupt/alarm}.}
|
\kwd{interrupt/alarm}.}
|
||||||
& \kwd{signal/alrm} & \Posix \\
|
& \kwd{signal/alrm} & \Posix \\
|
||||||
%
|
%
|
||||||
\kwd{interrupt/int}\footnote{Also bound to {\scm} interrupt
|
\kwd{interrupt/int}\footnote{Also bound to {\scm} interrupt
|
||||||
\kwd{interrupt/keyboard}.}
|
\kwd{interrupt/keyboard}.}
|
||||||
& \kwd{signal/int} & \Posix \\
|
& \kwd{signal/int} & \Posix \\
|
||||||
%
|
%
|
||||||
\kwd{interrupt/memory-shortage} & N/A & \\
|
\kwd{interrupt/memory-shortage} & N/A & \\
|
||||||
\kwd{interrupt/chld} & \kwd{signal/chld} & \Posix \\
|
\kwd{interrupt/chld} & \kwd{signal/chld} & \Posix \\
|
||||||
\kwd{interrupt/cont} & \kwd{signal/cont} & \Posix \\
|
\kwd{interrupt/cont} & \kwd{signal/cont} & \Posix \\
|
||||||
\kwd{interrupt/hup} & \kwd{signal/hup} & \Posix \\
|
\kwd{interrupt/hup} & \kwd{signal/hup} & \Posix \\
|
||||||
\kwd{interrupt/quit} & \kwd{signal/quit} & \Posix \\
|
\kwd{interrupt/quit} & \kwd{signal/quit} & \Posix \\
|
||||||
\kwd{interrupt/term} & \kwd{signal/term} & \Posix \\
|
\kwd{interrupt/term} & \kwd{signal/term} & \Posix \\
|
||||||
\kwd{interrupt/tstp} & \kwd{signal/tstp} & \Posix \\
|
\kwd{interrupt/tstp} & \kwd{signal/tstp} & \Posix \\
|
||||||
\kwd{interrupt/usr1} & \kwd{signal/usr1} & \Posix \\
|
\kwd{interrupt/usr1} & \kwd{signal/usr1} & \Posix \\
|
||||||
\kwd{interrupt/usr2} & \kwd{signal/usr2} & \Posix \\
|
\kwd{interrupt/usr2} & \kwd{signal/usr2} & \Posix \\
|
||||||
\\
|
\\
|
||||||
\kwd{interrupt/info} & \kwd{signal/info} & BSD only \\
|
\kwd{interrupt/info} & \kwd{signal/info} & BSD only \\
|
||||||
\kwd{interrupt/io} & \kwd{signal/io} & BSD + SVR4 \\
|
\kwd{interrupt/io} & \kwd{signal/io} & BSD + SVR4 \\
|
||||||
\kwd{interrupt/poll} & \kwd{signal/poll} & SVR4 only \\
|
\kwd{interrupt/poll} & \kwd{signal/poll} & SVR4 only \\
|
||||||
\kwd{interrupt/prof} & \kwd{signal/prof} & BSD + SVR4 \\
|
\kwd{interrupt/prof} & \kwd{signal/prof} & BSD + SVR4 \\
|
||||||
\kwd{interrupt/pwr} & \kwd{signal/pwr} & SVR4 only \\
|
\kwd{interrupt/pwr} & \kwd{signal/pwr} & SVR4 only \\
|
||||||
\kwd{interrupt/urg} & \kwd{signal/urg} & BSD + SVR4 \\
|
\kwd{interrupt/urg} & \kwd{signal/urg} & BSD + SVR4 \\
|
||||||
\kwd{interrupt/vtalrm} & \kwd{signal/vtalrm} & BSD + SVR4 \\
|
\kwd{interrupt/vtalrm} & \kwd{signal/vtalrm} & BSD + SVR4 \\
|
||||||
\kwd{interrupt/winch} & \kwd{signal/winch} & BSD + SVR4 \\
|
\kwd{interrupt/winch} & \kwd{signal/winch} & BSD + SVR4 \\
|
||||||
\kwd{interrupt/xcpu} & \kwd{signal/xcpu} & BSD + SVR4 \\
|
\kwd{interrupt/xcpu} & \kwd{signal/xcpu} & BSD + SVR4 \\
|
||||||
\kwd{interrupt/xfsz} & \kwd{signal/xfsz} & BSD + SVR4 \\
|
\kwd{interrupt/xfsz} & \kwd{signal/xfsz} & BSD + SVR4 \\
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{center}
|
\end{center}
|
||||||
\caption{{\scm} virtual-machine interrupts and related {\Unix} signals.
|
\caption{{\scm} virtual-machine interrupts and related {\Unix} signals.
|
||||||
Only the {\Posix} signals are guaranteed to be defined; however,
|
Only the {\Posix} signals are guaranteed to be defined; however,
|
||||||
your implementation and OS may define other signals and
|
your implementation and OS may define other signals and
|
||||||
interrupts not listed here.}
|
interrupts not listed here.}
|
||||||
\end{minipage}
|
\end{minipage}
|
||||||
\label{table:signals-and-interrupts}
|
\label{table:signals-and-interrupts}
|
||||||
\end{table}
|
\end{table}
|
||||||
|
@ -2495,31 +2495,31 @@ Interrupt & Unix signal & OS Variant \\ \hline\hline
|
||||||
\begin{center}
|
\begin{center}
|
||||||
\begin{tabular}{lll}\hline
|
\begin{tabular}{lll}\hline
|
||||||
Unix signal & Type & OS Variant \\ \hline\hline
|
Unix signal & Type & OS Variant \\ \hline\hline
|
||||||
\kwd{signal/stop} & Uncatchable & \Posix \\
|
\kwd{signal/stop} & Uncatchable & \Posix \\
|
||||||
\kwd{signal/kill} & Uncatchable & \Posix \\
|
\kwd{signal/kill} & Uncatchable & \Posix \\
|
||||||
\\
|
\\
|
||||||
\kwd{signal/abrt} & Synchronous & \Posix \\
|
\kwd{signal/abrt} & Synchronous & \Posix \\
|
||||||
\kwd{signal/fpe} & Synchronous & \Posix \\
|
\kwd{signal/fpe} & Synchronous & \Posix \\
|
||||||
\kwd{signal/ill} & Synchronous & \Posix \\
|
\kwd{signal/ill} & Synchronous & \Posix \\
|
||||||
\kwd{signal/pipe} & Synchronous & \Posix \\
|
\kwd{signal/pipe} & Synchronous & \Posix \\
|
||||||
\kwd{signal/segv} & Synchronous & \Posix \\
|
\kwd{signal/segv} & Synchronous & \Posix \\
|
||||||
\kwd{signal/ttin} & Synchronous & \Posix \\
|
\kwd{signal/ttin} & Synchronous & \Posix \\
|
||||||
\kwd{signal/ttou} & Synchronous & \Posix \\
|
\kwd{signal/ttou} & Synchronous & \Posix \\
|
||||||
\\
|
\\
|
||||||
\kwd{signal/bus} & Synchronous & BSD + SVR4 \\
|
\kwd{signal/bus} & Synchronous & BSD + SVR4 \\
|
||||||
\kwd{signal/emt} & Synchronous & BSD + SVR4 \\
|
\kwd{signal/emt} & Synchronous & BSD + SVR4 \\
|
||||||
\kwd{signal/iot} & Synchronous & BSD + SVR4 \\
|
\kwd{signal/iot} & Synchronous & BSD + SVR4 \\
|
||||||
\kwd{signal/sys} & Synchronous & BSD + SVR4 \\
|
\kwd{signal/sys} & Synchronous & BSD + SVR4 \\
|
||||||
\kwd{signal/trap} & Synchronous & BSD + SVR4 \\
|
\kwd{signal/trap} & Synchronous & BSD + SVR4 \\
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{center}
|
\end{center}
|
||||||
\caption{Uncatchable and synchronous {\Unix} signals. While these signals
|
\caption{Uncatchable and synchronous {\Unix} signals. While these signals
|
||||||
may be sent with \texttt{signal-process} or
|
may be sent with \texttt{signal-process} or
|
||||||
\texttt{signal-process-group},
|
\texttt{signal-process-group},
|
||||||
there are no corresponding scsh interrupt handlers.
|
there are no corresponding scsh interrupt handlers.
|
||||||
Only the {\Posix} signals are guaranteed to be defined; however,
|
Only the {\Posix} signals are guaranteed to be defined; however,
|
||||||
your implementation and OS may define other signals not listed
|
your implementation and OS may define other signals not listed
|
||||||
here.}
|
here.}
|
||||||
\label{table:uncatchable-signals}
|
\label{table:uncatchable-signals}
|
||||||
\end{table}
|
\end{table}
|
||||||
Note that scsh does \emph{not} support signal handlers for ``synchronous''
|
Note that scsh does \emph{not} support signal handlers for ``synchronous''
|
||||||
|
@ -2604,8 +2604,8 @@ A handler is either \ex{\#f} (ignore), \ex{\#t} (default), or a
|
||||||
procedure taking an integer argument.
|
procedure taking an integer argument.
|
||||||
\end{defundesc}
|
\end{defundesc}
|
||||||
|
|
||||||
% %set-unix-signal-handler
|
% %set-unix-signal-handler
|
||||||
% %unix-signal-handler
|
% %unix-signal-handler
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
\section{Time}
|
\section{Time}
|
||||||
|
@ -2714,13 +2714,13 @@ This is described for each procedure below.
|
||||||
can be one of:
|
can be one of:
|
||||||
\begin{inset}
|
\begin{inset}
|
||||||
\begin{tabular}{lp{0.7\linewidth}}
|
\begin{tabular}{lp{0.7\linewidth}}
|
||||||
\ex{\#f} & Local time \\
|
\ex{\#f} & Local time \\
|
||||||
Integer & Seconds of offset from UTC. For example,
|
Integer & Seconds of offset from UTC. For example,
|
||||||
New York City is -18000 (-5 hours), San Francisco
|
New York City is -18000 (-5 hours), San Francisco
|
||||||
is -28800 (-8 hours). \\
|
is -28800 (-8 hours). \\
|
||||||
String & A {\Posix} time zone string understood by the OS
|
String & A {\Posix} time zone string understood by the OS
|
||||||
(\ie., the sort of time zone assigned to the \ex{\$TZ}
|
(\ie., the sort of time zone assigned to the \ex{\$TZ}
|
||||||
environment variable).
|
environment variable).
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{inset}
|
\end{inset}
|
||||||
An integer time zone gives the number of seconds you must add to UTC
|
An integer time zone gives the number of seconds you must add to UTC
|
||||||
|
@ -2750,25 +2750,25 @@ String & A {\Posix} time zone string understood by the OS
|
||||||
is always 0, and \ex{(ticks/sec)} returns 1.
|
is always 0, and \ex{(ticks/sec)} returns 1.
|
||||||
|
|
||||||
\begin{remarkenv}
|
\begin{remarkenv}
|
||||||
I chose to represent system clock resolution as ticks/sec
|
I chose to represent system clock resolution as ticks/sec
|
||||||
instead of sec/tick to increase the odds that the value could
|
instead of sec/tick to increase the odds that the value could
|
||||||
be represented as an exact integer, increasing efficiency and
|
be represented as an exact integer, increasing efficiency and
|
||||||
making it easier for Scheme implementations that don't have
|
making it easier for Scheme implementations that don't have
|
||||||
sophisticated numeric support to deal with the quantity.
|
sophisticated numeric support to deal with the quantity.
|
||||||
|
|
||||||
You can convert seconds and ticks to seconds with the expression
|
You can convert seconds and ticks to seconds with the expression
|
||||||
\codex{(+ \var{secs} (/ \var{ticks} (ticks/sec)))}
|
\codex{(+ \var{secs} (/ \var{ticks} (ticks/sec)))}
|
||||||
Given that, why not have the fine-grain time procedure just
|
Given that, why not have the fine-grain time procedure just
|
||||||
return a non-integer real for time? Following Common Lisp, I chose to
|
return a non-integer real for time? Following Common Lisp, I chose to
|
||||||
allow the system clock to report sub-second time in its own units to
|
allow the system clock to report sub-second time in its own units to
|
||||||
lower the overhead of determining the time. This would be important
|
lower the overhead of determining the time. This would be important
|
||||||
for a system that wanted to precisely time the duration of some
|
for a system that wanted to precisely time the duration of some
|
||||||
event. Time stamps could be collected with little overhead, deferring
|
event. Time stamps could be collected with little overhead, deferring
|
||||||
the overhead of precisely calculating with them until after collection.
|
the overhead of precisely calculating with them until after collection.
|
||||||
|
|
||||||
This is all a bit academic for the {\scm} implementation, where
|
This is all a bit academic for the {\scm} implementation, where
|
||||||
we determine time with a heavyweight system call, but it's nice
|
we determine time with a heavyweight system call, but it's nice
|
||||||
to plan for the future.
|
to plan for the future.
|
||||||
\end{remarkenv}
|
\end{remarkenv}
|
||||||
\end{desc}
|
\end{desc}
|
||||||
|
|
||||||
|
@ -2792,8 +2792,8 @@ String & A {\Posix} time zone string understood by the OS
|
||||||
is also a legal return value (for date 23:59:59 UCT, 12/31/1969).
|
is also a legal return value (for date 23:59:59 UCT, 12/31/1969).
|
||||||
Scsh resolves the ambiguity in a paranoid fashion: it always
|
Scsh resolves the ambiguity in a paranoid fashion: it always
|
||||||
reports an error if the underlying Unix facility returns -1.
|
reports an error if the underlying Unix facility returns -1.
|
||||||
We feel your pain.
|
We feel your pain.
|
||||||
}
|
}
|
||||||
\end{desc}
|
\end{desc}
|
||||||
|
|
||||||
\defun {time} {} \integer
|
\defun {time} {} \integer
|
||||||
|
@ -2815,8 +2815,8 @@ String & A {\Posix} time zone string understood by the OS
|
||||||
\ex{summer?} field is used to resolve ambiguities:
|
\ex{summer?} field is used to resolve ambiguities:
|
||||||
\begin{tightinset}
|
\begin{tightinset}
|
||||||
\begin{tabular}{ll}
|
\begin{tabular}{ll}
|
||||||
\ex{\#f} & Resolve an ambiguous time in favor of non-summer time. \\
|
\ex{\#f} & Resolve an ambiguous time in favor of non-summer time. \\
|
||||||
true & Resolve an ambiguous time in favor of summer time.
|
true & Resolve an ambiguous time in favor of summer time.
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{tightinset}
|
\end{tightinset}
|
||||||
This is useful in boundary cases during the change-over. For example,
|
This is useful in boundary cases during the change-over. For example,
|
||||||
|
@ -2858,28 +2858,28 @@ true & Resolve an ambiguous time in favor of summer time.
|
||||||
\verb|~b| & abbreviated month name \\
|
\verb|~b| & abbreviated month name \\
|
||||||
\verb|~B| & full month name \\
|
\verb|~B| & full month name \\
|
||||||
\verb|~c| & time and date using the time and date representation
|
\verb|~c| & time and date using the time and date representation
|
||||||
for the locale (\verb|~X ~x|) \\
|
for the locale (\verb|~X ~x|) \\
|
||||||
\verb|~d| & day of the month as a decimal number (01-31) \\
|
\verb|~d| & day of the month as a decimal number (01-31) \\
|
||||||
\verb|~H| & hour based on a 24-hour clock
|
\verb|~H| & hour based on a 24-hour clock
|
||||||
as a decimal number (00-23) \\
|
as a decimal number (00-23) \\
|
||||||
\verb|~I| & hour based on a 12-hour clock
|
\verb|~I| & hour based on a 12-hour clock
|
||||||
as a decimal number (01-12) \\
|
as a decimal number (01-12) \\
|
||||||
\verb|~j| & day of the year as a decimal number (001-366) \\
|
\verb|~j| & day of the year as a decimal number (001-366) \\
|
||||||
\verb|~m| & month as a decimal number (01-12) \\
|
\verb|~m| & month as a decimal number (01-12) \\
|
||||||
\verb|~M| & minute as a decimal number (00-59) \\
|
\verb|~M| & minute as a decimal number (00-59) \\
|
||||||
\verb|~p| & AM/PM designation associated with a 12-hour clock \\
|
\verb|~p| & AM/PM designation associated with a 12-hour clock \\
|
||||||
\verb|~S| & second as a decimal number (00-61) \\
|
\verb|~S| & second as a decimal number (00-61) \\
|
||||||
\verb|~U| & week number of the year;
|
\verb|~U| & week number of the year;
|
||||||
Sunday is first day of week (00-53) \\
|
Sunday is first day of week (00-53) \\
|
||||||
\verb|~w| & weekday as a decimal number (0-6), where Sunday is 0 \\
|
\verb|~w| & weekday as a decimal number (0-6), where Sunday is 0 \\
|
||||||
\verb|~W| & week number of the year;
|
\verb|~W| & week number of the year;
|
||||||
Monday is first day of week (00-53) \\
|
Monday is first day of week (00-53) \\
|
||||||
\verb|~x| & date using the date representation for the locale \\
|
\verb|~x| & date using the date representation for the locale \\
|
||||||
\verb|~X| & time using the time representation for the locale \\
|
\verb|~X| & time using the time representation for the locale \\
|
||||||
\verb|~y| & year without century (00-99) \\
|
\verb|~y| & year without century (00-99) \\
|
||||||
\verb|~Y| & year with century (\eg 1990) \\
|
\verb|~Y| & year with century (\eg 1990) \\
|
||||||
\verb|~Z| & time zone name or abbreviation, or no characters
|
\verb|~Z| & time zone name or abbreviation, or no characters
|
||||||
if no time zone is determinable
|
if no time zone is determinable
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
|
|
||||||
\caption{\texttt{format-date} conversion specifiers}
|
\caption{\texttt{format-date} conversion specifiers}
|
||||||
|
@ -2909,10 +2909,10 @@ true & Resolve an ambiguous time in favor of summer time.
|
||||||
% (\eg, ``EST'' and ``EDT'')\@. \var{Summer?} is interpreted as follows:
|
% (\eg, ``EST'' and ``EDT'')\@. \var{Summer?} is interpreted as follows:
|
||||||
% \begin{inset}
|
% \begin{inset}
|
||||||
% \begin{tabular}{lp{0.7\linewidth}}
|
% \begin{tabular}{lp{0.7\linewidth}}
|
||||||
% Integer & A time value.
|
% Integer & A time value.
|
||||||
% The variant in use at that time is returned. \\
|
% The variant in use at that time is returned. \\
|
||||||
% \ex{\#f} & The standard time name is returned. \\
|
% \ex{\#f} & The standard time name is returned. \\
|
||||||
% \emph{Otherwise} & The summer time name is returned.
|
% \emph{Otherwise} & The summer time name is returned.
|
||||||
% \end{tabular}
|
% \end{tabular}
|
||||||
% \end{inset}
|
% \end{inset}
|
||||||
% \ex{Summer?} defaults to the case that pertains at the time of the call.
|
% \ex{Summer?} defaults to the case that pertains at the time of the call.
|
||||||
|
@ -2920,7 +2920,7 @@ true & Resolve an ambiguous time in favor of summer time.
|
||||||
%\end{desc}
|
%\end{desc}
|
||||||
|
|
||||||
\dfni {fill-in-date!}{date}{date}{procedure}
|
\dfni {fill-in-date!}{date}{date}{procedure}
|
||||||
{fill-in-date"!@\texttt{fill-in-date"!}}
|
{fill-in-date"!@\texttt{fill-in-date"!}}
|
||||||
\begin{desc}
|
\begin{desc}
|
||||||
This procedure fills in missing, redundant slots in a date record.
|
This procedure fills in missing, redundant slots in a date record.
|
||||||
In decreasing order of priority:
|
In decreasing order of priority:
|
||||||
|
@ -3111,8 +3111,8 @@ once they have been parsed from their colon-separated form.
|
||||||
|
|
||||||
%\remark{An earlier release of scsh provided the \ex{split-colon-list}
|
%\remark{An earlier release of scsh provided the \ex{split-colon-list}
|
||||||
% and \ex{string-list->colon-list} functions. These have been
|
% and \ex{string-list->colon-list} functions. These have been
|
||||||
% removed from scsh, and are replaced by the more general
|
% removed from scsh, and are replaced by the more general
|
||||||
% parsers and unparsers of the field-reader module.}
|
% parsers and unparsers of the field-reader module.}
|
||||||
%
|
%
|
||||||
%\defun {split-colon-list} {string} {{\str} list}
|
%\defun {split-colon-list} {string} {{\str} list}
|
||||||
%\defunx {string-list->colon-list} {string-list} \str
|
%\defunx {string-list->colon-list} {string-list} \str
|
||||||
|
|
Loading…
Reference in New Issue