summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libmsvcrt.tex
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-12-14 03:11:24 (GMT)
committerFred Drake <fdrake@acm.org>2000-12-14 03:11:24 (GMT)
commitf0b315478ba086aa2c9b3f9c551a28e54356f583 (patch)
treedd2cb94d9629ee00b7efdb521caa620ecf6cbfd5 /Doc/lib/libmsvcrt.tex
parentf7f88b11e4da965a3cdaebc419fb66f1eccb0f05 (diff)
downloadcpython-f0b315478ba086aa2c9b3f9c551a28e54356f583.zip
cpython-f0b315478ba086aa2c9b3f9c551a28e54356f583.tar.gz
cpython-f0b315478ba086aa2c9b3f9c551a28e54356f583.tar.bz2
Update information on the locking() function, added the needed constants.
(Thanks for the info, Tim!)
Diffstat (limited to 'Doc/lib/libmsvcrt.tex')
-rw-r--r--Doc/lib/libmsvcrt.tex28
1 files changed, 26 insertions, 2 deletions
diff --git a/Doc/lib/libmsvcrt.tex b/Doc/lib/libmsvcrt.tex
index 7e4c417..b0fed81 100644
--- a/Doc/lib/libmsvcrt.tex
+++ b/Doc/lib/libmsvcrt.tex
@@ -20,10 +20,34 @@ API documentation.
\subsection{File Operations \label{msvcrt-files}}
\begin{funcdesc}{locking}{fd, mode, nbytes}
- Lock part of a file based on a file descriptor from the C runtime.
- Raises \exception{IOError} on failure.
+ Lock part of a file based on file descriptor \var{fd} from the C
+ runtime. Raises \exception{IOError} on failure. The locked region
+ of the file extends from the current file position for \var{nbytes}
+ bytes, and may continue beyond the end of the file. \var{mode} must
+ be one of the \constant{LK_\var{*}} constants listed below.
+ Multiple regions in a file may be locked at the same time, but may
+ not overlap. Adjacent regions are not merged; they must be unlocked
+ individually.
\end{funcdesc}
+\begin{datadesc}{LK_LOCK}
+\dataline{LK_RLCK}
+ Locks the specified bytes. If the bytes cannot be locked, the
+ program immediately tries again after 1 second. If, after 10
+ attempts, the bytes cannot be locked, \exception{IOError} is
+ raised.
+\end{datadesc}
+
+\begin{datadesc}{LK_NBLCK}
+\dataline{LK_NBRLCK}
+ Locks the specified bytes. If the bytes cannot be locked,
+ \exception{IOError} is raised.
+\end{datadesc}
+
+\begin{datadesc}{LK_UNLCK}
+ Unlocks the specified bytes, which must have been previously locked.
+\end{datadesc}
+
\begin{funcdesc}{setmode}{fd, flags}
Set the line-end translation mode for the file descriptor \var{fd}.
To set it to text mode, \var{flags} should be \constant{os.O_TEXT};