bind() behavior inconsistency with Linux and MacOS

Corinna Vinschen corinna-cygwin@cygwin.com
Wed Jun 5 18:12:00 GMT 2019


On Jun  5 15:06, Petr Skočík wrote:
> Hi.
> 
> I don't know if this is technically a bug, but I've noticed that unlike
> on Linux or MacOS, I a cannot bind a unix domain socket in a child
> process and then listen on it in the parent.
> 
> The bind succeeds but `listen()` in the parent then fails with EINVAL.
> 
> (The reason I'd like to `bind` in a different process is so I could
> `chdir` to a different directory before `bind`ing and then conceptually
> back without having the `chdir` break file operations in different threads.)
> 
> Just wanted to let you guys know in case there was an easy fix.

There isn't.  The file information is not shared back into the parent
in the current state of file handling and the state info is important
in the AF_UNIX implementation.  That may change at one point, but that
requires that I get more time to hack on my new AF_UNIX code, which
looks pretty unlikely at the moment.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20190605/e0158f0e/attachment.sig>


More information about the Cygwin mailing list