ruby/ext/socket
Samuel Williams ea8a7287e2
Add support for sockaddr_un on Windows. (#6513)
* Windows: Fix warning about undefined if_indextoname()

* Windows: Fix UNIXSocket on MINGW and make .pair more reliable

* Windows: Use nonblock=true for read tests with scheduler

* Windows: Move socket detection from File.socket? to File.stat

Add S_IFSOCK to Windows and interpret reparse points accordingly.
Enable tests that work now.

* Windows: Use wide-char functions to UNIXSocket

This fixes behaviour with non-ASCII characters.
It also fixes deletion of temporary UNIXSocket.pair files.

* Windows: Add UNIXSocket tests for specifics of Windows impl.

* Windows: fix VC build due to missing _snwprintf

Avoid usage of _snwprintf, since it fails linking ruby.dll like so:

  linking shared-library x64-vcruntime140-ruby320.dll
  x64-vcruntime140-ruby320.def : error LNK2001: unresolved external symbol snwprintf
  x64-vcruntime140-ruby320.def : error LNK2001: unresolved external symbol vsnwprintf_l

whereas linking miniruby.exe succeeds.

This patch uses snprintf on the UTF-8 string instead.

Also remove branch GetWindowsDirectoryW, since it doesn't work.

* Windows: Fix dangling symlink test failures

Co-authored-by: Lars Kanis <kanis@comcard.de>
2022-11-17 14:50:25 -08:00
..
lib Add support for sockaddr_un on Windows. (#6513) 2022-11-17 14:50:25 -08:00
.document * ext/socket/.document: Add ifaddr.c. 2013-05-14 14:48:00 +00:00
addrinfo.h Expand tabs [ci skip] 2022-07-21 09:42:04 -07:00
ancdata.c Try nil as default for 'default timeout'. (#6509) 2022-10-08 14:02:34 +13:00
basicsocket.c Try nil as default for 'default timeout'. (#6509) 2022-10-08 14:02:34 +13:00
constants.c Expand tabs [ci skip] 2022-07-21 09:42:04 -07:00
depend Transition shape when object's capacity changes 2022-11-10 10:11:34 -05:00
extconf.rb Add support for sockaddr_un on Windows. (#6513) 2022-11-17 14:50:25 -08:00
getaddrinfo.c Expand tabs [ci skip] 2022-07-21 09:42:04 -07:00
getnameinfo.c Expand tabs [ci skip] 2022-07-21 09:42:04 -07:00
ifaddr.c Expand tabs [ci skip] 2022-07-21 09:42:04 -07:00
init.c Add support for sockaddr_un on Windows. (#6513) 2022-11-17 14:50:25 -08:00
ipsocket.c Expand tabs [ci skip] 2022-07-21 09:42:04 -07:00
mkconstants.rb sockopt adding Linux constants, SO_INCOMING_CPU/SO_INCOMING_NAPI_ID. 2022-09-21 17:15:54 +09:00
option.c Add support for sockaddr_un on Windows. (#6513) 2022-11-17 14:50:25 -08:00
raddrinfo.c Add support for sockaddr_un on Windows. (#6513) 2022-11-17 14:50:25 -08:00
rubysocket.h Add support for sockaddr_un on Windows. (#6513) 2022-11-17 14:50:25 -08:00
socket.c Add support for sockaddr_un on Windows. (#6513) 2022-11-17 14:50:25 -08:00
sockport.h * ext/socket: Bypass getaddrinfo() if node and serv are numeric. 2014-02-19 10:37:43 +00:00
sockssocket.c Expand tabs [ci skip] 2022-07-21 09:42:04 -07:00
tcpserver.c Expand tabs [ci skip] 2022-07-21 09:42:04 -07:00
tcpsocket.c Expand tabs [ci skip] 2022-07-21 09:42:04 -07:00
udpsocket.c Try nil as default for 'default timeout'. (#6509) 2022-10-08 14:02:34 +13:00
unixserver.c Add support for sockaddr_un on Windows. (#6513) 2022-11-17 14:50:25 -08:00
unixsocket.c Add support for sockaddr_un on Windows. (#6513) 2022-11-17 14:50:25 -08:00