Sha256: d2c5740217f1707516ce3325632573b45042ec24c5dab4fee11a6a4c3af5cdba

Contents?: true

Size: 332 Bytes

Versions: 6

Compression:

Stored size: 332 Bytes

Contents

# This file is only available on Linux systems.

module RubySL
  module Socket
    module Foreign
      def self.getpeereid(descriptor)
        data = Foreign
          .getsockopt(descriptor, ::Socket::SOL_SOCKET, ::Socket::SO_PEERCRED)

        _, euid, egid = data.unpack('iii')

        [euid, egid]
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rubysl-socket-2.2.1 lib/rubysl/socket/linux.rb
rubysl-socket-2.2 lib/rubysl/socket/linux.rb
rubysl-socket-2.1.3 lib/rubysl/socket/linux.rb
rubysl-socket-2.1.2 lib/rubysl/socket/linux.rb
rubysl-socket-2.1.1 lib/rubysl/socket/linux.rb
rubysl-socket-2.1.0 lib/rubysl/socket/linux.rb