[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Server writing: observations and questions

From: Roland McGrath
Subject: Re: Server writing: observations and questions
Date: Wed, 18 Oct 2000 01:58:21 -0400 (EDT)

> A client gets a port with a send right to the server using
> file_name_lookup, i.e.:
>       file_t server;
>       server = file_name_lookup (argv[1], O_READ, 0666);
> Generally, these above flags/permissions work, however what is the
> best combination and what do they mean in this context?

The same as for POSIX.1 open.  The mode argument is meaningless when you do
not use O_CREAT.  When talking to an RPC server for something other than
the io protocols, there is no need to use O_READ; you can use O_NORW (i.e. 0).

> When implementing the client, the expected results can be obtained from
> the server, however, if an invalid port, i.e. server, is used, perror
> cannot decode errno:

Ah, yes.  Those are the MIG_* error codes, which aren't defined in the
normal way using mach/error.h's format.  You can fix strerror in libc.

> Trying to do other operations, such as an `ls -l', on the server result in an
> unknown ipc.  How can I find out ipc it is?
>       neal@hurd:~/time (0)$ ls -l node server
>       ls: node: (ipc/mig) bad request message ID
>       -rwxr-xr-x    1 neal     neal       125568 Oct 15 10:19 server

You need to watch the request coming in to the server.  It means your demux
function returned zero.  So put a breakpoint on your demux function and see
what message id is coming in.  OR, stop right now and pick up work on
rpctrace so that you can use it to help you easily diagnose these things
instead of resorting to gdb.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]