# File lib/unix/sys/uptime.rb, line 95
    def self.boot_time
      if Config::CONFIG['host_os'] =~ /linux/i
        Time.now - self.seconds
      elsif respond_to?(:sysctl, true)
        tv = Timeval.new
        mib  = FFI::MemoryPointer.new(:int, 2).write_array_of_int([CTL_KERN, KERN_BOOTTIME])
        size = FFI::MemoryPointer.new(:long, 1).write_int(tv.size)

        if sysctl(mib, 2, tv, size, nil, 0) != 0
          raise SystemCallError, 'sysctl() - ' + strerror(FFI.errno)
        end

        Time.at(tv[:tv_sec], tv[:tv_usec])
      else
        begin
          setutxent()
          while ent = Utmpx.new(getutxent())
            if ent[:ut_type] == BOOT_TIME
              time = Time.at(ent[:ut_tv][:tv_sec], ent[:ut_tv][:tv_usec])
              break
            end
          end
        ensure
          endutxent()
        end
        time
      end
    end