On Mon, Dec 02, 2002 at 06:22:33PM -0800, Frank Saar wrote: > <---------------------------------------client--------------------> > int main() { > int r=3; > error_t err; > mach_port_t server; > server=file_name_lookup("/servers/testserver",0,0); > if (server==MACH_PORT_NULL) { > error(1,errno,"Couldnt open server port\n");
Use "err" instead errno here, and you get the strerror for that IPC error. The error_t type includes all POSIX error values, but also all errors from Mach and MiG. > error(1,errno,"get_random failed %d\n",err); Same here. > ports_manage_port_operations_multithread (pi->bucket, test_server, 0,0,0); Try to write a demuxer that calls test_server() || trivfs_demuxer(), so that you get the other RPCs handled, too. I think the parent filesystem will call the fsys_getroot() RPC on the server, and the error message you are seeing might be from that RPC rather than yours. > return 0; > } > -------------------------------------------------------------------------- > But when I copy the server to /servers/testserver and run the client I get > get_random_failed -303 as error. -303 is MIG_BAD_ID, that means the message ID was one not understood by the server. It rejected the message. But that might be a different message from the get_random message, depending on where the error is returned (you didn't give enough details). > I mean its quite clear that the server must be running. So I started it > before the client as a background process. So where´s problem ? Attach gdb to the server process and set a breakpoint at test_server. Then you see all incoming messages, and you will see what happens. Alternatively, use rpctrace to debug first the client, and if that looks ok, then the server by installing it as the translator: settrans -a /tmp/test /bin/rpctrace -o /tmp/test.out /hurd/testserver ... Note that rpctrace is a bit buggy, but it's worth a try. GDB is more powerful of course. Thanks, Marcus -- `Rhubarb is no Egyptian god.' GNU http://www.gnu.org [EMAIL PROTECTED] Marcus Brinkmann The Hurd http://www.gnu.org/software/hurd/ [EMAIL PROTECTED] http://www.marcus-brinkmann.de/ _______________________________________________ Bug-hurd mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-hurd