:manpage:`flock(2)` for details. (On some systems, this function is emulated
using :c:func:`fcntl`.)
+ If the :c:func:`flock` fails, an :exc:`IOError` exception is raised.
+
-.. function:: lockf(fd, operation, [length, [start, [whence]]])
+.. function:: lockf(fd, cmd, len=0, start=0, whence=0)
This is essentially a wrapper around the :func:`~fcntl.fcntl` locking calls.
- *fd* is the file descriptor of the file to lock or unlock, and *operation*
+ *fd* is the file descriptor of the file to lock or unlock, and *cmd*
is one of the following values:
* :const:`LOCK_UN` -- unlock