how to remove a lock from a locked file?

how to remove a lock from a locked file?

Post by W.R.Vo » Sun, 21 Aug 1994 00:30:35

I would like to lock files to allow multiple access
across a network of Decs and Suns, etc. I figure that
the fcntl call would be best since it does allow
NFS locking for both read and write. I have a small
program that tests the locking and for the most part
it works just fine. The problem that I'm having is
when I interrupt the program with a control/C. Is
stops but does not appear to release the lock. This
occurs in several other ways too. (quitting dbx while
a lock is in effect does it, seg faults, etc). I need
the lock to be released when the pgm terminates. I know
the man pages says that the lock is released, but the
next time I start the program, it waits for a lock
and never returns. I have to delete the file to release
the lock. The behaviour is the same on both Dec/Ultrix
4.2A and SunOs Sc2.0.1 so it doesn't appear to be a bug
in the OS (but maybe).

Does anyone out there in netland have an idea on why
this is occurring.

All your help is appreciated.


Bill Volz
Chevron Petroleum Technology Co.
Earth Model/Interpretation & Analysis Division.
P.O. Box 42832, Houston, TX, 77242-2832
Phone: (713) 596-2059 Fax: (713) 596-3009


1. netscape rpm from compaq + my box = lock lock lock

  I've been having some wierd lockups with the netscape rpm that compaq
released for linux alpha. I'm running a pc164 with two tulip cards in it,
with pppoe. Every once in awhile, I'll crank up netscape and look at a
site only to have my machine lock up amazingly tight. Has anyone seen this

Eric Jones                    

  If you can't figure out what to remove in the above addy to email me, then
you are a cephalopod.
  Here's a few email addresses to help out the spammers:        


2. Help: Lioncom (Conexant) ADSL modem under Linux Mandrake 9.0

3. Modem TX and RX status via Num Lock-Caps Lock-Scroll Lock

4. snmpdx: error while recieving pdu

5. More mail file locking questions (lockf, NFS, /var/spool/mail/*.lock)

6. Answer: Power-Saving Mode in XFREE86

7. Locked files - who has it locked?

8. dosemu drivers for matrox

9. "Can't read lock file /tmp/.X0-lock"

10. modem locked but I can't find the lock file

11. Apache: Cannot open lock file: /usr/logs/httpd.lock.10064

12. Fatal Server Error: Could not create lock file in /tmp/.tX0-lock???

13. remove() call and file lock