🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cmu.cs.general
Article #142

Problem with lockf()

#142
From: Gerry Roston
Date: Thu, 13 Feb 1992 23:18
38 lines
2358 bytes
I ran into a very frustrating problem today with lockf().  I have two
programs, call thme big and small.  Small is a test program designed
to open() a file and then lockf() it.  Big [hacked version of bibcard]
is an xview program that does the same thing at one point.  Here's the
weirdness:

a>
run small  [locks file]
run small  [reports file locked, correct behavior]

b>
run small  [locks file]
run big    [reports file locked, correct behavior]

c>
run big    [locks file???]
run small  [does not report file locked!, Incorrect behavior.]

d>
run big    [locks file???]
run small  [does not report file locked!, Incorrect behavior.]
run small  [reprts file locked, but probably due to small.]

The locking code is identical in the two programs (i.e., emacs
cut-and-paste.)  Any ideas/suggestions are sought!  Please respond by
email.  Thanx for your help.

--
Gerry Roston (gerry@cs.cmu.edu) | Why has government been instituted at all?
Field Robotics Center,          | Because the passions of man will not con-
Carnegie Mellon University      | form to the dictates of reason and justice
Pittsburgh, PA, 15213           | without constraint.  Alexander Hamilton
(412) 268-3856                  | 
                                | 
The opinions expressed are mine | 
and do not reflect the official | 
position of CMU, FRC, RedZone,  | 
or any other organization.      | 
Technical Details
Message-ID: <GERRY.92Feb13181819@onion.cmu.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!gatech!udel!rochester!cantaloupe.srv.cs.cmu.edu!crabapple.srv.cs.cmu.edu!netnews.srv.cs.cmu.edu!gerry

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f8c9b,5147958df5dba927,start
X-Google-Attributes: gidf8c9b,public
X-Google-Thread: fb37e,5147958df5dba927,start
X-Google-Attributes: gidfb37e,public
X-Google-Thread: 1014db,5147958df5dba927,start
X-Google-Attributes: gid1014db,public
X-Google-Thread: 10f9b1,5147958df5dba927,start
X-Google-Attributes: gid10f9b1,public
X-Google-ArrivalTime: 1992-02-13 15:51:23 PST
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!gatech!udel!rochester!cantaloupe.srv.cs.cmu.edu!crabapple.srv.cs.cmu.edu!netnews.srv.cs.cmu.edu!gerry
From: gerry@cs.cmu.edu (Gerry Roston)
Newsgroups: cmu.cs.general,comp.lang.c,comp.unix.questions,comp.unix.wizards
Subject: Problem with lockf()
Message-ID: <GERRY.92Feb13181819@onion.cmu.edu>
Date: 13 Feb 92 23:18:19 GMT
Reply-To: gerry@cs.cmu.edu (Gerry Roston)
Organization: Field Robotics Center, CMU
Lines: 38
Nntp-Posting-Host: onion.frc.ri.cmu.edu