From f0b315478ba086aa2c9b3f9c551a28e54356f583 Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Thu, 14 Dec 2000 03:11:24 +0000 Subject: [PATCH] Update information on the locking() function, added the needed constants. (Thanks for the info, Tim!) --- Doc/lib/libmsvcrt.tex | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Doc/lib/libmsvcrt.tex b/Doc/lib/libmsvcrt.tex index 7e4c417739b..b0fed815a00 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};