Subject: How to support clone devices (i.e. /dev/tcp)
To: None <>
From: Gordon W. Ross <>
List: tech-kern
Date: 11/15/1994 12:02:37
> From: Christos Zoulas <>
> Date: Tue, 15 Nov 1994 11:39:54 -0500

> Well, not everything uses; actually almost nothing except
> XFree86 and the berkeley utilities [telnet,rlogin,rsh].  Most of the
> commercial stuff including the version of X that comes bundled with the
> OS and framemaker uses directly.

Ugh!  That's really unfortunate.  I guess they couldn't figure out:

  cc -o the_objs.o -Bstatic -lX11 ... -Bdynamic -lsocket -lnsl

> But for /dev/udp and /dev/tcp there is no corresponding vnode.

Oh. I thought every open into specfs got a vnode...

> The solution I proposed is much more general; by passing struct file *
> in directly, the open routine can do anything it wants with it.

I see.  Including not even really doing a device open, I guess?
(doing a socreate() instead?)  Interesting.  Glad I asked.

> | I think the above interface can be implemented without any
> | changes outside the specfs module (though I'm not sure).
> You would need to change *every* device driver open() routine to take
> a pointer to a dev_t instead of dev_t itself. Plus all the files I had
> to change for my changes...

I suppose you're right.

> In any case; I have /dev/tcp and /dev/udp mostly working; well enough
> to run X clients [xclock] and telnet directly using /dev/tcp and
> nslookup using /dev/udp...
> Pretty amazing how few streams calls I needed to implement to make
> happy!

Great!  Congratulations.