[Python-checkins] CVS: python/dist/src/Modules fcntlmodule.c,2.26,2.27

Barry Warsaw bwarsaw@users.sourceforge.net
Wed, 24 Jan 2001 16:20:15 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv6478

Modified Files:
	fcntlmodule.c 
Log Message:
lockf_doc: a much better description of the lockf() function, based on
an eyeballing of the code.


Index: fcntlmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/fcntlmodule.c,v
retrieving revision 2.26
retrieving revision 2.27
diff -C2 -r2.26 -r2.27
*** fcntlmodule.c	2000/09/01 23:29:26	2.26
--- fcntlmodule.c	2001/01/25 00:20:13	2.27
***************
*** 263,270 ****
  
  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.";
  
  /* List of functions */
--- 263,289 ----
  
  static char lockf_doc [] =
! "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 */