]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Clarify the example by explicitly importing the fcntl module -- this
authorGuido van Rossum <guido@python.org>
Thu, 24 Jun 1999 17:58:44 +0000 (17:58 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 24 Jun 1999 17:58:44 +0000 (17:58 +0000)
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...)

Doc/lib/libfcntl.tex

index 37632be54dc33b0daa9b7d48ad8f9f7aea7a9c40..63122227f24b525acf69018dc9a98bbc84052bd4 100644 (file)
@@ -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