mirror of
https://github.com/python/cpython.git
synced 2025-11-03 11:23:31 +00:00
Logical markup.
This commit is contained in:
parent
295eaa84b0
commit
60ba44750f
2 changed files with 62 additions and 62 deletions
|
|
@ -20,7 +20,7 @@ A single exception is defined for errors:
|
||||||
|
|
||||||
\subsection{Resource Limits}
|
\subsection{Resource Limits}
|
||||||
|
|
||||||
Resources usage can be limited using the \code{setrlimit()} function
|
Resources usage can be limited using the \function{setrlimit()} function
|
||||||
described below. Each resource is controlled by a pair of limits: a
|
described below. Each resource is controlled by a pair of limits: a
|
||||||
soft limit and a hard limit. The soft limit is the current limit, and
|
soft limit and a hard limit. The soft limit is the current limit, and
|
||||||
may be lowered or raised by a process over time. The soft limit can
|
may be lowered or raised by a process over time. The soft limit can
|
||||||
|
|
@ -29,15 +29,15 @@ value greater than the soft limit, but not raised. (Only processes with
|
||||||
the effective UID of the super-user can raise a hard limit.)
|
the effective UID of the super-user can raise a hard limit.)
|
||||||
|
|
||||||
The specific resources that can be limited are system dependent. They
|
The specific resources that can be limited are system dependent. They
|
||||||
are described in the \code{getrlimit()} man page. The resources
|
are described in the \manpage{getrlimit}{2} man page. The resources
|
||||||
listed below are supported when the underlying operating system
|
listed below are supported when the underlying operating system
|
||||||
supports them; resources which cannot be checked or controlled by the
|
supports them; resources which cannot be checked or controlled by the
|
||||||
operating system are not defined in this module for those platforms.
|
operating system are not defined in this module for those platforms.
|
||||||
|
|
||||||
\begin{funcdesc}{getrlimit}{resource}
|
\begin{funcdesc}{getrlimit}{resource}
|
||||||
Returns a tuple \code{(\var{soft}, \var{hard})} with the current
|
Returns a tuple \code{(\var{soft}, \var{hard})} with the current
|
||||||
soft and hard limits of \var{resource}. Raises \code{ValueError} if
|
soft and hard limits of \var{resource}. Raises \exception{ValueError} if
|
||||||
an invalid resource is specified, or \code{resource.error} if the
|
an invalid resource is specified, or \exception{error} if the
|
||||||
underyling system call fails unexpectedly.
|
underyling system call fails unexpectedly.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
|
|
@ -47,19 +47,19 @@ operating system are not defined in this module for those platforms.
|
||||||
integers describing the new limits. A value of \code{-1} can be used to
|
integers describing the new limits. A value of \code{-1} can be used to
|
||||||
specify the maximum possible upper limit.
|
specify the maximum possible upper limit.
|
||||||
|
|
||||||
Raises \code{ValueError} if an invalid resource is specified, if the new
|
Raises \exception{ValueError} if an invalid resource is specified,
|
||||||
soft limit exceeds the hard limit, or if a process tries to raise its
|
if the new soft limit exceeds the hard limit, or if a process tries
|
||||||
hard limit (unless the process has an effective UID of
|
to raise its hard limit (unless the process has an effective UID of
|
||||||
super-user). Can also raise a \code{resource.error} if the
|
super-user). Can also raise \exception{error} if the underyling
|
||||||
underyling system call fails.
|
system call fails.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
These symbols define resources whose consumption can be controlled
|
These symbols define resources whose consumption can be controlled
|
||||||
using the \code{setrlimit()} and \code{getrlimit()} functions defined
|
using the \function{setrlimit()} and \function{getrlimit()} functions
|
||||||
below. The values of these symbols are exactly the constants used
|
described below. The values of these symbols are exactly the constants
|
||||||
by C programs.
|
used by \C{} programs.
|
||||||
|
|
||||||
The \UNIX{} man page for \code{getrlimit()} lists the available
|
The \UNIX{} man page for \manpage{getrlimit}{2} lists the available
|
||||||
resources. Note that not all systems use the same symbol or same
|
resources. Note that not all systems use the same symbol or same
|
||||||
value to denote the same resource.
|
value to denote the same resource.
|
||||||
|
|
||||||
|
|
@ -72,8 +72,8 @@ value to denote the same resource.
|
||||||
|
|
||||||
\begin{datadesc}{RLIMIT_CPU}
|
\begin{datadesc}{RLIMIT_CPU}
|
||||||
The maximum amount of CPU time (in seconds) that a process can
|
The maximum amount of CPU time (in seconds) that a process can
|
||||||
use. If this limit is exceeded, a \code{SIGXCPU} signal is sent to
|
use. If this limit is exceeded, a \constant{SIGXCPU} signal is sent to
|
||||||
the process. (See the \code{signal} module documentation for
|
the process. (See the \module{signal} module documentation for
|
||||||
information about how to catch this signal and do something useful,
|
information about how to catch this signal and do something useful,
|
||||||
e.g. flush open files to disk.)
|
e.g. flush open files to disk.)
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
@ -107,7 +107,7 @@ value to denote the same resource.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
\begin{datadesc}{RLIMIT_OFILE}
|
\begin{datadesc}{RLIMIT_OFILE}
|
||||||
The BSD name for \code{RLIMIT_NOFILE}.
|
The BSD name for \constant{RLIMIT_NOFILE}.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
\begin{datadesc}{RLIMIT_MEMLOC}
|
\begin{datadesc}{RLIMIT_MEMLOC}
|
||||||
|
|
@ -131,7 +131,7 @@ These functiona are used to retrieve resource usage information:
|
||||||
This function returns a large tuple that describes the resources
|
This function returns a large tuple that describes the resources
|
||||||
consumed by either the current process or its children, as specified
|
consumed by either the current process or its children, as specified
|
||||||
by the \var{who} parameter. The \var{who} parameter should be
|
by the \var{who} parameter. The \var{who} parameter should be
|
||||||
specified using one of the \code{RUSAGE_}* constants described
|
specified using one of the \code{RUSAGE_*} constants described
|
||||||
below.
|
below.
|
||||||
|
|
||||||
The elements of the return value each
|
The elements of the return value each
|
||||||
|
|
@ -143,9 +143,9 @@ These functiona are used to retrieve resource usage information:
|
||||||
The first two elements of the return value are floating point values
|
The first two elements of the return value are floating point values
|
||||||
representing the amount of time spent executing in user mode and the
|
representing the amount of time spent executing in user mode and the
|
||||||
amount of time spent executing in system mode, respectively. The
|
amount of time spent executing in system mode, respectively. The
|
||||||
remaining values are integers. Consult the \code{getrusage()} man page
|
remaining values are integers. Consult the \manpage{getrusage}{2}
|
||||||
for detailed information about these values. A brief summary is
|
man page for detailed information about these values. A brief
|
||||||
presented here:
|
summary is presented here:
|
||||||
|
|
||||||
\begin{tableii}{|r|l|}{code}{Offset}{Resource}
|
\begin{tableii}{|r|l|}{code}{Offset}{Resource}
|
||||||
\lineii{0}{time in user mode (float)}
|
\lineii{0}{time in user mode (float)}
|
||||||
|
|
@ -166,36 +166,36 @@ These functiona are used to retrieve resource usage information:
|
||||||
\lineii{15}{involuntary context switches}
|
\lineii{15}{involuntary context switches}
|
||||||
\end{tableii}
|
\end{tableii}
|
||||||
|
|
||||||
This function will raise a \code{ValueError} if an invalid \var{who}
|
This function will raise a \exception{ValueError} if an invalid
|
||||||
parameter is specified. It may also raise a \code{resource.error}
|
\var{who} parameter is specified. It may also raise
|
||||||
exception in unusual circumstances.
|
\exception{error} exception in unusual circumstances.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{getpagesize}{}
|
\begin{funcdesc}{getpagesize}{}
|
||||||
Returns the number of bytes in a system page. (This need not be the
|
Returns the number of bytes in a system page. (This need not be the
|
||||||
same as the hardware page size.) This function is useful for
|
same as the hardware page size.) This function is useful for
|
||||||
determining the number of bytes of memory a process is using. The
|
determining the number of bytes of memory a process is using. The
|
||||||
third element of the tuple returned by \code{getrusage} describes
|
third element of the tuple returned by \function{getrusage()} describes
|
||||||
memory usage in pages; multiplying by page size produces number of
|
memory usage in pages; multiplying by page size produces number of
|
||||||
bytes.
|
bytes.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
The following \code{RUSAGE_}* symbols are passed to the
|
The following \code{RUSAGE_*} symbols are passed to the
|
||||||
\code{getrusage()} function to specify which processes information
|
\function{getrusage()} function to specify which processes information
|
||||||
should be provided for.
|
should be provided for.
|
||||||
|
|
||||||
\begin{datadesc}{RUSAGE_SELF}
|
\begin{datadesc}{RUSAGE_SELF}
|
||||||
\code{RUSAGE_SELF} should be used to
|
\constant{RUSAGE_SELF} should be used to
|
||||||
request information pertaining only to the process itself.
|
request information pertaining only to the process itself.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
\begin{datadesc}{RUSAGE_CHILDREN}
|
\begin{datadesc}{RUSAGE_CHILDREN}
|
||||||
Pass to \code{getrusage()} to request resource information for child
|
Pass to \function{getrusage()} to request resource information for
|
||||||
processes of the calling process.
|
child processes of the calling process.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
\begin{datadesc}{RUSAGE_BOTH}
|
\begin{datadesc}{RUSAGE_BOTH}
|
||||||
Pass to \code{getrusage()} to request resources consumed by both the
|
Pass to \function{getrusage()} to request resources consumed by both
|
||||||
current process and child processes. May not be available on all
|
the current process and child processes. May not be available on all
|
||||||
systems.
|
systems.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ A single exception is defined for errors:
|
||||||
|
|
||||||
\subsection{Resource Limits}
|
\subsection{Resource Limits}
|
||||||
|
|
||||||
Resources usage can be limited using the \code{setrlimit()} function
|
Resources usage can be limited using the \function{setrlimit()} function
|
||||||
described below. Each resource is controlled by a pair of limits: a
|
described below. Each resource is controlled by a pair of limits: a
|
||||||
soft limit and a hard limit. The soft limit is the current limit, and
|
soft limit and a hard limit. The soft limit is the current limit, and
|
||||||
may be lowered or raised by a process over time. The soft limit can
|
may be lowered or raised by a process over time. The soft limit can
|
||||||
|
|
@ -29,15 +29,15 @@ value greater than the soft limit, but not raised. (Only processes with
|
||||||
the effective UID of the super-user can raise a hard limit.)
|
the effective UID of the super-user can raise a hard limit.)
|
||||||
|
|
||||||
The specific resources that can be limited are system dependent. They
|
The specific resources that can be limited are system dependent. They
|
||||||
are described in the \code{getrlimit()} man page. The resources
|
are described in the \manpage{getrlimit}{2} man page. The resources
|
||||||
listed below are supported when the underlying operating system
|
listed below are supported when the underlying operating system
|
||||||
supports them; resources which cannot be checked or controlled by the
|
supports them; resources which cannot be checked or controlled by the
|
||||||
operating system are not defined in this module for those platforms.
|
operating system are not defined in this module for those platforms.
|
||||||
|
|
||||||
\begin{funcdesc}{getrlimit}{resource}
|
\begin{funcdesc}{getrlimit}{resource}
|
||||||
Returns a tuple \code{(\var{soft}, \var{hard})} with the current
|
Returns a tuple \code{(\var{soft}, \var{hard})} with the current
|
||||||
soft and hard limits of \var{resource}. Raises \code{ValueError} if
|
soft and hard limits of \var{resource}. Raises \exception{ValueError} if
|
||||||
an invalid resource is specified, or \code{resource.error} if the
|
an invalid resource is specified, or \exception{error} if the
|
||||||
underyling system call fails unexpectedly.
|
underyling system call fails unexpectedly.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
|
|
@ -47,19 +47,19 @@ operating system are not defined in this module for those platforms.
|
||||||
integers describing the new limits. A value of \code{-1} can be used to
|
integers describing the new limits. A value of \code{-1} can be used to
|
||||||
specify the maximum possible upper limit.
|
specify the maximum possible upper limit.
|
||||||
|
|
||||||
Raises \code{ValueError} if an invalid resource is specified, if the new
|
Raises \exception{ValueError} if an invalid resource is specified,
|
||||||
soft limit exceeds the hard limit, or if a process tries to raise its
|
if the new soft limit exceeds the hard limit, or if a process tries
|
||||||
hard limit (unless the process has an effective UID of
|
to raise its hard limit (unless the process has an effective UID of
|
||||||
super-user). Can also raise a \code{resource.error} if the
|
super-user). Can also raise \exception{error} if the underyling
|
||||||
underyling system call fails.
|
system call fails.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
These symbols define resources whose consumption can be controlled
|
These symbols define resources whose consumption can be controlled
|
||||||
using the \code{setrlimit()} and \code{getrlimit()} functions defined
|
using the \function{setrlimit()} and \function{getrlimit()} functions
|
||||||
below. The values of these symbols are exactly the constants used
|
described below. The values of these symbols are exactly the constants
|
||||||
by C programs.
|
used by \C{} programs.
|
||||||
|
|
||||||
The \UNIX{} man page for \code{getrlimit()} lists the available
|
The \UNIX{} man page for \manpage{getrlimit}{2} lists the available
|
||||||
resources. Note that not all systems use the same symbol or same
|
resources. Note that not all systems use the same symbol or same
|
||||||
value to denote the same resource.
|
value to denote the same resource.
|
||||||
|
|
||||||
|
|
@ -72,8 +72,8 @@ value to denote the same resource.
|
||||||
|
|
||||||
\begin{datadesc}{RLIMIT_CPU}
|
\begin{datadesc}{RLIMIT_CPU}
|
||||||
The maximum amount of CPU time (in seconds) that a process can
|
The maximum amount of CPU time (in seconds) that a process can
|
||||||
use. If this limit is exceeded, a \code{SIGXCPU} signal is sent to
|
use. If this limit is exceeded, a \constant{SIGXCPU} signal is sent to
|
||||||
the process. (See the \code{signal} module documentation for
|
the process. (See the \module{signal} module documentation for
|
||||||
information about how to catch this signal and do something useful,
|
information about how to catch this signal and do something useful,
|
||||||
e.g. flush open files to disk.)
|
e.g. flush open files to disk.)
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
@ -107,7 +107,7 @@ value to denote the same resource.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
\begin{datadesc}{RLIMIT_OFILE}
|
\begin{datadesc}{RLIMIT_OFILE}
|
||||||
The BSD name for \code{RLIMIT_NOFILE}.
|
The BSD name for \constant{RLIMIT_NOFILE}.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
\begin{datadesc}{RLIMIT_MEMLOC}
|
\begin{datadesc}{RLIMIT_MEMLOC}
|
||||||
|
|
@ -131,7 +131,7 @@ These functiona are used to retrieve resource usage information:
|
||||||
This function returns a large tuple that describes the resources
|
This function returns a large tuple that describes the resources
|
||||||
consumed by either the current process or its children, as specified
|
consumed by either the current process or its children, as specified
|
||||||
by the \var{who} parameter. The \var{who} parameter should be
|
by the \var{who} parameter. The \var{who} parameter should be
|
||||||
specified using one of the \code{RUSAGE_}* constants described
|
specified using one of the \code{RUSAGE_*} constants described
|
||||||
below.
|
below.
|
||||||
|
|
||||||
The elements of the return value each
|
The elements of the return value each
|
||||||
|
|
@ -143,9 +143,9 @@ These functiona are used to retrieve resource usage information:
|
||||||
The first two elements of the return value are floating point values
|
The first two elements of the return value are floating point values
|
||||||
representing the amount of time spent executing in user mode and the
|
representing the amount of time spent executing in user mode and the
|
||||||
amount of time spent executing in system mode, respectively. The
|
amount of time spent executing in system mode, respectively. The
|
||||||
remaining values are integers. Consult the \code{getrusage()} man page
|
remaining values are integers. Consult the \manpage{getrusage}{2}
|
||||||
for detailed information about these values. A brief summary is
|
man page for detailed information about these values. A brief
|
||||||
presented here:
|
summary is presented here:
|
||||||
|
|
||||||
\begin{tableii}{|r|l|}{code}{Offset}{Resource}
|
\begin{tableii}{|r|l|}{code}{Offset}{Resource}
|
||||||
\lineii{0}{time in user mode (float)}
|
\lineii{0}{time in user mode (float)}
|
||||||
|
|
@ -166,36 +166,36 @@ These functiona are used to retrieve resource usage information:
|
||||||
\lineii{15}{involuntary context switches}
|
\lineii{15}{involuntary context switches}
|
||||||
\end{tableii}
|
\end{tableii}
|
||||||
|
|
||||||
This function will raise a \code{ValueError} if an invalid \var{who}
|
This function will raise a \exception{ValueError} if an invalid
|
||||||
parameter is specified. It may also raise a \code{resource.error}
|
\var{who} parameter is specified. It may also raise
|
||||||
exception in unusual circumstances.
|
\exception{error} exception in unusual circumstances.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{getpagesize}{}
|
\begin{funcdesc}{getpagesize}{}
|
||||||
Returns the number of bytes in a system page. (This need not be the
|
Returns the number of bytes in a system page. (This need not be the
|
||||||
same as the hardware page size.) This function is useful for
|
same as the hardware page size.) This function is useful for
|
||||||
determining the number of bytes of memory a process is using. The
|
determining the number of bytes of memory a process is using. The
|
||||||
third element of the tuple returned by \code{getrusage} describes
|
third element of the tuple returned by \function{getrusage()} describes
|
||||||
memory usage in pages; multiplying by page size produces number of
|
memory usage in pages; multiplying by page size produces number of
|
||||||
bytes.
|
bytes.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
The following \code{RUSAGE_}* symbols are passed to the
|
The following \code{RUSAGE_*} symbols are passed to the
|
||||||
\code{getrusage()} function to specify which processes information
|
\function{getrusage()} function to specify which processes information
|
||||||
should be provided for.
|
should be provided for.
|
||||||
|
|
||||||
\begin{datadesc}{RUSAGE_SELF}
|
\begin{datadesc}{RUSAGE_SELF}
|
||||||
\code{RUSAGE_SELF} should be used to
|
\constant{RUSAGE_SELF} should be used to
|
||||||
request information pertaining only to the process itself.
|
request information pertaining only to the process itself.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
\begin{datadesc}{RUSAGE_CHILDREN}
|
\begin{datadesc}{RUSAGE_CHILDREN}
|
||||||
Pass to \code{getrusage()} to request resource information for child
|
Pass to \function{getrusage()} to request resource information for
|
||||||
processes of the calling process.
|
child processes of the calling process.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
\begin{datadesc}{RUSAGE_BOTH}
|
\begin{datadesc}{RUSAGE_BOTH}
|
||||||
Pass to \code{getrusage()} to request resources consumed by both the
|
Pass to \function{getrusage()} to request resources consumed by both
|
||||||
current process and child processes. May not be available on all
|
the current process and child processes. May not be available on all
|
||||||
systems.
|
systems.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue