Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: neideck@nestvx.enet.dec.com (Burkhard Neidecker-Lutz)
Subject: Re: File locking in OSF/1
Date: 22 Apr 1993 11:49:42 GMT	[thread overview]
Message-ID: <1r60omINNa7u@usenet.pa.dec.com> (raw)
In-Reply-To: 1993Apr21.171103.26700@ninja.zso.dec.com

In article <1993Apr21.171103.26700@ninja.zso.dec.com> mtp@mold.zso.dec.com (Mike Peterson) writes:
>Does OSF/1 currently support file locking (other than classical UNIX advisory
>file locking)?  Are there plans to support real locking?  

Yes (at least DEC OSF/1 V1.2 does). From the man page for lockf(2):

The lockf() function locks and unlocks sections of an open file.  Unlike
  the fcntl() function, however, its interface is limited to setting only
  write (exclusive) locks.

  Although the lockf() and fcntl() functions are different, the implementa-
  tions are fully integrated.  Therefore, locks obtained from one function
  are honored and enforced by the other lock function.

  Each lock is either an enforced lock or an advisory lock, and must also be
  either a read lock or a write lock.

  Locks on a file are advisory or enforced depending on the mode of the file
  (see the chmod() function.) A given file can have advisory or enforced
  locks, but not both.  See the sys/mode.h header file for a description of
  file attributes.

  When a process holds an enforced exclusive lock on a section of a file, no
  other process can access that section of the file with the read() or
  write() functions. In addition, the open(), truncate(), and ftruncate()
  functions cannot truncate the locked section of the file.  If another pro-
  cess attempts to read or modify the locked section of the file, it sleeps
  until the section is unlocked or returns with an error indication.


		Burkhard Neidecker-Lutz

Distributed Multimedia Group, CEC Karlsruhe          EERP Portfolio Manager
Software Motion Pictures & BERKOM II Project         Multimedia Base Technology
Digital Equipment Corporation
neidecker@nestvx.enet.dec.com



      reply	other threads:[~1993-04-22 11:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-04-21 17:11 File locking in OSF/1 Mike Peterson
1993-04-22 11:49 ` Burkhard Neidecker-Lutz [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox