Thread View: comp.sys.next.programmer
3 messages
3 total messages
Started by Anne Wilson
Sun, 12 Apr 1992 21:18
Transferring port access rights
Author: Anne Wilson
Date: Sun, 12 Apr 1992 21:18
Date: Sun, 12 Apr 1992 21:18
57 lines
2813 bytes
2813 bytes
I am puzzled about how to transfer port access rights across tasks.
I can think of three methods for a task to acquire port access rights,
but I don't fully understand the implications of each:
-------
1) port owner: allocates port, and does a netname_check_in();
client: does a netname_look_up();
Send rights seem to be conveyed to the client via netname_look_up,
although the docs don't say anything about this. This method has worked
fine for me.
This method is easy and simple. The programmer can use either the
network name server or the bootstrap server. Via the network name server,
ports can be found across a network. However, can receive rights could be
conveyed this way?
-------
2) port owner: allocates port, does a task_by_unix_pid() to get child
task's task id, then does a port_insert_send()/port_insert_receive()
to give child task send/receive rights;
client (in this case, child task): does nothing
I have tried this method, and have been unable to get a successful
execution of port_insert_send(). It tells me my 3rd argument, the "name
by which the receiving task will know the new rights", is invalid and
I'm not sure why. I gave up and went back to my old method, #1.
Does this method automatically construct a message that a programmer
might construct by hand, as in #3, below?
This method looks simple (if I could get it to work!). The only possible
drawback that I'm aware of is that the receiving task must reside on the
same host.
---------
3) port owner: allocates port, sends a message to client
client: waits for message
In this case, I'm not sure how to structure the message. Should
the message body be a port_t/port_rcv_t? Or, should the message body
be port_name_t and one of the predefined capabilities? What is the
difference between the two approaches, and when do you use each?
This method seems to require more effort on the part of the programmer.
But, my impression is that this is the only way to transfer arbitrary rights
to a task on an arbitrary host.
-------
If anyone has any insights or code snippets to share with me, I would
greatly appreciate it! I'm particularly interested in code for method
#3.
Also, for the NeXT people, perhaps some clearer documentation on this
topic would be useful. (Or did I miss it?) (Or maybe this should be
directed to the Mach people...)
Thanks in advance!
Anne
Re: Transferring port access rights
Author: Charles N. Herrick
Date: Sun, 12 Apr 1992 22:08
Date: Sun, 12 Apr 1992 22:08
18 lines
1138 bytes
1138 bytes
In article <53054@mimsy.umd.edu> wilson@mimsy.umd.edu (Anne Wilson) writes:
I am puzzled about how to transfer port access rights across tasks.
[... chomp ...]
Also, for the NeXT people, perhaps some clearer documentation on this
topic would be useful. (Or did I miss it?) (Or maybe this should be
directed to the Mach people...)
^^^^^^^^^^^-------> uh huh :-)
Thank you Anne!!
Oh, Avie ...
--
<-> My personal opinion, speaking only as myself, an individual :-) <->
<-> Not an official document of anyone <->
<-> from: a SUN SPARC1+ w/ SUNos 4.1 <->
Charles N. Herrick <cnh5730@calvin.tamu.edu>
Re: Transferring port access rights
Author: Christopher Maeda
Date: Mon, 13 Apr 1992 02:35
Date: Mon, 13 Apr 1992 02:35
19 lines
1438 bytes
1438 bytes
In article <CNH5730.92Apr12170836@calvin.tamu.edu> cnh5730@calvin.tamu.edu (Charles N. Herrick) writes: >In article <53054@mimsy.umd.edu> wilson@mimsy.umd.edu (Anne Wilson) writes: > I am puzzled about how to transfer port access rights across tasks. > > Also, for the NeXT people, perhaps some clearer documentation on this > topic would be useful. (Or did I miss it?) (Or maybe this should be > directed to the Mach people...) > ^^^^^^^^^^^-------> uh huh :-) > >Thank you Anne!! > >Oh, Avie ... Read the MIG docs. What's the problem? -- Chris Maeda, Grad Student and RetroGrouch <cmaeda@cs.cmu.edu> "A unix signature isn't a return address, it's the ASCII equivalent of a black velvet clown painting. It's a rectangle of carets surrounding a quote from a literary giant of weeniedom like Heinlein or Dr. Who."
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads