Sha256: 6b5b3ba9d32a6a8b60a0a6ce0915aaaea78fa485611a0c05c5f7635dc47e11c5
Contents?: true
Size: 800 Bytes
Versions: 21
Compression:
Stored size: 800 Bytes
Contents
# frozen_string_literal: true module Facter module Resolvers module Solaris module FFI module Ioctl extend ::FFI::Library ffi_lib ::FFI::Library::LIBC, 'socket' attach_function :ioctl_base, :ioctl, %i[int int pointer], :int attach_function :open_socket, :socket, %i[int int int], :int attach_function :close_socket, :shutdown, %i[int int], :int attach_function :inet_ntop, %i[int pointer pointer uint], :string def self.ioctl(call_const, pointer, address_family = AF_INET) fd = Ioctl.open_socket(address_family, SOCK_DGRAM, 0) result = ioctl_base(fd, call_const, pointer) Ioctl.close_socket(fd, 2) result end end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems