From 16ceacb31e890a6475527b54c402b160e0d63b52 Mon Sep 17 00:00:00 2001 From: Patrick Mahoney Date: Sat, 21 Jan 2012 18:39:27 -0600 Subject: [PATCH] Document Port#insert_right method. --- lib/mach/port.rb | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/mach/port.rb b/lib/mach/port.rb index 80160e2..0f2c9fe 100644 --- a/lib/mach/port.rb +++ b/lib/mach/port.rb @@ -58,11 +58,23 @@ module Mach mach_port_deallocate(ipc_space.to_i, @port) end - def insert_right(msg_type, opts = {}) + # Insert +right+ into another ipc space. The current task must + # have sufficient rights to insert the requested right. + # + # @param [MachMsgType] right + # + # @param [Hash] opts + # + # @option opts [Port,Integer] :ipc_space the space (task port) into which + # +right+ will be inserted; defaults to this port's ipc_space + # + # @option opts [Port,Integer] :port the name the port right should + # have in :ipc_space; defaults to the same name as this port + def insert_right(right, opts = {}) ipc_space = opts[:ipc_space] || @ipc_space port_name = opts[:port_name] || @port - mach_port_insert_right(ipc_space.to_i, port_name.to_i, @port, msg_type) + mach_port_insert_right(ipc_space.to_i, port_name.to_i, @port, right) end # Send +right+ on this Port to +remote_port+. The current task