Class: FFI::Flock

Inherits:
Struct
  • Object
show all
Includes:
Accessors
Defined in:
lib/ffi/flock.rb

Overview

Flocking operation

Defined Under Namespace

Modules: Enums

Instance Attribute Summary collapse

Method Summary

Methods included from Accessors

#fill, included, #inspect, #to_h

Instance Attribute Details

#lenInteger (readonly)

Returns the length of the region to be locked.

A value of 0 means the region extends to the end of the file.

Returns:

  • (Integer)

    the length of the region to be locked.

    A value of 0 means the region extends to the end of the file.



# File 'lib/ffi/flock.rb', line 38

#pidInteger (readonly)

Returns the process ID (see Process Creation Concepts) of the process holding the lock. It is filled in by calling fcntl with the F_GETLK command, but is ignored when making a lock. If the conflicting lock is an open file description lock (see Open File Description Locks), then this field will be set to -1.

Returns:

  • (Integer)

    the process ID (see Process Creation Concepts) of the process holding the lock. It is filled in by calling fcntl with the F_GETLK command, but is ignored when making a lock. If the conflicting lock is an open file description lock (see Open File Description Locks), then this field will be set to -1.



# File 'lib/ffi/flock.rb', line 43

#startInteger (readonly)

Returns the offset of the start of the region to which the lock applies, and is given in bytes relative to the point specified by ##whence member.

Returns:

  • (Integer)

    the offset of the start of the region to which the lock applies, and is given in bytes relative to the point specified by ##whence member.



# File 'lib/ffi/flock.rb', line 34

#typeSymbol (readonly)

Returns lock type, :rdlck, :wrlck, :unlck.

Returns:

  • (Symbol)

    lock type, :rdlck, :wrlck, :unlck



# File 'lib/ffi/flock.rb', line 27

#whenceSymbol (readonly)

Returns specifies what the offset is relative to, one of :seek_set, :seek_cur or :seek_end corresponding to the whence argument to fseek(2) or lseek(2),.

Returns:

  • (Symbol)

    specifies what the offset is relative to, one of :seek_set, :seek_cur or :seek_end corresponding to the whence argument to fseek(2) or lseek(2),



# File 'lib/ffi/flock.rb', line 30