From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,9db7bd6028f66d64 X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1993-04-22 04:54:10 PST Path: gmd.de!newsserver.jvnc.net!howland.reston.ans.net!usc!sdd.hp.com!decwrl!pa.dec.com!nestvx!neideck From: neideck@nestvx.enet.dec.com (Burkhard Neidecker-Lutz) Newsgroups: comp.unix.osf.osf1 Subject: Re: File locking in OSF/1 Date: 22 Apr 1993 11:49:42 GMT Organization: CEC Karlsruhe Message-ID: <1r60omINNa7u@usenet.pa.dec.com> References: <1993Apr21.171103.26700@ninja.zso.dec.com> NNTP-Posting-Host: NESTVX 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