mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
SF #994605, fcntl example is broken
The last call to fcntl (which wasn't changed) doesn't work for me, but the first part works now. Backport candidate.
This commit is contained in:
parent
dc8e1942dd
commit
7728b4719e
1 changed files with 3 additions and 3 deletions
|
@ -151,10 +151,10 @@ to lock to the end of the file. The default for \var{whence} is also
|
|||
Examples (all on a SVR4 compliant system):
|
||||
|
||||
\begin{verbatim}
|
||||
import struct, fcntl
|
||||
import struct, fcntl, os
|
||||
|
||||
f = file(...)
|
||||
rv = fcntl(f, fcntl.F_SETFL, os.O_NDELAY)
|
||||
f = open(...)
|
||||
rv = fcntl.fcntl(f, fcntl.F_SETFL, os.O_NDELAY)
|
||||
|
||||
lockdata = struct.pack('hhllhh', fcntl.F_WRLCK, 0, 0, 0, 0, 0)
|
||||
rv = fcntl.fcntl(f, fcntl.F_SETLKW, lockdata)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue