Subject: Re: unix domain sockets with open() ability?
To: None <current-users@NetBSD.ORG>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: current-users
Date: 09/23/1997 18:13:20
[Note: replying to two different messages here.]

> After probing the code in src/sys/kern, I was contemplating a few
> different possible methods of making unix domain sockets openable:

> - rewriting sys_open() into two segments that does a vfs lookup to a
>   locked vnode beforehand in the nameidata struct, then calls
>   vn_open(), which has been modified to check for the presence of an
>   already locked vnode in the nameidata struct... but skips calling
>   vn_open() and opens a socket instead for a vnode of type VSOCK

This is the method I prefer, offhand.  (Note I haven't actually tried
implementing any of these, but the rest seem pretty icky to me; the
hack for /dev/fd/* is already bad enough.)

> Unless I have completely misunderstood you all, see /dev/log and
> syslogd's source code.

No no.  What's being discussed here is not how to use AF_LOCAL sockets,
but rather some way to arrange that using open(2) on a path that refers
to such a socket effectively do socket()-plus-connect().  At present
sockets exist in the filesystem but are weird objects that most
filesystem calls don't apply to; this would help alleviate that.  (I've
always thought AF_LOCAL (nee AF_UNIX) sockets should be open(2)able,
though I've never cared enough to actually _do_ anything about it.)

					der Mouse

		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B