The three patches from the previous comment are now on a branch, in case fetching is easier than copying them out of the comment: https://gitlab.winehq.org/giang17/wine/-/tree/afunix-followup That is this MR's series with the three commits on top (11125e58, 3614e867, 43a9f548). Two remarks on the SIO_AF_UNIX_GETPEERPID test patch: **The WS_ variant references a macro that is not defined there.** In the USE_WS_PREFIX branch of winsock2.h (lines 338-383) the added line reads #define WS_SIO_AF_UNIX_GETPEERPID _WSAIOR(IOC_VENDOR, 256) but IOC_VENDOR is only defined in the #else branch further down; inside the USE_WS_PREFIX branch only WS_IOC_VENDOR exists. The neighbouring lines all use WS_IOC_WS2, so this looks like a copy from the non-prefix half. It only surfaces when something builds with USE_WS_PREFIX and uses the macro, which the test does not. **The two definitions collide.** The test patch defines SIO_AF_UNIX_GETPEERPID in winsock2.h, the branch above defines it in afunix.h, and dlls/ws2_32/tests/sock.c includes both headers (lines 26 and 34). The definitions are not token identical (`WS(IOC_VENDOR)` versus `IOC_VENDOR`), so the preprocessor warns: warning: "SIO_AF_UNIX_GETPEERPID" redefined Only one of the two should remain. The Windows SDK and mingw-w64 declare the ioctl in afunix.h, which argues for that side; Wine keeping all SIO_* macros in winsock2.h argues for the other. If winsock2.h is preferred, the afunix.h commit on the branch should simply be dropped. Worth deciding once rather than twice, given bug 60201: the consumers listed there (userland socketpair() emulation in OCaml and QEMU, plus dbus and glib) are all ports of Windows source, and that kind of code includes afunix.h for SOCKADDR_UN. Whichever header ends up carrying the macro, an implementation for 60201 can then build on it without a second header change. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7650#note_149435