Subject: Re: kern/6062: bind() to unix domain socket doesn't use emul path
To: Todd Vierling <tv@pobox.com>
From: Steve Peurifoy <sp128@ibm.net>
List: netbsd-bugs
Date: 08/28/1998 20:27:29
> :   When bind() attaches a path name to a unix domain socket, an applicable
> :   emulation path is not used in determining where to create the filesystem
> :   node.
> 
> This is deliberate.  The emulation path is only used when reading a file or
> when writing to an already existing file.  (The concept is, "if you're
> writing a new file, it may be wanted by something more than the emulation
> environment.")  It's not just bind() that is "affected" by this; it's
> open(..., O_CREAT) as well.

It's entirely possible that I'm missing something, but that's not how
I read the code (and behavior of at least one syscall other than bind()
in an emulation environment seems to bear this out).  For example,
hpux_sys_creat() invokes the macro HPUX_CHECK_ALT_CREAT() which indirectly
calls emul_find() with a final argument set to 1, which checks whether the
parent directory exists in the emulation tree and returns the suitably
modified path if it does.

In fact, the HP-UX X server creates a symlink in /tmp/.X11-unix to its
listen socket in /usr/spool/sockets/X11 and that link *is* created inside
the emulation tree.

-Steve