16 Commits

Author SHA1 Message Date
Brent Cook
c9b18cb296 fix get/setsockopt reversed logic 2023-07-06 22:05:06 +03:00
Brent Cook
f75c00226c remove unneeded extern since we're not trying to hack this into mingw-w64 2023-07-06 20:53:12 +03:00
Brent Cook
afcd4be8a7 change socket / file descriptor checks on windows
based on discussion in https://github.com/libressl/portable/issues/266
and https://bugs.python.org/issue23524 adjust the compat layer for
Windows to use _get_osfhandle in combination with
_set_thread_local_invalid_parameter_handler if applicable to more
reliably determine if a handle is a socket, file, or closed socket.

This prevents assertions when calling tls_close on an already-closed
socket.
2023-07-06 20:32:34 +03:00
Brent Cook
79f2a52a39 avoid exporting a sleep() symbol from libcrypto
Since it seems only MSVC lacks sleep(), and it's only used by apps, lets
special-case that and make it available as a static inline function
instead.
2020-04-14 22:29:37 -05:00
kinichiro
856d0511d6 Use posix_win.c functions on WIN32
- read() returns bytes count as 1 for crlf unless binary mode isn't
  specified with open(). Reported by @ulfworsoe in libressl-portable#542
- err could be WSANOTINITIALISED when WSAStartup() is not called
2019-07-28 19:10:47 +09:00
Brent Cook
a6d7ea9562 update autoconf for latest compat functions 2019-01-31 13:56:56 -06:00
Brent Cook
9e7fd1fa31 declare struct timezone outside of the function declaration 2017-08-13 16:04:03 -05:00
Brent Cook
3b2560feb3 MSVSC fixes 2017-01-16 10:59:24 -06:00
Brent Cook
f21bd20c7e add open(2) shim to handle O_BINARY and O_CLOEXEC 2017-01-16 10:59:15 -06:00
Brent Cook
69e2a7fb75 handle EBADF, which is returned when a file is passed 2017-01-15 16:00:16 -06:00
Brent Cook
bd8fe5868f include stdint.h uint*_t 2015-12-11 09:21:43 -06:00
Brent Cook
75ef5bb160 wrap gets on Windows, replacing '\r\n' with '\n' 2015-12-05 13:58:37 -06:00
Brent Cook
9d5eb631e3 move sleep shim to posix_win.c 2015-07-21 12:52:29 -06:00
Brent Cook
5d8a1cf715 add initial CMake and Visual Studio build support
This moves the compatibility include files from include to
include/compat so we can use the awful MS C compiler
<../include/> trick to emulate the GNU #include_next extension.

This also removes a few old compat files we do not need anymore.
2015-07-21 12:08:18 -05:00
Brent Cook
bc7b93470f add a missing header and fix typo in windows posix layer 2015-06-13 21:43:55 -05:00
Brent Cook
b4a6a61513 refactor win32 shims into posix_win.c
this also adds a rename shim that allows overwrites
2015-06-05 04:50:18 -05:00