Ouch!! I'm somewhat confused with all this things! My main problem is 
with the
msgh_bits field in the header of the message; fortunately, you have give 
me some insight.

>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 for
>answering. 
>  
>
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!!




_______________________________________________
Help-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-hurd

Reply via email to