Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
bd3dc1f0
Commit
bd3dc1f0
authored
Jan 25, 2001
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lockf_doc: a much better description of the lockf() function, based on
an eyeballing of the code.
parent
902446a2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
4 deletions
+23
-4
Modules/fcntlmodule.c
Modules/fcntlmodule.c
+23
-4
No files found.
Modules/fcntlmodule.c
View file @
bd3dc1f0
...
...
@@ -262,10 +262,29 @@ fcntl_lockf(PyObject *self, PyObject *args)
}
static
char
lockf_doc
[]
=
"lockf (fd, operation)
\n
\
\n
\
This is a wrapper around the FCNTL.F_SETLK and FCNTL.F_SETLKW fcntl()
\n
\
calls. See the Unix manual for details."
;
"lockf (fd, operation, length=0, start=0, whence=0)
This is essentially a wrapper around the fcntl() locking calls. fd is the
file descriptor of the file to lock or unlock, and operation is one of the
following values:
LOCK_UN - unlock
LOCK_SH - acquire a shared lock
LOCK_EX - acquire an exclusive lock
When operation is LOCK_SH or LOCK_EX, it can also be bit-wise OR'd with
LOCK_NB to avoid blocking on lock acquisition. If LOCK_NB is used and the
lock cannot be acquired, an IOError will be raised and the exception will
have an errno attribute set to EACCES or EAGAIN (depending on the operating
system -- for portability, check for either value).
length is the number of bytes to lock, with the default meaning to lock to
EOF. start is the byte offset, relative to whence, to that the lock
starts. whence is as with fileobj.seek(), specifically:
0 - relative to the start of the file (SEEK_SET)
1 - relative to the current buffer position (SEEK_CUR)
2 - relative to the end of the file (SEEK_END)"
;
/* List of functions */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment