{ Linux specific implementation of the functions declared in VpUsrLow }

function SysLockFile(_Handle, _LockStart, _LockLength: LongInt): LongInt;
var
  Lock: PFLock;
begin
  New(Lock);

  with Lock^ do begin
    l_Type:=   F_WRLCK;
    l_Whence:= SEEK_SET;
    l_Start:=  _LockStart;
    l_Len:=    _LockLength;
    l_PID:=    0;
  end;

  SysLockFile:= LnxFCntl_3(_Handle, F_SETLK, Lock);

  Dispose(Lock);
end;

function SysUnLockFile(_Handle, _LockStart, _LockLength: LongInt): LongInt;
var
  Lock: PFLock;
begin
  New(Lock);

  with Lock^ do begin
    l_Type:=   F_UNLCK;
    l_Whence:= SEEK_SET;
    l_Start:=  _LockStart;
    l_Len:=    _LockLength;
    l_PID:=    0;
  end;

  SysUnLockFile:= LnxFCntl_3(_Handle, F_SETLK, Lock);

  Dispose(Lock);
end;

