Named AF_UNIX socket not working in cygwin1.dll of git HEAD.

Takashi Yano
Tue Jul 3 19:17:00 GMT 2018

Hi Corinna,

On Wed, 4 Jul 2018 02:01:08 +0900
Takashi Yano wrote:
> I have check and found this happens only in 32 bit version. I mean
> 32 bit cygwin on 64 bit windows 10. 64 bit version work as expected.

I have looked into this problem, and found calling af_local_set_secret()
in fhandler_socket_local::bind() causes exception 0xc0000005.

Calling RtlGenRandom() in af_local_set_secret() may not be as expected.

While building cygwin1.dll in 32 bit environment, following warning is
shown. This is probably the cause.

Warning: resolving _SystemFunction036 by linking to _SystemFunction036@8

I am not sure why, but the following patch seems to be able solve this

diff --git a/winsup/cygwin/ b/winsup/cygwin/
index 2e01f30a2..68786f3a4 100644
--- a/winsup/cygwin/
+++ b/winsup/cygwin/
@@ -21,7 +21,7 @@
 #undef u_long
 #define u_long __ms_u_long
-#include <w32api/ntsecapi.h>
+#include <ntsecapi.h>
 #include <w32api/ws2tcpip.h>
 #include <w32api/mswsock.h>
 #include <unistd.h>

Thank you.

Takashi Yano <>

Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list