Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
24e92084
Commit
24e92084
authored
Mar 11, 1998
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Logical markup.
parent
98b09005
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
62 deletions
+62
-62
Doc/lib/libresource.tex
Doc/lib/libresource.tex
+31
-31
Doc/libresource.tex
Doc/libresource.tex
+31
-31
No files found.
Doc/lib/libresource.tex
View file @
24e92084
...
@@ -20,7 +20,7 @@ A single exception is defined for errors:
...
@@ -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
...
@@ -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.
...
@@ -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 it
s
if the new soft limit exceeds the hard limit, or if a process trie
s
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.
...
@@ -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
\co
de
{
SIGXCPU
}
signal is sent to
use. If this limit is exceeded, a
\co
nstant
{
SIGXCPU
}
signal is sent to
the process. (See the
\
cod
e
{
signal
}
module documentation for
the process. (See the
\
modul
e
{
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.
...
@@ -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
\co
de
{
RLIMIT
_
NOFILE
}
.
The BSD name for
\co
nstant
{
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:
...
@@ -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:
...
@@ -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:
...
@@ -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
}
\co
de
{
RUSAGE
_
SELF
}
should be used to
\co
nstant
{
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}
Doc/libresource.tex
View file @
24e92084
...
@@ -20,7 +20,7 @@ A single exception is defined for errors:
...
@@ -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
...
@@ -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.
...
@@ -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 it
s
if the new soft limit exceeds the hard limit, or if a process trie
s
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.
...
@@ -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
\co
de
{
SIGXCPU
}
signal is sent to
use. If this limit is exceeded, a
\co
nstant
{
SIGXCPU
}
signal is sent to
the process. (See the
\
cod
e
{
signal
}
module documentation for
the process. (See the
\
modul
e
{
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.
...
@@ -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
\co
de
{
RLIMIT
_
NOFILE
}
.
The BSD name for
\co
nstant
{
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:
...
@@ -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:
...
@@ -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:
...
@@ -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
}
\co
de
{
RUSAGE
_
SELF
}
should be used to
\co
nstant
{
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}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment