Re: mach_msg trouble

2006-11-25 Thread Constantine Kousoulos
Constantine Kousoulos wrote: ... port_err=mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, name); if (port_err!=KERN_SUCCESS) error(1, port_err, cannot allocate port, %d, port_err); msg_err=mach_msg(msg_body, MACH_RCV_MSG, 0, sizeof(msg_body), XXX,

Re: mach_msg trouble

2006-11-25 Thread Richard Braun
On Sat, Nov 25, 2006 at 10:32:17AM +0200, Constantine Kousoulos wrote: I bypassed the previous problem using mach_port_t rcv = mach_reply_port(); msg_err=mach_msg(header, MACH_RCV_MSG, 0, sizeof(header), rcv, MACH_MSG_TIMEOUT_NONE,

Re: mach_msg trouble

2006-11-25 Thread Constantine Kousoulos
Richard Braun wrote: ... When threads are in different tasks, the problem is usually solved by a server dedicated to registering ports and known by all threads. The Hurd actually uses the file system for this (see the Hurd function file_name_lookup()). It's not the role of Mach to provide such a

Re: mach_msg trouble

2006-11-25 Thread olafBuddenhagen
Hi, On Thu, Nov 23, 2006 at 09:31:27PM +0200, Constantine Kousoulos wrote: I'm trying to set up a simple server that just receives messages (not threaded). So, i have written [...] Out of curiosity: Why are you working at such a low abstraction level? You have some specific task in mind, or

Re: mach_msg trouble

2006-11-25 Thread Constantine Kousoulos
[EMAIL PROTECTED] wrote: Hi, On Thu, Nov 23, 2006 at 09:31:27PM +0200, Constantine Kousoulos wrote: I'm trying to set up a simple server that just receives messages (not threaded). So, i have written [...] Out of curiosity: Why are you working at such a low abstraction level? You have some

Re: mach_msg trouble

2006-11-25 Thread Richard Braun
On Sat, Nov 25, 2006 at 05:49:07PM +0200, Constantine Kousoulos wrote: Now it's my turn to be curious: can i do the same things at a higher abstraction level?? :) I didn't realise that the abstraction level was so low. I just try to utilise the interfaces that mach.texi and hurd.texi

mach_msg trouble

2006-11-24 Thread Constantine Kousoulos
I'm trying to set up a simple server that just receives messages (not threaded). So, i have written /* for port allocation */ ipc_space_t ist; kern_return_t port_err; mach_port_t name; task_t self; /* for message reception */ mach_msg_return_t msg_err; mach_msg_header_t msg_body;