is this wise?

Leslie Mikesell les at chinet.chi.il.us
Thu May 11 03:08:23 AEST 1989


In article <54270 at uunet.UU.NET> rick at uunet.UU.NET (Rick Adams) writes:

>Do they really spend 3 system calls to get the clock time
>(open,read,close) or do they have some other scheme?

Do you open /dev/tty and close it every time you want to output a
character?

>It seems like a hell of a lot of work to find out something simple
>like the time of day. (Or am I still stuck in the past when
>performance mattered?)


With a scheme of providing an fd per resource, more standard fd's
could be defined and assumed to be inherited so the open/close
calls wouldn't have to be made.  Even without that, a process can
do the open() once and hang on to the fd.  The advantage is that
the connection is made at run-time and the actual service provided
could be modified by the requestor (by asking for a different named
resource) or the server (by re-mapping the request, perhaps to a
resource provided by another machine as in RFS files).

>How far does plan 9 take the clock as a file analogy? Do they
reset the clock if root does a seek on it?

A write would be the obvious thing.

>What about things like getpid or getppid?

Again, this would be great for networks - a single PID server could
make sure that pids where unique and allow them to be used in
lockfiles and such. 

Les Mikesell



More information about the Comp.unix.wizards mailing list