def send_right(right, remote_port)
      msg = SendRightMsg.new

      msg[:header].tap do |h|
        h[:remote_port] = remote_port.to_i
        h[:local_port] = PORT_NULL
        h[:bits] =
          (MsgType[right] | (0 << 8)) | 0x80000000 # MACH_MSGH_BITS_COMPLEX
        h[:size] = 40 # msg.size
      end

      msg[:body][:descriptor_count] = 1

      msg[:port].tap do |p|
        p[:name] = port
        p[:disposition] = MsgType[right]
        p[:type] = 0 # MSG_PORT_DESCRIPTOR;
      end
      
      mach_msg_send msg
    end
def send_right(right, remote_port)
      msg = SendRightMsg.new

      msg[:header].tap do |h|
        h[:remote_port] = remote_port.to_i
        h[:local_port] = PORT_NULL
        h[:bits] =
          (MsgType[right] | (0 << 8)) | 0x80000000 # MACH_MSGH_BITS_COMPLEX
        h[:size] = 40 # msg.size
      end

      msg[:body][:descriptor_count] = 1

      msg[:port].tap do |p|
        p[:name] = port
        p[:disposition] = MsgType[right]
        p[:type] = 0 # MSG_PORT_DESCRIPTOR;
      end
      
      mach_msg_send msg
    end
Send +right+ on this Port to +remote_port+.  The current task
 must already have the requisite rights allowing it to send
 +right+.