Sha256: f6e80914d1c5219636975473c11628d764adc07f51668f77375028aeaeadf8f0

Contents?: true

Size: 996 Bytes

Versions: 17

Compression:

Stored size: 996 Bytes

Contents

require 'ffi'

module KQueue
  # This module contains the low-level foreign-function interface code
  # for dealing with the kqueue C APIs.
  # It's an implementation detail, and not meant for users to deal with.
  #
  # @private
  module Native
    extend FFI::Library

    # The C struct describing a kqueue event.
    #
    # @private
    class KEvent < FFI::Struct
      layout(
        :ident,  :uintptr_t,
        :filter, :int16,
        :flags,  :uint16,
        :fflags, :uint32,
        :data,   :intptr_t,
        :udata,  :pointer)
    end

    # The C struct describing a timeout.
    #
    # @private
    class TimeSpec < FFI::Struct
      layout(
        :tv_sec, :time_t,
        :tv_nsec, :long)
    end

    ffi_lib FFI::Library::LIBC

    attach_function :kqueue, [], :int
    attach_function :kevent, [:int, :pointer, :int, :pointer, :int, :pointer], :int, :blocking => true

    attach_function :open, [:string, :int], :int
    attach_function :close, [:int], :int
  end
end

Version data entries

17 entries across 17 versions & 5 rubygems

Version Path
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rb-kqueue-0.2.4/lib/rb-kqueue/native.rb
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/gems/rb-kqueue-0.2.4/lib/rb-kqueue/native.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/gems/rb-kqueue-0.2.4/lib/rb-kqueue/native.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/gems/rb-kqueue-0.2.4/lib/rb-kqueue/native.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/gems/rb-kqueue-0.2.4/lib/rb-kqueue/native.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/rb-kqueue-0.2.4/lib/rb-kqueue/native.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/rb-kqueue-0.2.4/lib/rb-kqueue/native.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/rb-kqueue-0.2.4/lib/rb-kqueue/native.rb
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/rb-kqueue-0.2.4/lib/rb-kqueue/native.rb
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/rb-kqueue-0.2.4/lib/rb-kqueue/native.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/rb-kqueue-0.2.4/lib/rb-kqueue/native.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/rb-kqueue-0.2.4/lib/rb-kqueue/native.rb
rb-kqueue-0.2.4 lib/rb-kqueue/native.rb
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/gems/rb-kqueue-0.2.3/lib/rb-kqueue/native.rb
rb-kqueue-0.2.3 lib/rb-kqueue/native.rb
rb-kqueue-0.2.2 lib/rb-kqueue/native.rb
rb-kqueue-0.2.1 lib/rb-kqueue/native.rb