•  Back 
  •  Libraries 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help 
  •  Show info about hypertext 
  •  View a new file 
Topic       : Pure C Library Documentation
Author      : John Kormylo
Version     : LIB.HYP 1.0
Subject     : Documentation/Pure C Library
Nodes       : 1309
Index Size  : 32068
HCP-Version : 3
Compiled on : Atari
@charset    : atarist
@lang       : en
@default    : 
@help       : Help
@options    : +g -i -s +x +z -t4
@width      : 75
View Ref-File[ Flock ]

#include <tos.h>

long Flock( int handle, int mode, long start, long length );

  <handle> is an I/O handle returned by Fcreate() or Fopen().
  <mode> is 0 to create a lock, or 1 to remove it.
  <start> is the byte offset to the start of the lock.
  <length> is the number of bytes to be protected, or
           0 to lock the rest of the file.


Function can be used to prevent other processes from accessing part
or all of a file.  The <start> and <length> parameters must match
exactly to remove a lock.

It returns 0 normally, or a BIOS/GEMDOS Error Code:
  -58 = conflicts with another lock (when locking)
  -59 = no matching lock found (when unlocking)

GEM Opcode 92

Note: Available when the '_FLK' cookie exists (see Cookies).

See also GEMDOS.