summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libfcntl.tex
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-06-24 17:58:44 (GMT)
committerGuido van Rossum <guido@python.org>1999-06-24 17:58:44 (GMT)
commitcf6905f986613b20f00ebbcecf6cc07ce298cbee (patch)
tree663020e74ce5ef8286c9730ffabaa92d041c3757 /Doc/lib/libfcntl.tex
parent336a201d4fed1b800029f302653e851a430a166b (diff)
downloadcpython-cf6905f986613b20f00ebbcecf6cc07ce298cbee.zip
cpython-cf6905f986613b20f00ebbcecf6cc07ce298cbee.tar.gz
cpython-cf6905f986613b20f00ebbcecf6cc07ce298cbee.tar.bz2
Clarify the example by explicitly importing the fcntl module -- this
avoid being fooled into thinking that fcntl and FCNTL are the same thing -- they aren't! (fcntl is the extension, FCNTL.py is h2py output that defines all the constants). (XXX The example is still weird -- I think there's a more portable way to do locking now. That's for someone else to fix...)
Diffstat (limited to 'Doc/lib/libfcntl.tex')
-rw-r--r--Doc/lib/libfcntl.tex4
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/lib/libfcntl.tex b/Doc/lib/libfcntl.tex
index 37632be..6312222 100644
--- a/Doc/lib/libfcntl.tex
+++ b/Doc/lib/libfcntl.tex
@@ -63,13 +63,13 @@ opcodes in the C include files \code{<sys/fcntl.h>} and
Examples (all on a SVR4 compliant system):
\begin{verbatim}
-import struct, FCNTL
+import struct, fcntl, FCNTL
file = open(...)
rv = fcntl(file.fileno(), FCNTL.O_NDELAY, 1)
lockdata = struct.pack('hhllhh', FCNTL.F_WRLCK, 0, 0, 0, 0, 0)
-rv = fcntl(file.fileno(), FCNTL.F_SETLKW, lockdata)
+rv = fcntl.fcntl(file.fileno(), FCNTL.F_SETLKW, lockdata)
\end{verbatim}
Note that in the first example the return value variable \code{rv} will