From: Erik Talvola (talvola@qin.Berkeley.EDU)
Date: 09/30/92


From: talvola@qin.Berkeley.EDU (Erik Talvola)
Subject: File locking under Linux
Date: 30 Sep 1992 09:22:39


I recently pulled over tetris and cbzone from export, and decided to
try to compile them under Linux (using gcc 2.2.2 and xfree86-1.0Ya).
First, I had problems with linking - I assume /usr/X386/lib contains
the static libraries, and /usr/X386/lib/jump has the jump-table/shared
libraries, but I couldn't link with the ones in the jump subdirectory
(using -L/usr/X386/lib/jump) - I got something like "can't find directory ','"
which seemed bizarre to me.

Anyway, ignoring that problem, my main concern is about file locking. There
seems to be some support in Linux (there is a struct file_lock), but how
do you use it? Neither flock() or lockf() is defined, and both cbzone and
tetris use one of those (mainly flock() I guess). Is there some Posix
way to do file locking which isn't BSD or SYSV? Anyway, if someone could
give me a replacement for flock() in Linux terms, I would appreciate it.

-- Erik