delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/12/31/18:39:08

Message-Id: <5.0.2.1.0.20001231145420.00a8bab0@pop5.banet.net>
X-Sender: usbanet DOT farley3 AT pop5 DOT banet DOT net
X-Mailer: QUALCOMM Windows Eudora Version 5.0.2
Date: Sun, 31 Dec 2000 18:40:38 -0500
To: <djgpp-workers AT delorie DOT com>
From: "Peter J. Farley III" <pjfarley AT banet DOT net>
Subject: fcntl locking changes #3: Notes
Mime-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com

Sorry I did not think to write these notes before.  It only occurred to 
me to write them after I got some rest.

The latest version of fcntl uses an internal function to perform all 
locking functions, both normal ones and "64"-level.  This internal 
function uses only the _dos_lock64 and _dos_unlock64 functions.  llseek 
is used in place of lseek consistently.

I have an inherit-bit test program from Mark E., but I forgot about it 
until today.  I will get that working and add it to the fcntl test 
suite.

There are new tests for fcntl, including non-zero locking positions in 
tfcntl2.c and a 3GB-file test.  The program makef3gb.c will make a 3GB 
file called "fcntl3gb.dat".  The program fcntl3gb.c expects there to be 
a 3GB file called "fcntl3gb.dat" in the current directory when it is 
run, and will test fcntl using that file.

There are "*.ok" files in each of the test directories for fcntl, 
flock, and [l]lockf.  These show the results I got on my W98SE/DOS 
box/LFN=y system.  YMMV.

Int21/5C seems OK with any value for the starting position, including 
values beyond the current EOF for the file.  The only value that causes 
an error is if the length value passed to the interrupt is actually 
zero.  This can only happen if the "struct flock" argument to fcntl 
specifies the file's current EOF as the place to start locking from.  I 
also just realized that I need to document that restriction/error 
condition in the fcntl and lockf/llockf documentation.

As everyone can see, I split the package into 5 pieces for easier 
review and approval.  The relationships between the pieces are as 
follows:

strerror patch		Stands alone
ljmp/lcall patch	Required before building anything with gcc 2.952
			Includes changes to src/makefile.inc for GAS
			versions and LIBGCCA
dostrerr patch		Required to run any fcntl or flock/[l]lockf tests
fcntl patch		The main patch, includes only direct fcntl code,
			docs and tests
			Includes new function lfilelength, used by fcntl
			Includes changes to tests/makefile.inc for GAS
			versions and LIBGCCA
			Requires dostrerr patch
flock patch		Includes flock, lockf and llockf code, docs, and
			tests
			Requires dostrerr patch and fcntl patch

HTH.  I look forward to your review, comments and errata.

---------------------------------------------------------
Peter J. Farley III (pjfarley AT dorsai DOT org OR
                      pjfarley AT banet DOT net)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019