|
From: | Manu Valderrama |
Subject: | Re: Trying to.... It's amazing and it works! |
Date: | Wed, 12 Jun 2002 20:36:33 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529 |
Well, first, that is not a macro. But you use it only if you want to make a send right, that's right. Remember what I've said. Using MACH_MSG_TYPE_MAKE_SEND is really like doing a mach_port_insert_right to create a send right, except that it does that during the message transfer: you supply it a _receive_ right (the one you created with mach_port_allocate), and it creates a send right during the message is transfered. Here, you should actually do like I said in the paragraph I just quoted: use MACH_MSG_TYPE_MAKE_SEND to create a send right, and receive it (as you receive your int), so you can use it later foranswering.
Taking into account your advice, my final code is something like that ;err = mach_port_allocate( mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &receive_port );
and filled the msgh_bits field with : my_message.head.msgh_bits = MACH_MSG_TYPE_MAKE_SEND;this appears to have some sense; like what you explain above... it also worked in the expected way. Anycase, I think that some time for repose the ideas and a bit more reading of "kernel principles" is the best I can do now for mach learning.
( I also have read the Mach chapter in Tanenbaum's book "Modern Operating System", first edition, I think ). Thans for the help!!
[Prev in Thread] | Current Thread | [Next in Thread] |